Skip to content
An API for assigning consistent marker styles to plots. Assign colours, markers, line-styles to labels and re-use on subsequent plots.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
mplstyler
.gitignore
README.rst
output_3_0.png
output_4_0.png
setup.py

README.rst

mplstyler

An API for ensuring consistent line and marker styles across your plots. Assign colours, markers, line-styles to labels and re-use on subsequent plots. Styles can be matched to specific labels using exact or fuzzy matching to consecutively build up styles. Export styles to XML and re-import in subsequent sessions.

The following demo shows how to use StylesManager in auto mode to automatically set colors. More examples will be added shortly demonstrating the use of manual-styles.

Future planned features include XML import/export of styles and integration with mpltools.

::python

from mplstyler import StylesManager

styles = StylesManager() ::python

from pylab import * ::python

x = linspace(0, 5, 10) y1 = x ** 2 y2 = x ** 3 ::python

figure()

s = styles.get_style_for_class('Series 1') plot(x, y1, **s.kwargs)

s = styles.get_style_for_class('Series 2') plot(x, y2, **s.kwargs)

show()

output_4_0.png

Notice that Series 1 has again been displayed using the same colour, since the classname ('Series 1') is unchanged. However, Series 3 is assigned a new colour as it doesn't match any of the previous classes.

You can’t perform that action at this time.