SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S



1
(12)
2
(14)
3
(13)
4
(6)
5
(6)
6
(21)
7
(29)
8
(30)
9
(13)
10
(4)
11
(4)
12
(4)
13
(15)
14
(22)
15
(23)
16
(23)
17
(9)
18
(23)
19
(12)
20
(10)
21
(26)
22
(5)
23
(32)
24
(5)
25
(7)
26
(4)
27
(3)
28
(19)
29
(20)



Showing 6 results of 6

From: Martin M. <mmo...@fo...> - 2012年02月05日 17:56:09
HI,
 I have troubles getting to wirk a hitogram plot. I have colors in
RGB as tuples of 3 values and also some colors defined as string,
e.g. 'orange'. I get the folowing error:
 File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 2332, in hist
 ret = ax.hist(x, bins, range, normed, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, **kwargs)
 File "/usr/lib64/python2.7/site-packages/matplotlib/axes.py", line 7598, in hist
 raise ValueError("color kwarg must have one color per dataset")
ValueError: color kwarg must have one color per dataset
 I think it is about the code in this patch:
http://permalink.gmane.org/gmane.comp.python.matplotlib.scm/4600
 I hacked a bit the code in colors.py and axes.py to get more debug.
As you can see below it seems a previous value if left in the colors variable
from a previous iteration (I think).
['orange', (0.9468480101059871, 1.0, 0.0)] = colors[:2]
[cut]
 pylab.hist(counts[:2], histtype='bar', align='mid', log=True, bins=len(counts[:2]), color=colors[:2], label=adapternames[:2])
 File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 2332, in hist
 ret = ax.hist(x, bins, range, normed, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, **kwargs)
 File "/usr/lib64/python2.7/site-packages/matplotlib/axes.py", line 7598, in hist
 raise ValueError("color kwarg must have one color per dataset: color=%d, nx=%d, color='%s', nx='%s'" % (len(color), nx, str(color), str(nx)))
ValueError: color kwarg must have one color per dataset: color=2, nx=1, color='[[ 1. 0.64705882 0. 1. ]
 [ 0.94684801 1. 0. 1. ]]', nx='1'
 Alternatively I would believe that matplotlib breaks because I have for different
data points same color ('orange' appears maybe 10x in my colors list) but the above slice [:2]
excludes this a the cause I am getting right now.
If it matters I generated the colors by this approach:
 for _n in range(1,cnt1 + 1):
 _h1 = sorted([uniform(0.15, 0.85) for x in range(_n)])
 _HSV_tuples1 = [(_h1[x], 1.0, 1.0) for x in range(_n)]
 _RGB_tuples1 = map(lambda x: colorsys.hsv_to_rgb(*x), _HSV_tuples1)
but these are mixed together with those defined as string (e.g. 'orange')
before they are sent to matplotlib.
Thank you for you help.
Martin
BTW: Would be nice if the default error messages on the above shown raise() were
more detailed.
From: Chris <pl...@gm...> - 2012年02月05日 16:54:03
Thanks JJ.
The problem seems not to be a size issue -- markersize has no effect
when use marker="," (pixel). I have also tried to turn off aa, and it
doesn't help either. I also tried different backends. The PNG output
from Agg and Cairo is slightly different: Agg's point has 4 solid
pixel, while Cairo's has 4 pixel with random shade.
Postscript output has the same problem. The "pixel" in an EPS file
generated by mpl is significantly bigger than that from another
drawing program I used.
The problem occurs in all my plotting scripts, e.g., this basic one:
[CODE]
import numpy as np
x=np.arange(100)
y=np.random.randn(100)
ioff()
fig=gcf()
fig.clf()
ax=fig.add_axes(0.15,0.1,0.8, 0.85)
ax.plot(x,y,"k,")
ion()
fig.canvas.draw()
[/CODE]
Here is how I identify the problem:
1. use the above script to plot on screen
2. savefig("plot.png")
3. open plot.png in GIMP and check the pixel size.
I also attached the two PNG files generated with Agg and Cairo backends.
On Sun, Feb 5, 2012 at 6:45 AM, Jae-Joon Lee <lee...@gm...> wrote:
> How are you plotting your points.
>
> If you use *plot*, there is a *markersize* parameter.
> If you use *scatter*, the third argument controls the marker size.
>
> But you may actually complaining about other issues, e.g.,
> antialiasing, etc. So, if above are not your answer, please post a
> complete example and describe your problem in more detail.
>
> Regards,
>
> -JJ
>
>
> On Sat, Feb 4, 2012 at 2:15 PM, Chris <pl...@gm...> wrote:
>> I noticed this a few years back, but left it aside because most of the
>> time I can live with it. Recently I need to make a few plots
>> containing a few million points, and 4 pixels for a point is a
>> disaster. So my question is why the pixel marker size is set at 4
>> pixels? And is there anyway to change it to a single pixel?
>>
>> Thanks,
>> Chris
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just 99ドル.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: gsal <sal...@gm...> - 2012年02月05日 15:15:34
Yeap, that did the trick.
Thanks.
-- 
View this message in context: http://old.nabble.com/legend-not-draggable-when-secondary-y-axis-present-tp33163397p33266687.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jae-Joon L. <lee...@gm...> - 2012年02月05日 14:45:28
How are you plotting your points.
If you use *plot*, there is a *markersize* parameter.
If you use *scatter*, the third argument controls the marker size.
But you may actually complaining about other issues, e.g.,
antialiasing, etc. So, if above are not your answer, please post a
complete example and describe your problem in more detail.
Regards,
-JJ
On Sat, Feb 4, 2012 at 2:15 PM, Chris <pl...@gm...> wrote:
> I noticed this a few years back, but left it aside because most of the
> time I can live with it. Recently I need to make a few plots
> containing a few million points, and 4 pixels for a point is a
> disaster. So my question is why the pixel marker size is set at 4
> pixels? And is there anyway to change it to a single pixel?
>
> Thanks,
> Chris
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just 99ドル.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jae-Joon L. <lee...@gm...> - 2012年02月05日 14:36:11
For the legend to be picked by mouse, it must be placed in the top most axes.
ax = subplot(111)
l1, = ax.plot([1,3,2])
ax2 = ax.twinx()
lab = ax2.legend([l1], ["test"])
I hope this clarifies your issue.
If not, please post a simple but complete example that demonstrates
your problem.
Regards,
-JJ
On Wed, Jan 18, 2012 at 12:53 AM, German Salazar <sal...@gm...> wrote:
> Any ideas?
>
> Also, as in the example here, the legend seems to be behind the quantity
> being plotted against the one of the secondary y-axis....does this have
> anything to do with that?...it is that maybe the legend is draggable but I
> am not getting to it?
>
> gsal
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just 99ドル.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2012年02月05日 14:28:33
On Sat, Feb 4, 2012 at 1:27 AM, Saurav Pathak <sa...@sa...> wrote:
> Is there another way to do this more efficiently?
I recommend you to use LineCollection, which should be much efficient.
http://matplotlib.sourceforge.net/examples/api/collections_demo.html
Regards,
-JJ

Showing 6 results of 6

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 によって変換されたページ (->オリジナル) /