Skip to content

Release v0.0.2

Choose a tag to compare

@vhrabar vhrabar released this 08 Oct 09:56
· 66 commits to main since this release
f8bf0e0

Added

Plot kinds

  • step: like line, drawn as steps centred on each x.
  • area: filled areas, overlapping and semi-transparent by default.
    • area-stack stacks z on top of y, so the top edge is the total.
    • area-norm draws a 100% stack with a percent y axis. With leg, the legend goes outside on the right.
  • band: a y line with a shaded y ± z band in the same colour. z is required.
  • scatter with a text, bool or pandas categorical z draws one colour per category with a legend titled after z. A numeric z still gets a colorbar.

Flags

  • stack and norm. Both work with area only for now.

Themes

  • science: one journal column (3.5 in), 8 pt serif, inward ticks on all four sides, minor ticks, Paul Tol bright colours, saves at 600 dpi.
  • talk: slides (16:9), 18 pt sans, thick lines, Okabe-Ito colours.
  • poster: 12 × 9 in, 26 pt sans, very thick lines, saves at 300 dpi.
  • thesis: A4 text width (160 mm), Computer Modern 10/9 pt without needing LaTeX, saves as PDF when the file name has no extension.

Palettes

  • Named palettes live in styles/palettes/<name>.txt, one hex colour per line. Any file added there is found automatically.
  • okabe: the Okabe-Ito palette, 8 colours that stay distinguishable for every common type of colour blindness.
  • kx.palettes() lists the palettes and kx.palette(name) returns a palette's colours.
  • kx.use(theme, palette="okabe") accepts a palette name as well as a list of colours.

Colormaps

  • kx.use(theme, cmap=...) sets the colormap for continuous colour.
  • The supported matplotlib colormaps are viridis, magma, plasma, inferno, cividis, turbo, twilight, coolwarm, berlin, managua and vanimo.
  • kx.cmaps() lists only the ones the installed matplotlib has. berlin, managua and vanimo need matplotlib 3.10 or newer.