Style Functions

prettyplot.config_plot(ax)

Configure multiple parameters of a plot.

This will call set_font, horizontal_grid, position_labels, and set_linestyle.

prettyplot.horizontal_grid(ax)

Add a horizontal grid.

Grid lines are white, and the background is set to a light gray. This way the grid lines are in the background and do not interfere with plot lines.

prettyplot.natural_log2_xaxis(ax, ticks)

Natural labels for a logarithmic x-axis with base 2.

This will set natural x-axis labels with suffixes ‘k’, ‘M’, ‘G’, etc.

prettyplot.position_labels(ax)

Position labels horizontally.

The x-label will be positioned on the right side of the x-axis. The y-label will be positioned on top of the plot, below the title. Unlike the default matplotlib label, the y-label will be printed horizontally. The title will be positioned on top of the y-label in a bold font.

prettyplot.set_font()

Sets a good font and font size.

By default ‘Source Sans Pro’ is used. The font needs to be installed. If the font is not picked up, try deleting the matplotlib font cache ($HOME/.cache/matplotlib/fontList.py3k.cache) and restart the python interpreter.

prettyplot.set_linestyle(ax)

Set styles for plot lines.

This adjusts marker, width, and alpha channel of plot lines.