SourceForge logo
SourceForge logo
Menu

Re: [Matplotlib-users] Colours of histograms?

From: Jae-Joon L. <lee...@gm...> - 2009年12月30日 18:53:51
On Wed, Dec 30, 2009 at 12:05 PM, Eric Emsellem <eem...@es...> wrote:
> I have tried with rgba sequences but no luck there. The help of hist
> << color: matplotlib color arg or sequence of rgba tuples >>
>
Based on my quick look at the code, it seems that the documentation is
incorrect. I believe it should be "a tuple of rgba values", not
"sequence of rgba tuples", and I don't think it is possible to specify
color"s" using keyword arguments.
x1 = random(1000)
x2 = random(1000)
n, bins, patches = hist(np.array([x1, x2]).transpose())
plt.setp(patches[0], color="r")
plt.setp(patches[1], color="b")
also see
http://matplotlib.sourceforge.net/examples/pylab_examples/hist_colormapped.html
Regards,
-JJ
p.s., Is it just me who think it is confusing that hist([x1,x2])
interprets input differently when len(x1) == len(x2) and when len(x1)
!= len(x2)?

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /