Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
other:python:jyp_steps [2019/05/23 16:54] – [Matplotlib] Added ref to subplot_adjust jypeter | other:python:jyp_steps [2019/05/24 17:23] – [Matplotlib] jypeter |
---|
- some resources for having multiple plots on the same figure | - some resources for having multiple plots on the same figure |
* [[https://matplotlib.org/gallery/recipes/create_subplots.html#sphx-glr-gallery-recipes-create-subplots-py|Easily creating subplots]] | * [[https://matplotlib.org/gallery/recipes/create_subplots.html#sphx-glr-gallery-recipes-create-subplots-py|Easily creating subplots]] |
| * [[https://matplotlib.org/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure.add_subplot|fig.add_subplot(...)]] |
| * [[https://matplotlib.org/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure.add_axes|fig.add_axes(...)]] |
| * [[https://matplotlib.org/api/_as_gen/matplotlib.pyplot.subplot.html|plt.subplot(...)]] |
| * [[https://matplotlib.org/api/_as_gen/matplotlib.pyplot.subplots.html|plt.subplots(...)]] with an **s** at the end ([[https://matplotlib.org/gallery/subplots_axes_and_figures/subplots_demo.html|demo]]) |
* [[https://matplotlib.org/api/_as_gen/matplotlib.pyplot.subplots_adjust.html|subplots_adjust]] can be used to change the boundaries | * [[https://matplotlib.org/api/_as_gen/matplotlib.pyplot.subplots_adjust.html|subplots_adjust]] can be used to change the boundaries |
* [[https://matplotlib.org/gallery/index.html#subplots-axes-and-figures|Subplots, axes and figures]] gallery | * [[https://matplotlib.org/gallery/index.html#subplots-axes-and-figures|Subplots, axes and figures]] gallery |
- the documentation may mention [[http://matplotlib.org/faq/usage_faq.html#what-is-a-backend|backends]]. What?? Basically, you use python commands to create a plot, and the backend is the //thing// that will render your plot on the screen or in a file (png, pdf, etc...) | - the documentation may mention [[http://matplotlib.org/faq/usage_faq.html#what-is-a-backend|backends]]. What?? Basically, you use python commands to create a plot, and the backend is the //thing// that will render your plot on the screen or in a file (png, pdf, etc...) |
- if you don't see a part of what you have plotted, maybe it's hidden behind other elements! Use the [[https://matplotlib.org/examples/pylab_examples/zorder_demo.html|zorder parameter]] to explicitly specify the plotting order/layers | - if you don't see a part of what you have plotted, maybe it's hidden behind other elements! Use the [[https://matplotlib.org/examples/pylab_examples/zorder_demo.html|zorder parameter]] to explicitly specify the plotting order/layers |
| * things should work //as expected// if //zorder// is not explicitly specified |
| * Use the ''zorder=NN'' parameter when creating objects. ''NN'' is an integer where 0 is the lowest value (the farthest from the eye), and objects are plotted above objects with a lower //zorder// value |
| * Use ''matplotlib_object.set_order(NN)'' to change the order after an object has been created |
- Read the [[http://www.labri.fr/perso/nrougier/teaching/matplotlib/|Matplotlib tutorial by Nicolas Rougier]] | - Read the [[http://www.labri.fr/perso/nrougier/teaching/matplotlib/|Matplotlib tutorial by Nicolas Rougier]] |
- Download the [[http://matplotlib.org/contents.html|pdf version of the manual]]. **Do not print** the 2800+ pages of the manual! Read the beginner's guide (Chapter //FIVE// of //Part II//) and have a super quick look at the table of contents of the whole document. | - Download the [[http://matplotlib.org/contents.html|pdf version of the manual]]. **Do not print** the 2800+ pages of the manual! Read the beginner's guide (Chapter //FIVE// of //Part II//) and have a super quick look at the table of contents of the whole document. |