ProjectPythia / pythia-foundations

Jupyterbook source for the Foundations collection
http://foundations.projectpythia.org
Apache License 2.0
59 stars 42 forks source link

Issue on page /core/matplotlib/matplotlib-basics.html #274

Closed phil-blain closed 2 years ago

phil-blain commented 2 years ago

Hi!

I noticed that the second subplot in the "Putting this all together" section uses ax2.set_[xy]lim:

https://github.com/ProjectPythia/pythia-foundations/blob/9c3a75be8dffce205c714674942d7ec9323bdd92/core/matplotlib/matplotlib-basics.ipynb?short_path=59de0a2#L632-L633

even if it's created earlier with sharex=ax, sharey=ax: https://github.com/ProjectPythia/pythia-foundations/blob/9c3a75be8dffce205c714674942d7ec9323bdd92/core/matplotlib/matplotlib-basics.ipynb?short_path=59de0a2#L616

From what I see the axes limit set by ax.set_[xy]lim are ignored. Maybe these two calls could be removed, or a comment added mentioning that they are ignored because of share[xy]=ax ?

r-ford commented 2 years ago

Hi @phil-blain! I don't see ax.set_[xy]lim in the "Putting this all together" section, so the ax2.set_[xy]lim are needed to set the limits. I think that it would probably be clearer to set the limits in the first subplot instead of the second, but they seem to be equivalent.

phil-blain commented 2 years ago

Oh sorry you are right. Yes, maybe setting the limits in the first subplot would be slightly clearer.