ProjectPythia/pythia-foundations

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

Closed this issue · 2 comments

Hi!

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

"ax2.set_ylim(257, 312)\n",
"ax2.set_xlim(95, 162);"

even if it's created earlier with sharex=ax, sharey=ax:

"ax2 = fig.add_subplot(1, 2, 2, sharex=ax, sharey=ax)\n",

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 ?

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.

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