Skip to content

Commit a8cdfbb

Browse files
committed
Update the documentation
1 parent f66e4e7 commit a8cdfbb

7 files changed

Lines changed: 78 additions & 36 deletions

File tree

README.md

Lines changed: 65 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,93 @@
22

33
# Multiplex
44

5-
Multiplex is a Python library that builds on matplotlib, providing new visualizations to help you explore your data and explain it better.
5+
Multiplex is a visualization library for Python built on [matplotlib](https://github.com/matplotlib/matplotlib/).
6+
Multiplex follows the principle that visualizations should tell a story in a beautiful way.
7+
This package is built with the intent of making it as easy as possible to transform data into beautiful visualizations.
68

7-
Creating narrative-driven visualizations involves re-imagining matplotlib's plots.
8-
Multiplex follows best-practices to help you create visualizations.
9-
The library adds the capability to add a description to visualizations and moves the legend to the top.
9+
> The instructions in this README.md file will get you a copy of the project up and running.
10+
> For use-cases of Multiplex, check out the [Jupyter Notebook examples](https://github.com/NicholasMamo/multiplex-plot/tree/master/examples).
11+
> To read more about Multiplex, read the [documentation](https://nicholasmamo.github.io/multiplex-plot/).
1012
11-
In addition, Multiplex includes:
13+
## Who is Multiplex for?
1214

13-
- A brand new text visualization modul to create text graphics or to annotate data anywhere on the plot,
14-
- A brand new graph visualization,
15-
- New matplotlib styles to make your data stand out.
15+
Multiplex is aimed at data scientists, researchers, students and all those who work with data and are familiar with Python.
16+
This library aims to make it easier to explore and explain data by creating beautiful visualizations.
1617

17-
![Example time series](https://raw.githubusercontent.com/NicholasMamo/multiplex-plot/master/examples/exports/3-temperatures.png)
18+
## Why Multiplex?
19+
20+
> If Multiplex is based on matplotlib, why not use matplotlib directly?
21+
22+
Multiplex does not replace matplotlib.
23+
Anything that you can do with Multiplex, you can also do with matplotlib.
24+
What Multiplex does is make it easier to create beautiful visualizations.
25+
This is achieved by providing:
1826

19-
The instructions in this README.md file will get you a copy of the project up and running.
20-
For use-cases of Multiplex, check out the Jupyter Notebook examples in the [examples](https://github.com/NicholasMamo/multiplex-plot/tree/master/examples) directory.
21-
To read more about Multiplex, read the [documentation](https://nicholasmamo.github.io/multiplex-plot/).
27+
* Custom matplotlib styles;
28+
* Functionality to caption visualizations;
29+
* Functionality to annotate any visualization with text; and
30+
* New types of visualizations not available in matplotlib, such as the network graph and text-based visualizations.
31+
32+
## How do I use Multiplex?
2233

2334
### Prerequisites
2435

2536
Multiplex is based on [matplotlib](https://github.com/matplotlib/matplotlib).
26-
You can install matplotlib using `python -m pip install -U matplotlib`.
37+
You can install matplotlib using pip: `python -m pip install -U matplotlib`.
2738
More details about it are available in [matplotlib's repository](https://github.com/matplotlib/matplotlib).
2839

40+
Multiplex also uses the following libraries in certain visualizations:
41+
42+
* [networkx](https://github.com/networkx/networkx)
43+
* [pandas](https://github.com/pandas-dev/pandas)
44+
2945
### Installing
3046

31-
You can install Multiplex using `python -m pip install -U multiplex-plot`.
47+
You can install Multiplex using pip: `python -m pip install -U multiplex-plot`.
3248

33-
## Running the tests
49+
### Creating visualizations
3450

35-
The tests use [unittest](https://docs.python.org/3/library/unittest.html).
36-
Each visualization has its own unit tests.
37-
You can run the tests individually:
51+
Creating visualizations with Multiplex is very easy.
52+
For example, you can create a text visualization with a simple function call, including all styling options:
3853

39-
```
40-
python3 -m unittest multiplex.tests.test_drawable
54+
```python
55+
import matplotlib.pyplot as plt
56+
from multiplex import drawable
57+
plt.style.use(os.path.join(sys.path[0], '..', 'styles', "multiplex.style"))
58+
viz = drawable.Drawable(plt.figure(figsize=(10, 2)))
59+
paragraph = """Anthony Lopes is a Portuguese professional footballer who plays for Olympique Lyonnais as a goalkeeper. He came through the youth ranks at Lyon, being called to the first team in 2011 and making his debut the following year."""
60+
style = { 'align': 'justify', 'fontfamily': 'serif', 'alpha': 0.9, 'lineheight': 1.25, 'lpad': 0.1, 'rpad': 0.1 }
61+
viz.draw_text_annotation(paragraph, **style)
62+
viz.set_title('Profile: Anthony Lopes', loc='left')
63+
viz.set_caption("""Wikipedia is a useful repository to get more information about anything. Below is an excerpt from the Wikipedia profile of footballer Anthony Lopes.""")
64+
plt.show()
4165
```
4266

43-
Or you can run the tests using the `tests.sh` script:
67+
![Example text annotation](https://raw.githubusercontent.com/NicholasMamo/multiplex-plot/master/examples/exports/2-simple-text.png)
4468

45-
```
46-
chmod +x tests.sh
47-
./tests.sh
48-
```
69+
All it takes to draw a simple text visualization is 10 lines of code:
70+
71+
1. Three lines to import matplotlib, Multiplex and the visualization style;
72+
2. Three lines to set up the visualization object, load the data and set the style;
73+
3. Four lines to draw and show the visualization, including a title and caption.
74+
75+
Multiplex abstracts the tedious process of manually programming which elements go where, and lets you create beautiful visualizations with ease.
76+
77+
For a quick start, check out the [Jupyter Notebook examples](https://github.com/NicholasMamo/multiplex-plot/tree/master/examples) for an easy-to-follow tour of Multiplex's capabilities.
78+
79+
## Example visualizations
80+
81+
![Example time series](https://raw.githubusercontent.com/NicholasMamo/multiplex-plot/master/examples/exports/3-temperatures.png)
82+
83+
![Example time series](https://raw.githubusercontent.com/NicholasMamo/multiplex-plot/master/examples/exports/3-time-series.png)
84+
85+
![Example network graph](https://raw.githubusercontent.com/NicholasMamo/multiplex-plot/master/examples/exports/4-marvel.png)
4986

50-
## Built With
87+
## Built with
5188

5289
* [matplotlib](https://github.com/matplotlib/matplotlib)
90+
* [networkx](https://github.com/networkx/networkx)
91+
* [pandas](https://github.com/pandas-dev/pandas)
5392

5493
## Versioning
5594

docs/.doctrees/environment.pickle

0 Bytes
Binary file not shown.

docs/.doctrees/index.doctree

191 Bytes
Binary file not shown.

docs/_sources/index.rst.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Multiplex
2424

2525
Multiplex is a visualization library for Python built on `matplotlib <https://github.com/matplotlib/matplotlib/>`_.
2626
Multiplex follows the principle that visualizations should tell a story in a beautiful way.
27-
This package is built with the intent of making it as easy as possible to transform data into beautiful visualizations.ons.
27+
This package is built with the intent of making it as easy as possible to transform data into beautiful visualizations.
2828

2929
.. note::
3030

@@ -65,8 +65,9 @@ What Multiplex does is make it easier to create beautiful visualizations.
6565
This is achieved by providing:
6666

6767
- Custom matplotlib styles;
68-
- Functionality to caption visualizations, as well as annotate any visualization with text; and
69-
- New types of visualizations not available in matplotlib, such as the graph and text-based visualizations.
68+
- Functionality to caption visualizations;
69+
- Functionality to annotate any visualization with text; and
70+
- New types of visualizations not available in matplotlib, such as the network graph and text-based visualizations.
7071

7172
For example, you can create a text visualization with a simple function call, including all styling options:
7273

docs/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
<h1>Multiplex<a class="headerlink" href="#multiplex" title="Permalink to this headline"></a></h1>
174174
<p>Multiplex is a visualization library for Python built on <a class="reference external" href="https://github.com/matplotlib/matplotlib/">matplotlib</a>.
175175
Multiplex follows the principle that visualizations should tell a story in a beautiful way.
176-
This package is built with the intent of making it as easy as possible to transform data into beautiful visualizations.ons.</p>
176+
This package is built with the intent of making it as easy as possible to transform data into beautiful visualizations.</p>
177177
<div class="admonition note">
178178
<p class="admonition-title">Note</p>
179179
<p>This website documents all of Multiplex’s functionality.
@@ -206,8 +206,9 @@ <h2>Why Multiplex?<a class="headerlink" href="#why-multiplex" title="Permalink t
206206
This is achieved by providing:</p>
207207
<ul class="simple">
208208
<li><p>Custom matplotlib styles;</p></li>
209-
<li><p>Functionality to caption visualizations, as well as annotate any visualization with text; and</p></li>
210-
<li><p>New types of visualizations not available in matplotlib, such as the graph and text-based visualizations.</p></li>
209+
<li><p>Functionality to caption visualizations;</p></li>
210+
<li><p>Functionality to annotate any visualization with text; and</p></li>
211+
<li><p>New types of visualizations not available in matplotlib, such as the network graph and text-based visualizations.</p></li>
211212
</ul>
212213
<p>For example, you can create a text visualization with a simple function call, including all styling options:</p>
213214
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1

0 commit comments

Comments
 (0)