The most reliable way to automatically select line styles in matplotlib in combination with marine

I'm looking for a reliable way to automatically select line styles for my stories. Now I have 8 lines for the plot, and I hope that it is possible to automatically select line styles that can be distinguished from each other.

At the moment, I have two ways. Set markers or define styles. Both seem to have problems with the seabed. The first is to use a cyclist:

plt.rc('axes', prop_cycle=cycler('linestyle', ['-', '--', ':', '-.'])) 

If I use this, either it overrides the marine settings, or it is overwritten by the sea, depending on the one I set first. Another way I found in one example and sets markers for strings:

 def makeStyles(): markers = [] for m in Line2D.markers: try: if len(m) == 1 and m != ' ': markers.append(m) except TypeError: pass styles = markers + [ r'$\lambda$', r'$\bowtie$', r'$\circlearrowleft$', r'$\clubsuit$', r'$\checkmark$'] return styles 

The problem here is that some of the markers seem to be the same, and this is just a line without a marker.

Is there any other way that works reliably and works with the seabed?

+6
source share
1 answer

If you want to save rcParams in your matplotlib and use the latest version of seaborn (> = 0.7.1), the easiest way is to use import seaborn.apionly , as described in what's new

0
source

All Articles