Skip to content

mfitzp/mplstyler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

image

image

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.

About

An API for assigning consistent marker styles to plots. Assign colours, markers, line-styles to labels and re-use on subsequent plots.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages