A collection of plotting / coloring tools I've been using here and there. Finally I'm putting them into one place. One safe place.
Should be as simple as
pip install mikePlotLib
from mikeplotlib.sineBow import SineBow
SB = SineBow(100, mapType='rgb')
SB.makeColor(57.1) # (0, 245, 9)
SB.makeColor(57.1, hexFormat=True) # #00f509
cols = SB.getNColors(25)
from stackedBarGraph import StackedBarGrapher()
SBG = StackedBarGrapher()
SBG.demo()
import numpy as np
from matplotlib import pyplot as plt
from stackedBarGraph import StackedBarGrapher
SBG = StackedBarGrapher()
d = np.array([[101.,0.,0.,0.,0.,0.,0.],
[92.,3.,0.,4.,5.,6.,0.],
[56.,7.,8.,9.,23.,4.,5.],
[81.,2.,4.,5.,32.,33.,4.],
[0.,45.,2.,3.,45.,67.,8.],
[99.,5.,0.,0.,0.,43.,56.]])
d_widths = [.5,1.,3.,2.,1.,2.]
d_labels = ["fred","julie","sam","peter","rob","baz"]
d_colors = ['#2166ac', '#fee090', '#fdbb84', '#fc8d59', '#e34a33', '#b30000', '#777777']
fig = plt.figure()
ax = fig.add_subplot(111)
SBG.stackedBarPlot(ax,
d,
d_colors,
xLabels=d_labels,
yTicks=7,
widths=d_widths,
scale=True
)
plt.title("Scaled bars with set widths")
fig.subplots_adjust(bottom=0.4)
plt.tight_layout()
plt.show()
plt.close(fig)
del fig
from cb2cols import Cb2Cols as CB2
cb2 = CB2()
cb2.demo()
from cb2cols import Cb2Cols as CB2
cb2 = CB2()
col_set = "qualSet1"
colours = cb2.maps[col_set].values()[0:3]
If you experience any problems using mikePlotLib, open an issue on GitHub and tell us about it.
Project home page, info on the source tree, documentation, issues and how to contribute, see http://github.com/minillinim/mikePlotLib
This software is currently unpublished
Copyright (c) 2014 Michael Imelfort. See LICENSE.txt for further details.