We should have an overview (possibly in the tutorials) which methods create Axes and when to use which.
This could contain the flow-chart blow plus additional descriptions.
I've not taken into account subgridspec and axes_grid1.
Am I missing some methods?
the diagram could be embedded using .. graphviz. However, while it renders with http://graphviz.it/ it currently does not with sphinx (issueing some errors).
The styling could still be improved (add links, font/color, use a HTML node instead of a record, ...)
Are there any methods to create axes that shouldn't be used? If so it would great to have this communicated.
It would also be great to have some substructure at each level to avoid choice paralysis. Something like highlighting one in green for each box of methods as the first thing someone should consider.
How about providing some basic imagery demonstrating the types of layouts being made on each level. Even just some arrays of squares with ellipses.
I am just learning matplotlib through the tutorials. The overview helps me to understand more about the creative logic. Understanding improve skill of application, I believe. So thank you.
In addition, do you think if it is possible to add general concepts which I could find in version 3.1.0 in the current released version (version 3.2.1) ? I think it is also important to understand the creative logic as well.
That's the plan. When trying that last year, it did not compile; see the original post. Should be tried again, but I don't have the time to work on this currently. Anybody is welcome to turn this in to a proper PR. But maybe it's better to wait until the new documentation structure is merged to see where in the docs this should go.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
ianhi commented on May 10, 2020
This would be great! I've always been a bit overwhelmed by this.
👍
I think you're missing Figure.gca() which will create an axis if one doesn't exist. https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure.gca
Suggestions:
YonghuiWang99 commented on May 10, 2020
I am just learning matplotlib through the tutorials. The overview helps me to understand more about the creative logic. Understanding improve skill of application, I believe. So thank you.
In addition, do you think if it is possible to add general concepts which I could find in version 3.1.0 in the current released version (version 3.2.1) ? I think it is also important to understand the creative logic as well.
https://matplotlib.org/3.1.0/tutorials/introductory/usage.html
timhoffm commented on Aug 29, 2021
digraph { node[shape=diamond, width=2.7, height=0.8] q_fullsize; q_simple_grid; q_complex_grid; q_inset; q_twin; node[shape=none, margin=0] full_size; q_fullsize [label="full size?"] full_size [label=< <FONT FACE="arial"><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="2" CELLPADDING="5"> <TR><TD BGCOLOR="gray90" ALIGN="left" WIDTH="200">plt.subplot()</TD><TD BGCOLOR="gray90" ALIGN="left" WIDTH="200">Figure.add_subplot()</TD></TR> <TR><TD BGCOLOR="gray90" ALIGN="left" WIDTH="200">plt.subplots()</TD><TD BGCOLOR="gray90" ALIGN="left">Figure.subplots()</TD></TR> </TABLE></FONT>>] q_simple_grid [label="simple grid?"] simple_grid [label=< <FONT FACE="arial"><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="2" CELLPADDING="5"> <TR><TD BGCOLOR="gray90" ALIGN="left" WIDTH="200">plt.subplot(n, m, k)</TD><TD BGCOLOR="gray90" ALIGN="left" WIDTH="200">Figure.add_subplot(n, m, k)</TD></TR> <TR><TD BGCOLOR="gray90" ALIGN="left">plt.subplots(n, m)</TD><TD BGCOLOR="gray90" ALIGN="left">Figure.subplots(n, m)</TD></TR> </TABLE></FONT>>] q_complex_grid [label="complex grid?"] complex_grid [label=< <FONT FACE="arial"><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="2" CELLPADDING="5"> <TR><TD BGCOLOR="gray90" ALIGN="left" WIDTH="200">plt.subplot_mosaic()</TD><TD BGCOLOR="gray90" ALIGN="left" WIDTH="200">Figure.subplot_mosaic()</TD></TR> <TR><TD BGCOLOR="gray90" ALIGN="left">plt.subplot2grid()</TD><TD BGCOLOR="gray90" ALIGN="left">Figure.subplot(subplotspec)</TD></TR> <TR><TD BGCOLOR="gray90" ALIGN="left">plt.subplot(subplotspec)</TD><TD BGCOLOR="gray90" ALIGN="left">Figure.subplots(gridspec_kw)</TD></TR> <TR><TD BGCOLOR="gray90" ALIGN="left">plt.subplots(gridspec_kw)</TD><TD BGCOLOR="gray90" ALIGN="left">GridSpec.subplots()</TD></TR> </TABLE></FONT>>] q_inset [label="inset?"] inset [label=< <FONT FACE="arial"><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="2" CELLPADDING="5" ALIGN="left"> <TR><TD BGCOLOR="gray90" ALIGN="left" WIDTH="200">Axes.inset_axes()</TD></TR> </TABLE></FONT>>] q_twin [label="twin?"] twin [label=< <FONT FACE="arial"><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="2" CELLPADDING="5"> <TR><TD BGCOLOR="gray90" ALIGN="left" WIDTH="200">plt.twinx()</TD><TD BGCOLOR="gray90" ALIGN="left" WIDTH="200">Axes.twinx()</TD></TR> <TR><TD BGCOLOR="gray90" ALIGN="left">plt.twiny()</TD><TD BGCOLOR="gray90" ALIGN="left">Axes.twiny()</TD></TR> </TABLE></FONT>>] axes [label=< <FONT FACE="arial"><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="2" CELLPADDING="5"> <TR><TD BGCOLOR="gray90" ALIGN="left" WIDTH="150">plt.axes()</TD><TD BGCOLOR="gray90" ALIGN="left" WIDTH="150">Figure.add_axes()</TD></TR> </TABLE></FONT>>] q_fullsize -> q_simple_grid [ label = "No" ]; q_simple_grid -> q_complex_grid [label = "No" ]; q_fullsize -> full_size [ label = "Yes" ]; q_simple_grid -> simple_grid[ label = "Yes" ]; q_complex_grid -> complex_grid [label = "Yes"]; q_complex_grid -> q_inset [label = "No"]; q_inset -> inset[label="Yes"]; q_inset -> q_twin [label="No"] q_twin -> twin[label="Yes"] q_twin -> axes[label="No"] { rank=same; q_fullsize full_size } { rank=same; q_simple_grid simple_grid } { rank=same; q_complex_grid complex_grid } { rank=same; q_inset inset } { rank=same; q_twin twin } }QuLogic commented on Aug 30, 2021
You can insert Graphviz diagrams into Sphinx; maybe you just want to copy what you have in directly somewhere?
timhoffm commented on Aug 30, 2021
That's the plan. When trying that last year, it did not compile; see the original post. Should be tried again, but I don't have the time to work on this currently. Anybody is welcome to turn this in to a proper PR. But maybe it's better to wait until the new documentation structure is merged to see where in the docs this should go.
DOC: Add overview of axes creation methods
DOC: Add overview of axes creation methods
DOC: Add overview of axes creation methods
DOC: Add overview of axes creation methods
github-actions commented on Aug 2, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
QuLogic commented on Aug 2, 2023
The PR has been opened; ergo this issue can stay open.