i newbie in python. please excuse dummy question. want implement similar following matlab code, stuck python equivalents:
... subplot (2,1,1); h = plot (rand(100,5)); c = (h, 'color') h = area (myx, myy); h(1).facecolor = c1; h(2).facecolor = c2; grid on; ...
could kindly shed me lights? in advance!
have @ matplotlib plotting. then, can use get_color()
line objects.
this minimal example:
import numpy np import matplotlib.pyplot plt a=np.random.random((100,5)) fig, ax = plt.subplots() lines=ax.plot(a) #line_colors list of colors used lines in plot. in string format, i.e. 'b' blue etc. line_colors=[l.get_color() l in lines]
Comments
Post a Comment