From 996bba4e47ad1e71924bedc765c2af6d8e85a29b Mon Sep 17 00:00:00 2001 From: Humphrey Yang <39026988+HumphreyYang@users.noreply.github.com> Date: Tue, 19 Sep 2023 16:00:15 +1000 Subject: [PATCH] Remove MatplotlibDeprecationWarning in Matplotlib Lecture (#289) * remove MatplotlibDeprecationWarning * update false-positive link --- lectures/_config.yml | 3 ++- lectures/matplotlib.md | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lectures/_config.yml b/lectures/_config.yml index 91635fb2..36ef737e 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -20,7 +20,8 @@ sphinx: # false-positive links linkcheck_ignore: ['https://github.com/matplotlib/matplotlib/blob/v3.6.2/lib/matplotlib/axes/_axes.py#L1417-L1669', 'https://ieeexplore.ieee.org/document/8757088', - 'https://www.sciencedirect.com/science/article/pii/S1477388021000177'] + 'https://www.sciencedirect.com/science/article/pii/S1477388021000177', + 'https://keras.io/'] html_favicon: _static/lectures-favicon.ico html_theme: quantecon_book_theme html_static_path: ['_static'] diff --git a/lectures/matplotlib.md b/lectures/matplotlib.md index 3890f883..eb9c31e2 100644 --- a/lectures/matplotlib.md +++ b/lectures/matplotlib.md @@ -319,7 +319,8 @@ def draw_graphs(style='default'): # and a line graph with random Y values axes[3].plot(x, rnormY, linewidth=2, alpha=0.7) - plt.suptitle(f'Style: {style}', fontsize=13) + style_name = style.split('-')[0] + plt.suptitle(f'Style: {style_name}', fontsize=13) plt.show() ``` @@ -329,7 +330,7 @@ Let's see what some of the styles look like. First, we draw graphs with the style sheet `seaborn` ```{code-cell} python3 -draw_graphs(style='seaborn') +draw_graphs(style='seaborn-v0_8') ``` We can use `grayscale` to remove colors in plots