SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Yves-Alexandre <yve...@ho...> - 2009年05月29日 21:34:49
Hi,
I'm trying to add label to a histogram with multiple data. The doc says 
"label can also be a sequence of strings" but when I try:
plt.hist([listA, listB, listC], bins=25, histtype='bar', 
alpha=0.75,rwidth=0.85,label=['A','B','C'])
I got an error:
"AttributeError: 'tuple' object has no attribute 'startswith'"
(for the entire traceback see http://paste.pocoo.org/show/119820/ )
is it me or a bug?
Can I add a legend in another way?
thanks in advance!
-Yva.
From: Uma S <uma...@gm...> - 2009年06月25日 05:37:03
Hi,
I have the same problem. If you found the solution could you please post?
Thanks
uma
Yves-Alexandre wrote:
> 
> Hi,
> 
> I'm trying to add label to a histogram with multiple data. The doc says 
> "label can also be a sequence of strings" but when I try:
> 
> plt.hist([listA, listB, listC], bins=25, histtype='bar', 
> alpha=0.75,rwidth=0.85,label=['A','B','C'])
> 
> I got an error:
> "AttributeError: 'tuple' object has no attribute 'startswith'"
> (for the entire traceback see http://paste.pocoo.org/show/119820/ )
> 
> is it me or a bug?
> 
> Can I add a legend in another way?
> 
> thanks in advance!
> 
> -Yva.
> 
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals.
> Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like
> Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/Histogram-with-multiple-data-tp23787422p24197283.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jae-Joon L. <lee...@gm...> - 2009年06月26日 17:46:37
I guess you're providing an input data with a wrong shape.
 aa = np.transpose([listA, listB, listC])
 plt.hist(aa, bins=4, histtype='bar',
alpha=0.75,rwidth=0.85,label=['A','B','C'])
Regards,
-JJ
On Thu, Jun 25, 2009 at 1:37 AM, Uma S<uma...@gm...> wrote:
>
> Hi,
> I have the same problem. If you found the solution could you please post?
>
> Thanks
>
> uma
>
>
>
> Yves-Alexandre wrote:
>>
>> Hi,
>>
>> I'm trying to add label to a histogram with multiple data. The doc says
>> "label can also be a sequence of strings" but when I try:
>>
>> plt.hist([listA, listB, listC], bins=25, histtype='bar',
>> alpha=0.75,rwidth=0.85,label=['A','B','C'])
>>
>> I got an error:
>> "AttributeError: 'tuple' object has no attribute 'startswith'"
>> (for the entire traceback see http://paste.pocoo.org/show/119820/ )
>>
>> is it me or a bug?
>>
>> Can I add a legend in another way?
>>
>> thanks in advance!
>>
>> -Yva.
>>
>> ------------------------------------------------------------------------------
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>> is a gathering of tech-side developers & brand creativity professionals.
>> Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>> iPhoneDevCamp as they present alongside digital heavyweights like
>> Barbarian
>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Histogram-with-multiple-data-tp23787422p24197283.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
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 によって変換されたページ (->オリジナル) /