Package: wedme-plots
👗 wedme-plots: We Don't Make Embarrassing PlotsMatplotlib styles for papers, posters and presentations. Tailored for academic use.Too long; didn't readimportwedme# Open a figure in `paper` style, with size (PAPER_CW, PAPER_DH)# which equals (journal column width, default height)wedme.figure.paper_cw_dh()# Open a figure with the style `slide` and size (SLIDE_TW, SLIDE_HH)# which equals (1/3 slide width, 1/2 slide height)wedme.figure.slide_tw_hh()StylingWe applied a clean style. The style and sizes ofpaperstyle are compatible with most journals (Nature, Science, Elsevier). Theslidestyle is compatible with a Microsoft Powerpoint presentation.posteris compatible with A0 posters.UsageImport thewedmemodule and apply the desired style. Then proceed withmatplotlibplotting as you're used to.Example:importwedme# These commands apply a style to subsequent Matplotlib figures.# For Elsevier-compatible paper styleswedme.paper()# For a 16:9 Powerpoint slidewedme.slide()# For A0 posters (not implemented yet)wedme.poster()# Proceed with plotting as usualimportnumpyasnpimportmatplotlib.pyplotaspltx=np.linspace(0,np.pi,1000)plt.figure()plt.plot(x,np.sin(x),label="Sine")plt.plot(x,np.cos(x),label="Cosine")plt.show()SizingFor custom figure sizes, we include reference points for every style:Paper. Default size:(wedme.PAPER_CW, wedme.paper_GH)wedme.PAPER_FWis the full textwidth of an Elsevier journal, 190mm.wedme.PAPER_CWis the full columnwidth of an Elsevier journal in two-column layout, 90mm.wedme.PAPER_GHis the height that has a golden ratio (1:1.618) towedme.PAPER_CW.Slide. Default size:(wedme.SLIDE_TW, wedme.slide_HH)wedme.SLIDE_FW,wedme.SLIDE_HWandwedme.SLIDE_TWrepresent 100%, 50% and 33% of the width of a Powerpoint 16:9 Widescreen slide.wedme.SLIDE_FH,wedme.SLIDE_HHandwedme.SLIDE_THrepresent 100%, 50% and 33% of the height of a Powerpoint 16:9 Widescreen slide.These can be used as follows:importwedmewedme.slide()# Create a new figure that occupies 33% of the width of a ppt slide and 50% its height.plt.figure(figsize=(wedme.SLIDE_TW,wedme.SLIDE_HH))Alternatively, we provide functions to compress the above code:wedme.figure.slide_tw_hh()Such a function exists for every combination of heights and widths for a given style.To open a figure with one ofwedme's styles without applying any sizing, use e.g.wedme.figure.slide()PowerpointPowerpoint automatically resizes artwork to a size that is different from the export size. To undo this:Insert the figure in Powerpoint.Picture Format > Reset Picture > Reset Picture & Size.FontsSans-serif fonts are the standards for figures because they remain readable even when small or pixelated. Helvetica or Arial fonts are preferred by Nature, Science and Elsevier.We try to find Helvetica, Arial, Verdana, Inter, Nimbus Sans on your system, in that order. The first font found will be applied to the figures.Exportingwedmesets thepdf.fonttypeparameter to42as recommended by Nature. This ensures that the text is editable even after exporting a pdf.wedmealso changes the parametersfigure.autolayoutandsavefig.bboxsuch that the specified sizes are respected.For saving figures, consider usingpypdfplotto maintain the ability to later change how data is displayed. Of course, we don't make embarassing plots to begin with.Examples