Native and external processing tools
Modify spines of the x or y axis
- Hide unwanted spines, see 1.2, 1.3
- Move spines to origin , see 1.3
- Add arrow tips to the top and right end of the spines
- Physical Review Journals - Axis Labels and Scales on Graphs - H-18
- graphics - Are there any guidelines for labeling axes in plots/graphs? - Academia Stack Exchange
- How to Label Axes and Units in Data Visualizations
- See source code examples: Spines - Place axis spines of plots
Add legend
- Show legend at best determined location inside data, see 2.1
- Position legend outside data, see 2.2
- Position legend entries horizontally or in a grid, see 2.2
- Annotate the lines directly within the data, see 2.3
- See source code examples: Function legend - Show formulas for multiple functions
Differentiate functions with color or line style
See source code examples: Cycles - Differentiate data set with colors or line style
Text
annotate interval
Multiline titles: Wrap overlong title
def wrap_title(axes):
import textwrap as tw
long_title = axes.get_title()
axes.set_title(tw.fill(long_title, 20))
Terminology
Explicit Axes through Figure fig
, Axes ax
Implicit Axes through PyPlot plt
- figure: entire canvas
- axes: subplot
- spines: connecting lines between ticks
- savefig.bbox: add tight padding around figure to prevent cropped legends
- constrained_layout: Place elements next to each other instead of overlaying
- titlesize 10: default fontsize for latex figures, allows longer titles
- grid linesstyle: less visual dominant that solid lines, to keep focus on function line
Dufte
- Source code examples: dufte plots
Size
Legend
Color gradients
Layout multiple subfigures
Sources:
Related:
Tags: