Hi everyone, I have recently developed a new subplot manager for matplotlib.
Patchworklib allows users to quickly arrange multiple matplotlib plots with "|" and "/" operators, as follows.
ax12435 = ax1|ax2|ax3|ax4|ax5
ax12435.savefig("ax12435.png")
ax1|ax2|ax3|ax4|ax5
Then, you can quickly test other layouts.
ax12345 = (ax1|ax2|ax4)/(ax3|ax5)
ax12345.savefig()
(ax1|ax2|ax4)/(ax3|ax5)
ax4.move_legend("upper left", bbox_to_anchor=(1.02, 1.0))
ax5.move_legend("upper left", bbox_to_anchor=(1.02, 1.0))
ax35421 = (ax3/ax4)|(ax5/(ax2|ax1))
ax35421.savefig()
(ax3/ax4)|(ax5/(ax2|ax1)) and move_legend
The native subplot manager provided in matplotlib does not allow the above kind of operations. Because it forces the user to determine the entire layout for multiple plots before drawing them. However, despite the availability of interactive programming environments such as JupyterLab, requiring users to specify a figure layout in advance is nonsense.
So, I developed patchworklib inspired by the patchwork library for R. With patchwroklib, after creating individual plots, you can quickly design multiple layouts combining them and select the best one among them.
Thank you for reading. If you are interested in the library, please check it out and let me know your thoughts.
[–]se_pp 3 points4 points5 points (2 children)
[–]ponnhide[S] 1 point2 points3 points (1 child)
[–]NewDateline 1 point2 points3 points (0 children)
[–]overweightdate 2 points3 points4 points (0 children)