Skip to content

Commit

Permalink
markdown source builds
Browse files Browse the repository at this point in the history
Auto-generated via {sandpaper}
Source  : 9dfcd03
Branch  : main
Author  : Olav Vahtras <olav.vahtras@gmail.com>
Time    : 2023-06-08 08:15:08 +0000
Message : Merge pull request #652 from serixscorpio/patch-1

Fix broken links to matplotlib in 09-plotting.md
  • Loading branch information
actions-user committed Jun 8, 2023
1 parent 985cfc4 commit 6c328b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions 09-plotting.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exercises: 15

## [`matplotlib`](https://matplotlib.org/) is the most widely used scientific plotting library in Python.

- Commonly use a sub-library called [`matplotlib.pyplot`](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.html#module-matplotlib.pyplot).
- Commonly use a sub-library called [`matplotlib.pyplot`](https://matplotlib.org/stable/tutorials/introductory/pyplot.html).
- The Jupyter Notebook will render plots inline by default.

```python
Expand Down Expand Up @@ -63,7 +63,6 @@ if several are created by a single cell.
## Plot data directly from a [`Pandas dataframe`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html).

- We can also plot [Pandas dataframes](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html).
- This implicitly uses [`matplotlib.pyplot`](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.html#module-matplotlib.pyplot).
- Before plotting, we convert the column headings from a `string` to `integer` data type, since they represent numerical values,
using [str.replace()](https://pandas.pydata.org/docs/reference/api/pandas.Series.str.replace.html) to remove the `gpdPercap_`
prefix and then [astype(int)](https://pandas.pydata.org/docs/reference/api/pandas.Series.astype.html)
Expand Down Expand Up @@ -331,7 +330,7 @@ of the plotted points.
If you are satisfied with the plot you see you may want to save it to a file,
perhaps to include it in a publication. There is a function in the
matplotlib.pyplot module that accomplishes this:
[savefig](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.savefig.html).
[savefig](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html).
Calling this function, e.g. with

```python
Expand Down Expand Up @@ -367,7 +366,7 @@ fig.savefig('my_figure.png')

Whenever you are generating plots to go into a paper or a presentation, there are a few things you can do to make sure that everyone can understand your plots.

- Always make sure your text is large enough to read. Use the `fontsize` parameter in `xlabel`, `ylabel`, `title`, and `legend`, and [`tick_params` with `labelsize`](https://matplotlib.org/2.1.1/api/_as_gen/matplotlib.pyplot.tick_params.html) to increase the text size of the numbers on your axes.
- Always make sure your text is large enough to read. Use the `fontsize` parameter in `xlabel`, `ylabel`, `title`, and `legend`, and [`tick_params` with `labelsize`](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.tick_params.html) to increase the text size of the numbers on your axes.
- Similarly, you should make your graph elements easy to see. Use `s` to increase the size of your scatterplot markers and `linewidth` to increase the sizes of your plot lines.
- Using color (and nothing else) to distinguish between different plot elements will make your plots unreadable to anyone who is colorblind, or who happens to have a black-and-white office printer. For lines, the `linestyle` parameter lets you use different types of lines. For scatterplots, `marker` lets you change the shape of your points. If you're unsure about your colors, you can use [Coblis](https://www.color-blindness.com/coblis-color-blindness-simulator/) or [Color Oracle](https://colororacle.org/) to simulate what your plots would look like to those with colorblindness.

Expand Down
2 changes: 1 addition & 1 deletion md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"episodes/06-libraries.md" "96899c58843e51f10eb84a8ac20ebb90" "site/built/06-libraries.md" "2023-05-02"
"episodes/07-reading-tabular.md" "b5b65e50037a583dfc5a3a879e4404b0" "site/built/07-reading-tabular.md" "2023-05-02"
"episodes/08-data-frames.md" "d1e90ca9269672f6ef02019d4238636a" "site/built/08-data-frames.md" "2023-06-05"
"episodes/09-plotting.md" "fca733c5f699e089feebdab0dac2b5b3" "site/built/09-plotting.md" "2023-05-02"
"episodes/09-plotting.md" "287bd269445772d6f0cadd05dab6b431" "site/built/09-plotting.md" "2023-06-08"
"episodes/10-lunch.md" "0624bfa89e628df443070e8c44271b33" "site/built/10-lunch.md" "2023-05-02"
"episodes/11-lists.md" "ff1bb5ec301422cf8a4cad6c6429bf4f" "site/built/11-lists.md" "2023-05-02"
"episodes/12-for-loops.md" "1da6e4e57a25f8d4fd64802c2eb682c4" "site/built/12-for-loops.md" "2023-05-02"
Expand Down

0 comments on commit 6c328b8

Please sign in to comment.