Skip to content

Commit 61ae7d1

Browse files
committed
_episodes/13-matplotlib.md: edit formatting of library names.
- Use capitalised names instead of backticks. - Edit line lengths.
1 parent 510e8a8 commit 61ae7d1

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

_episodes/13-matplotlib.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ it is fully controllable down to basic elements and includes a module `pylab` th
2424
(designed to feel like MATLAB plotting, if you happen to have done that before).
2525

2626
The Matplotlib library can be imported using any of the import techniques we have seen. As Pandas is generally imported
27-
with `import pandas as pd`, you will find that `matplotlib` is most commonly imported with `import matplotlib as plt` where 'plt' is the alias.
27+
with `import pandas as pd`, you will find that Matplotlib is most commonly imported with `import matplotlib as plt` where 'plt' is the alias.
2828

2929
In addition to importing the library, in a Jupyter notebook environment we need to tell Jupyter that when we produce a
3030
graph, we want it to be display the graph in a cell in the notebook just like any other results. To do this we use the `%matplotlib inline` directive.
@@ -35,10 +35,10 @@ and advanced plot types. One of its most useful features is formatting.
3535

3636
## Plotting with Pandas
3737

38-
The `pandas` library contains very tight integration with `matplotlib`. There are functions in `pandas` that
39-
automatically call `matplotlib` functions to produce graphs.
38+
The Pandas library contains very tight integration with Matplotlib. There are functions in Pandas that
39+
automatically call Matplotlib functions to produce graphs.
4040

41-
To plot with `pandas` we have to import it as we have done in past episodes.
41+
To plot with Pandas we have to import it as we have done in past episodes.
4242
To tell Jupyter that when we produce a graph we want it to be displayed in a cell in the notebook just like any other results,
4343
we use the `%matplotlib inline` directive. Without that we need to do a `show()` command.
4444

@@ -160,7 +160,10 @@ sns.boxplot(data=df,x ='village',y='buildings_in_compound')
160160
161161
![png](../fig/boxplot1.png)
162162
163-
We can make it look prettier with `seaborn`, much more easily than fixing components manually with `matplotlib`. [`Seaborn`](https://seaborn.pydata.org) is a Python data visualization library based on `matplotlib`. It provides a high-level interface for drawing attractive and informative statistical graphics. `Seaborn` comes with Anaconda; to make it available in our python session we need to import it.
163+
We can make it look prettier with Seaborn, much more easily than fixing components manually with Matplotlib.
164+
[Seaborn](https://seaborn.pydata.org) is a Python data visualization library based on Matplotlib.
165+
It provides a high-level interface for drawing attractive and informative statistical graphics.
166+
Seaborn comes with Anaconda; to make it available in our Python session we need to import it.
164167
165168
~~~
166169
import seaborn as sns
@@ -199,8 +202,10 @@ not through Pandas. First we need to import it.
199202
200203
## Customising our plots with Matplotlib
201204
202-
We can further customise our plots with `matplotlib` directly. First we need to import it.
203-
The `matplotlib` library can be imported using any of the import techniques we have seen. As `pandas` is generally imported with `import pandas as pd`, you will find that `matplotlib` is most commonly imported with `import matplotlib.pylab as plt` where `plt` is the alias.
205+
We can further customise our plots with Matplotlib directly. First we need to import it.
206+
The Matplotlib library can be imported using any of the import techniques we have seen.
207+
As Pandas is generally imported with `import pandas as pd`, you will find that `matplotlib` is most commonly imported
208+
with `import matplotlib.pyplot as plt` where `plt` is the alias.
204209
205210
~~~
206211
# Generate some date for 2 sets of points.

0 commit comments

Comments
 (0)