Package: prettypyplot
Docs•Features•Installation•GalleryprettypyplotThe documentation including an gallery can be foundhere.This is a wrapper package for matplotlib to achieve more easily pretty figures.
If you are looking for something complete, this project is nothing for you
but maybeseaborn. The main aspect of this
project is to help me syncing my rcParams files and to stop copy-pasting so
much code.The aim of this project is to simplify the generation of some simple
pre-defined figures. Almost all code is inspired or taken from thematplotlib gallery. If you are a
power user or interested in generating complex figures, this packages is not
ment for you and you should better take a look in the matplotlib gallery
directly.This project is in an alpha stage, hence it is neither stable nor ready for
production.CAUTION:
Starting from version 1.0.0 (which is far in the future) API-breaking
changes will be made only in major releases. Until then, it can be changed
in every minor release (seechangelog).FeaturesThe most notable features are:figsize specifies size of canvas. So labels, ticks or colorbars are not counted.Nice top-aligned outter legendsNew colorsUsageThis package uses an syntax very close to matplotlib. Hence, it should be
straight forward to use it. Instead of calling a function on the axes itself,
one needs to pass here the axes as an argument (args or kwargs).Installationpython3-mpipinstall--upgradeprettypyplotor for the latest dev versionpython3-mpipinstallgit+https://gitlab.com/braniii/prettypyplot.gitUsageimportmatplotlib.pyplotaspltimportprettypyplotasppltpplt.use_style()fig,ax=plt.subplots()...pplt.plot(ax=ax,x,y)pplt.savefig(output)Known Bugsplt.subplots_adjust()does not work withpplt.savefig(use_canvas_size=True)If you find one, please open an issue.pplt.savefig(use_canvas_size=True)is not compatible with a grid of subplotsKnown WorkaroundsThe methodpyplot.subplots_adjust()is not compatible with the optionuse_canvas_sizeinprettypyplot.plot.savefig,
use instead:# this doesn't work, use instead gridspecfig.subplots_adjust(hspace=0)# use this insteadfig,axs=plt.subplots(...,gridspec_kw={'hspace':0.000})Comparison tomatplotlibmatplotlib.pyplot.plotprettypyplot.plotmatplotlib.pyplot.legendprettypyplot.legendmatplotlib.pyplot.imshowprettypyplot.imshowmatplotlib.pyplot.colorbarprettypyplot.colorbarRoadmap:The following list is sorted fromnear futuretohopefully ever.add pytestadd search functionality in docrefactoring code to improve readabiltyadd package to conda_forgeadd gallery pageimproveplt.suplots()behaviour together withpplt.savefig()add more colorpalettesadd countour line plotaddaxes_gridexamplessetup widths and scaling factors for beamer and poster modetweak all function to enableSTYLE='minimal'implement tufte styleBuilding Documentation:The doc is based onmkdocsand can be created by# installing all dependenciespython-mpipinstall-e.[docs]# serve interactivelypython-mmkdocsserveSimilar ProjectsseabornCiting PrettypyplotIf you want to cite prettypyplot in scientific work please use:Prettypyplot: publication ready matplotlib figures made simpleD. Nagel,2022. Zenodo:10.5281/zenodo.7278312Credits:In alphabetical order:colorcyclepickercoolorsmatplotlibprettyplotlibrealpythonviscm