You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
167
+
We can make it look prettier with Seaborn, much more easily than fixing components manually with Matplotlib.
168
+
[Seaborn](https://seaborn.pydata.org) is a Python data visualization library based on Matplotlib.
169
+
It provides a high-level interface for drawing attractive and informative statistical graphics.
170
+
Seaborn comes with Anaconda; to make it available in our Python session we need to import it.
170
171
171
172
~~~
172
173
import seaborn as sns
@@ -205,10 +206,17 @@ not through Pandas. First we need to import it.
205
206
206
207
## Customising our plots with Matplotlib
207
208
208
-
We can further customise our plots with `matplotlib` directly. First we need to import it.
209
-
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.
209
+
We can further customise our plots with Matplotlib directly. First we need to import it.
210
+
The Matplotlib library can be imported using any of the import techniques we have seen.
211
+
As Pandas is generally imported with `import pandas as pd`, you will find that `matplotlib` is most commonly imported
212
+
with `import matplotlib.pyplot as plt` where `plt` is the alias.
213
+
For demonstration purposes, we are going to use randomly generated data, using the NumPy library (aliased here as `np`).
210
214
211
215
~~~
216
+
import numpy as np
217
+
import pandas as pd
218
+
import matplotlib.pyplot as plt
219
+
212
220
# Generate some date for 2 sets of points.
213
221
x1 = pd.Series(np.random.rand(20) - 0.5)
214
222
y1 = pd.Series(np.random.rand(20) - 0.5)
@@ -346,22 +354,6 @@ demonstrate some of the available features.
346
354
>
347
355
{: .challenge}
348
356
349
-
## Saving a graph
350
-
351
-
If you wish to save your graph as an image you can do so using the `savefig()` function. The image can be saved as a pdf, jpg or png file by changing the file extension.
0 commit comments