Gallery

71 figures · Open a figure to explore its code.

layout (11)

geometry (10)

plotting (16)

maps (9)

networks (6)

text (5)

math (12)

api (2)

(math_plot_labels)

Math on plots and axes

Axis tick labels can be Gum elements. Supply [value, element] pairs to Plot's xticks or yticks, or to Axis's ticks. The numeric value determines position; Tex supplies the label's math typography.

Titles, axis titles, and legend labels also accept elements. Use Text with inline Tex for mixed prose, or Latex for a display-style label. Labels are measured before the plot's margins are chosen, so a fraction can reserve more height than a plain numeral. Math elements receive the plot's inherited font size and color; explicit styling on the formula takes precedence.

The runnable example uses formulas in every label position. It plots sine and cosine with multiples of π on the horizontal axis and a mathematical legend.

See Plot, Axis, math inside prose, and math in slides.