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
(16)
2
(31)
3
(17)
4
(18)
5
(7)
6
(5)
7
(16)
8
(9)
9
(19)
10
(18)
11
(17)
12
(7)
13
(6)
14
(15)
15
(16)
16
(15)
17
(19)
18
(27)
19
(10)
20
(5)
21
(5)
22
(19)
23
(7)
24
(11)
25
(19)
26
(1)
27
(36)
28
(37)
29
(28)
30
(36)



Showing results of 480

<< < 1 .. 5 6 7 8 9 .. 20 > >> (Page 7 of 20)
From: Andre Walker-L. <wal...@gm...> - 2009年09月25日 00:35:13
Hi All,
I have what I think is a basic question. I want to have an 
interactive python script/code which uses matplotlib. For example, 
the script first asks what data set to use, then when received, it 
does some analysis routines, and then makes some plots. To launch the 
plot, my I have in my routine
 > #!/usr/bin/python (I am not running in interactive mode, rather I 
made an executable script)
 > import matplotlib.pyplot as plt
some analysis stuff
 > plt.show()
after the plt.show() command, the terminal I run the script from 
becomes unresponsive until I close plot I made. However, I would like 
instead to be able to continue interacting with the program. For 
example, choosing a fitting window based upon the first plot. But I 
don't want to have to close down the plot to do this. So my 
question(s):
1 - how do I continue to interact with the terminal (and my program 
asking for more imput) after the plt.show() command has been issued?
2 - is there an alternative command I can use instead of plt.show() 
which does not lock up the terminal?
3 - is it possible to launch more than one matplotlib plotting window 
with the same interactive python session (executable python script)?
I thought perhaps the answer to my question would be to have a sub- 
script executed by my main one which generates the various plots I 
want, where each successive plot requires user input after viewing the 
previous ones.
Any thoughts/advice are appreciated.
Thanks,
Andre
From: Gökhan S. <gok...@gm...> - 2009年09月24日 20:29:57
Hello,
One easy one harder two questions :)
My screenshot http://img213.imageshack.us/img213/3443/snapshot5.png
1-) I want to link bottom and top x axes as well as left and right y axes.
For now on the x-axis xticks are the time in seconds from midnight, not sure
how to add the secondary top x axis with time in regular HH:MM:SS
representation, without plotting the same data again. Right y-axis is there
thanks to twinx however that and left one don't snap each other when I zoom
in the plot. There is the twin function but couldn't figure out how to
achieve what I explained here.
2-) How to move plot title upwards when the new top x-axis ticks become
visible? They are overlapping each other, which I am trying to make them
nice looking.
Thanks.
-- 
Gökhan
From: Michael D. <md...@st...> - 2009年09月24日 17:06:37
I committed a slightly tighter version of this that uses a rectangle 
based on the size of the image plus a border to accomodate the exact 
marker size. Probably makes very little difference, but I suppose if 
there was a dense field of markers outside of view, this might speed 
things up a bit more.
A further optimization might be to use the clipping rectangle, but 
that's not necessary merely to prevent the segfault.
Mike
On 09/24/2009 12:06 AM, John Hunter wrote:
> On Wed, Sep 23, 2009 at 10:15 PM, John Hunter<jd...@gm...> wrote:
> 
>> On Wed, Sep 23, 2009 at 6:47 PM, Mike Nicolls<mic...@sr...> wrote:
>> 
>>> I've encountered a segmentation fault using the Agg backend when making
>>> and saving a png plot. The segmentation fault does not seem to occur
>>> under different backends (e.g. Cairo).
>>>
>>> The sequence of commands amounts to making a plot, setting the limits of
>>> the plot, then saving the plot as a png using savefig. If the value of
>>> one of the points is too large, a segmentation fault is generated.
>>> Obviously the simple work-around is to not plot the out-of-bounds
>>> points, but the segmentation fault is probably not the desired behavior!
>>>
>>> Below is an example, which generates a segmentation fault on matplotlib
>>> versions 0.99.0 (run on OS X 10.5.8) and 0.98.5.2 (run on Fedora 11 and
>>> CentOS 5.3).
>>>
>>> Can others reproduce this issue?
>>> 
>> Thanks for the report -- I can confirm this on OSX and linux on svn HEAD
>>
>> I've made minor tweaks to your test case to make it deterministic::
>> 
> I applied the following patch to the branch and head -- it feels like there
> would be a more elegant way to handle it, so I'd like Michael at least to
> take a look at it::
>
> home:~/mpl> svn diff -rPREV:HEAD src/_backend_agg.cpp
> Index: src/_backend_agg.cpp
> ===================================================================
> --- src/_backend_agg.cpp (revision 7820)
> +++ src/_backend_agg.cpp (revision 7821)
> @@ -608,6 +608,14 @@
>
> x = (double)(int)x; y = (double)(int)y;
>
> + // if x or y is close to the width or height, the filled
> + // region could be inside the boundary even if the center is
> + // out. But at some point we need to cull these points
> + // because they can create segfaults of they overflow; eg
> + //
> https://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720
> + if (fabs(x)>(2*width)) continue;
> + if (fabs(y)>(2*height)) continue;
> +
> pixfmt_amask_type pfa(pixFmt, alphaMask);
> amask_ren_type r(pfa);
> amask_aa_renderer_type ren(r);
> @@ -629,6 +637,14 @@
>
> x = (double)(int)x; y = (double)(int)y;
>
> + // if x or y is close to the width or height, the filled
> + // region could be inside the boundary even if the center is
> + // out. But at some point we need to cull these points
> + // because they can create segfaults of they overflow; eg
> + //
> https://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720
> + if (fabs(x)>(2*width)) continue;
> + if (fabs(y)>(2*height)) continue;
> +
> if (face.first) {
> rendererAA.color(face.second);
> sa.init(fillCache, fillSize, x, y);
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Gökhan S. <gok...@gm...> - 2009年09月24日 14:03:19
There is even a simpler use case :)
Just put those three lines in a file say test.py
and try python test.py
Unless you are in ipython -pylab or threading enabled, it is required to
issue a show() to see the results on the screen.
On Thu, Sep 24, 2009 at 4:46 AM, Mark Bakker <ma...@gm...> wrote:
> Excellent. Many thanks.After all those years of using matplotlib, I
> finally find a use for show()
> Mark
>
> On Wed, Sep 23, 2009 at 11:02 PM, Gökhan Sever <gok...@gm...>wrote:
>
>>
>>
>> On Wed, Sep 23, 2009 at 3:51 PM, Mark Bakker <ma...@gm...> wrote:
>>
>>> Hello list,
>>> I recently started using Eclipse with Pydev. I like it a lot but have not
>>> been able to get interactive plotting going (which otherwise works fine).
>>>
>>> My file is simple:
>>>
>>> from pylab import *
>>>
>>> ion()
>>>
>>> plot([1,2,3])
>>>
>>>
>>>
>> You need to issue a show() here. Thus the plotting window will hang on the
>> screen until you close it.
>>
>>
>> Eclipse Platform
>> Version: 3.5.0
>> Build id: I20090611-1540
>>
>> PyDev for Eclipse 1.5.0.1251989166
>> org.python.pydev.feature.feature.group
>>
>>
>>> When I run this form within Eclipse, I do see a graphing window open up
>>> but then it disappears again when it is done, before I can even look at it.
>>>
>>> Any suggestions on how to keep the graphing window open?
>>>
>>> Thanks,
>>>
>>> Mark
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
>>> is the only developer event you need to attend this year. Jumpstart your
>>> developing skills, take BlackBerry mobile applications to market and stay
>>> ahead of the curve. Join us from November 9&#45;12, 2009. Register
>>> now&#33;
>>> http://p.sf.net/sfu/devconf
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>>
>> --
>> Gökhan
>>
>
>
-- 
Gökhan
From: Teemu R. <tee...@he...> - 2009年09月24日 10:35:58
Hi John,
Yes, works fine now, no error messages after from pylab import * .
And now my code using imshow and masked_arrays works again as 
expected, great!
Thank you,
Teemu
John Hunter kirjoitti 24.9.2009 kello 5.59:
> On Wed, Sep 23, 2009 at 4:39 PM, Christopher Barker
> <Chr...@no...> wrote:
>> Teemu Rinne wrote:
>>> from matplotlib import ft2font
>>> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/ 
>>> 2.5/
>>> lib/python
>>> 2.5/site-packages/matplotlib/ft2font.so, 2): Library not loaded: /
>>> Users/jdhunter
>>> /devbuild/lib/libfreetype.6.dylib
>>
>>> Am I missing something or is this 0.99.1 OSX package somehow broken?
>>
>> I think it's broken -- it's looking for a libfreetype in the:
>>
>> Users/jdhunter/devbuild/lib/
>>
>> dir, which you're pretty unlikely to have!
>>
>> John, did you mean to have only static lbs in your devbuild/lib dir,
>> which I think would work?
>
> I've removed the shared object libs before building the binaries, so
> now the static libs should be compiled in. Teemu, can you test again
> with the 0.99.1.1 OSX binaries at the download site?
>
> https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
>
> JDH
>
From: Mark B. <ma...@gm...> - 2009年09月24日 09:47:07
Excellent. Many thanks.After all those years of using matplotlib, I finally
find a use for show()
Mark
On Wed, Sep 23, 2009 at 11:02 PM, Gökhan Sever <gok...@gm...>wrote:
>
>
> On Wed, Sep 23, 2009 at 3:51 PM, Mark Bakker <ma...@gm...> wrote:
>
>> Hello list,
>> I recently started using Eclipse with Pydev. I like it a lot but have not
>> been able to get interactive plotting going (which otherwise works fine).
>>
>> My file is simple:
>>
>> from pylab import *
>>
>> ion()
>>
>> plot([1,2,3])
>>
>>
>>
> You need to issue a show() here. Thus the plotting window will hang on the
> screen until you close it.
>
>
> Eclipse Platform
> Version: 3.5.0
> Build id: I20090611-1540
>
> PyDev for Eclipse 1.5.0.1251989166
> org.python.pydev.feature.feature.group
>
>
>> When I run this form within Eclipse, I do see a graphing window open up
>> but then it disappears again when it is done, before I can even look at it.
>>
>> Any suggestions on how to keep the graphing window open?
>>
>> Thanks,
>>
>> Mark
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9&#45;12, 2009. Register
>> now&#33;
>> http://p.sf.net/sfu/devconf
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
>
> --
> Gökhan
>
From: Bala s. <bal...@gm...> - 2009年09月24日 07:34:40
Friends,
I have a matrix which i plotted with matshow as follows and then used text
function to write the each value inside the figure by choosing x and y
coordinate. I wish to know if there is any easy or more fancy way to do the
same.
*mat=load('tnz.txt')*
In [3]: *tmat=transpose(mat)*
In [4]: *tmat*
Out[4]:
array([[ 10.2 , 26.4 , 12.2 , 13.6 , 24.6 , 13.9 , 10.2 , 20.6 ,
 17. , 14.9 , 24.2 , 13. ],
 [ 13.6 , 26.2 , 10.5 , 13.6 , 26.8 , 9.87, 11. , 23.1 ,
 14.7 , 16.7 , 25.3 , 15.6 ],
 [ 10.7 , 22.4 , 6. , 11.8 , 23.8 , 7.4 , 6.7 , 20.9 ,
 10.3 , 12.5 , 20.9 , 7.9 ]])
In [5]: *matshow(tmat,cmap=cm.autumn)*
Out[5]: <matplotlib.image.AxesImage object at 0x9a2c7cc>
Now i wanted to give the show the values in the matrix using the text
function as follows
In [8]: *text(-.489,.511,'10.2',fontsize=12,color='b',name='serif')*
Out[8]: <matplotlib.text.Text object at 0x9a41e2c>
In [9]: *text(.495,.511,'26.4',fontsize=12,color='b',name='serif')*
Out[9]: <matplotlib.text.Text object at 0x9a489ac>
From: Brian G. <ell...@gm...> - 2009年09月24日 05:24:59
Just this afternoon I saw the same issue with the binary egg for 0.99.1 for
OS X.
Brian
On Wed, Sep 23, 2009 at 7:59 PM, John Hunter <jd...@gm...> wrote:
> On Wed, Sep 23, 2009 at 4:39 PM, Christopher Barker
> <Chr...@no...> wrote:
> > Teemu Rinne wrote:
> >> from matplotlib import ft2font
> >> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/
> >> lib/python
> >> 2.5/site-packages/matplotlib/ft2font.so, 2): Library not loaded: /
> >> Users/jdhunter
> >> /devbuild/lib/libfreetype.6.dylib
> >
> >> Am I missing something or is this 0.99.1 OSX package somehow broken?
> >
> > I think it's broken -- it's looking for a libfreetype in the:
> >
> > Users/jdhunter/devbuild/lib/
> >
> > dir, which you're pretty unlikely to have!
> >
> > John, did you mean to have only static lbs in your devbuild/lib dir,
> > which I think would work?
>
> I've removed the shared object libs before building the binaries, so
> now the static libs should be compiled in. Teemu, can you test again
> with the 0.99.1.1 OSX binaries at the download site?
>
>
> https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
>
> JDH
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2009年09月24日 04:28:21
On Wed, Sep 23, 2009 at 3:27 PM, butterw <bu...@gm...> wrote:
>
> Hi,
>
> pickers work great to make matplotlib plots more interactive/general user
> friendly.
>
> On the subject of the legend_picker.py example, I was wondering if it was
> possible to combine both a legend picker and a line picker in the same plot.
> From what I gather they will both use the same onpick event callback.
>
> So my question is : How do I discriminate between a pick on the legend from
> a pick on a line ? The event.artist is a line2D in both cases.
As demonstrated in the above example, leg.get_lines() gives you the
list of lines inside the legend. The list of original lines is kept in
ax.lines.
So, you can check in which list the given artist is.
Regards,
-JJ
>
>
>
>
>
>
> John Hunter-4 wrote:
>>
>> On Mon, Aug 3, 2009 at 11:38 PM, Gökhan Sever<gok...@gm...>
>> wrote:
>>> Hello,
>>>
>>> I was wondering if it is possible to hide some data on figures using a
>>> say
>>> right click option to any of the legend entry and make it temporarily
>>> hidden/visible to better analyse the rest of the data?
>>>
>>> Check this screenshot for example:
>>>
>>> http://img25.imageshack.us/img25/9427/datahiding.png
>>>
>>> The red data clutters the rest of the figure, and I would like to be able
>>> to
>>> hide it temporarily so that I can investigate the other two relations
>>> more
>>> easily.
>>>
>>> Any ideas? or alternative solutions?
>>
>> It's a nice idea, and should be doable with the pick interface we have
>> for all mpl artists. Unfortunately, there were a few problems in the
>> legend implementation which blocked the pick events from hitting the
>> proxy lines they contained. I just made a few changes to mpl svn HEAD
>> to support this, and added a new example.
>>
>>  examples/event_handling/legend_picking.py
>>
>> which I'll include below.  JJ could you review the changes to legend.py?
>>
>> Instructions for checking out svn are at::
>>
>>
>> http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
>>
>> Here is the example:
>>
>> """
>> Enable picking on the legend to toggle the legended line on and off
>> """
>> import numpy as np
>> import matplotlib.pyplot as plt
>>
>> t = np.arange(0.0, 0.2, 0.1)
>> y1 = 2*np.sin(2*np.pi*t)
>> y2 = 4*np.sin(2*np.pi*2*t)
>>
>> fig = plt.figure()
>> ax = fig.add_subplot(111)
>>
>> line1, = ax.plot(t, y1, lw=2, color='red', label='1 hz')
>> line2, = ax.plot(t, y2, lw=2, color='blue', label='2 hz')
>>
>> leg = ax.legend(loc='upper left', fancybox=True, shadow=True)
>> leg.get_frame().set_alpha(0.4)
>>
>>
>> lines = [line1, line2]
>> lined = dict()
>> for legline, realine in zip(leg.get_lines(), lines):
>>   legline.set_picker(5) # 5 pts tolerance
>>   lined[legline] = realine
>>
>> def onpick(event):
>>   legline = event.artist
>>   realline = lined[legline]
>>   vis = realline.get_visible()
>>   realline.set_visible(not vis)
>>   fig.canvas.draw()
>>
>> fig.canvas.mpl_connect('pick_event', onpick)
>>
>> plt.show()
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> 30-Day
>> trial. Simplify your report design, integration and deployment - and focus
>> on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now. http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Hiding-data-via-legend-tp24802219p25531267.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: John H. <jd...@gm...> - 2009年09月24日 04:06:36
On Wed, Sep 23, 2009 at 10:15 PM, John Hunter <jd...@gm...> wrote:
> On Wed, Sep 23, 2009 at 6:47 PM, Mike Nicolls <mic...@sr...> wrote:
>> I've encountered a segmentation fault using the Agg backend when making
>> and saving a png plot. The segmentation fault does not seem to occur
>> under different backends (e.g. Cairo).
>>
>> The sequence of commands amounts to making a plot, setting the limits of
>> the plot, then saving the plot as a png using savefig. If the value of
>> one of the points is too large, a segmentation fault is generated.
>> Obviously the simple work-around is to not plot the out-of-bounds
>> points, but the segmentation fault is probably not the desired behavior!
>>
>> Below is an example, which generates a segmentation fault on matplotlib
>> versions 0.99.0 (run on OS X 10.5.8) and 0.98.5.2 (run on Fedora 11 and
>> CentOS 5.3).
>>
>> Can others reproduce this issue?
>
> Thanks for the report -- I can confirm this on OSX and linux on svn HEAD
>
> I've made minor tweaks to your test case to make it deterministic::
I applied the following patch to the branch and head -- it feels like there
would be a more elegant way to handle it, so I'd like Michael at least to
take a look at it::
home:~/mpl> svn diff -rPREV:HEAD src/_backend_agg.cpp
Index: src/_backend_agg.cpp
===================================================================
--- src/_backend_agg.cpp (revision 7820)
+++ src/_backend_agg.cpp (revision 7821)
@@ -608,6 +608,14 @@
x = (double)(int)x; y = (double)(int)y;
+ // if x or y is close to the width or height, the filled
+ // region could be inside the boundary even if the center is
+ // out. But at some point we need to cull these points
+ // because they can create segfaults of they overflow; eg
+ //
https://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720
+ if (fabs(x)>(2*width)) continue;
+ if (fabs(y)>(2*height)) continue;
+
pixfmt_amask_type pfa(pixFmt, alphaMask);
amask_ren_type r(pfa);
amask_aa_renderer_type ren(r);
@@ -629,6 +637,14 @@
x = (double)(int)x; y = (double)(int)y;
+ // if x or y is close to the width or height, the filled
+ // region could be inside the boundary even if the center is
+ // out. But at some point we need to cull these points
+ // because they can create segfaults of they overflow; eg
+ //
https://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720
+ if (fabs(x)>(2*width)) continue;
+ if (fabs(y)>(2*height)) continue;
+
if (face.first) {
rendererAA.color(face.second);
sa.init(fillCache, fillSize, x, y);
From: John H. <jd...@gm...> - 2009年09月24日 03:15:35
On Wed, Sep 23, 2009 at 6:47 PM, Mike Nicolls <mic...@sr...> wrote:
> I've encountered a segmentation fault using the Agg backend when making
> and saving a png plot. The segmentation fault does not seem to occur
> under different backends (e.g. Cairo).
>
> The sequence of commands amounts to making a plot, setting the limits of
> the plot, then saving the plot as a png using savefig. If the value of
> one of the points is too large, a segmentation fault is generated.
> Obviously the simple work-around is to not plot the out-of-bounds
> points, but the segmentation fault is probably not the desired behavior!
>
> Below is an example, which generates a segmentation fault on matplotlib
> versions 0.99.0 (run on OS X 10.5.8) and 0.98.5.2 (run on Fedora 11 and
> CentOS 5.3).
>
> Can others reproduce this issue?
Thanks for the report -- I can confirm this on OSX and linux on svn HEAD
I've made minor tweaks to your test case to make it deterministic::
 import numpy as np
 import matplotlib
 matplotlib.use('Agg')
 import matplotlib.pyplot as plt
 xdata = np.arange(10.0)
 ydata = np.arange(10.0)
 xdata[3]=1.0e9 # comment out to avoid seg fault
 fig = plt.figure()
 ax = fig.add_subplot(111)
 ax.plot(xdata,ydata,'k.')
 ax.set_xlim(0.0,1.0)
 fig.savefig('test.png')
and added a bug report to :
 https://sourceforge.net/tracker/?func=detail&aid=2865490&group_id=80706&atid=560720
Platforms confirmed w/ bug:
home:~> uname -a
Darwin Macintosh-8.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15
16:55:01 PDT 2009; root:xnu-1228154~1/RELEASE_I386 i386
jdhunter@uqbar:~> uname -a
Linux uqbar 2.6.27-14-generic #1 SMP Tue Jun 30 19:54:46 UTC 2009
x86_64 GNU/Linux
From: John H. <jd...@gm...> - 2009年09月24日 02:59:56
On Wed, Sep 23, 2009 at 4:39 PM, Christopher Barker
<Chr...@no...> wrote:
> Teemu Rinne wrote:
>>   from matplotlib import ft2font
>> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/
>> lib/python
>> 2.5/site-packages/matplotlib/ft2font.so, 2): Library not loaded: /
>> Users/jdhunter
>> /devbuild/lib/libfreetype.6.dylib
>
>> Am I missing something or is this 0.99.1 OSX package somehow broken?
>
> I think it's broken -- it's looking for a libfreetype in the:
>
> Users/jdhunter/devbuild/lib/
>
> dir, which you're pretty unlikely to have!
>
> John, did you mean to have only static lbs in your devbuild/lib dir,
> which I think would work?
I've removed the shared object libs before building the binaries, so
now the static libs should be compiled in. Teemu, can you test again
with the 0.99.1.1 OSX binaries at the download site?
https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
JDH
From: Mike N. <mic...@sr...> - 2009年09月23日 23:46:57
I've encountered a segmentation fault using the Agg backend when making 
and saving a png plot. The segmentation fault does not seem to occur 
under different backends (e.g. Cairo).
The sequence of commands amounts to making a plot, setting the limits of 
the plot, then saving the plot as a png using savefig. If the value of 
one of the points is too large, a segmentation fault is generated. 
Obviously the simple work-around is to not plot the out-of-bounds 
points, but the segmentation fault is probably not the desired behavior! 
Below is an example, which generates a segmentation fault on matplotlib 
versions 0.99.0 (run on OS X 10.5.8) and 0.98.5.2 (run on Fedora 11 and 
CentOS 5.3).
Can others reproduce this issue?
Thanks,
Mike Nicolls
import scipy
import matplotlib
matplotlib.use('Agg')
import pylab
if __name__ == '__main__':
 
 xdata,ydata = scipy.rand(2,10)
 xdata[3]=1.0e9 # comment out to avoid seg fault
 
 pylab.figure()
 pylab.plot(xdata,ydata,'k.')
 pylab.xlim((0.0,1.0))
 
 pylab.savefig('test.png')
From: Christopher B. <Chr...@no...> - 2009年09月23日 21:37:24
Teemu Rinne wrote:
> from matplotlib import ft2font
> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/ 
> lib/python
> 2.5/site-packages/matplotlib/ft2font.so, 2): Library not loaded: / 
> Users/jdhunter
> /devbuild/lib/libfreetype.6.dylib
> Am I missing something or is this 0.99.1 OSX package somehow broken?
I think it's broken -- it's looking for a libfreetype in the:
Users/jdhunter/devbuild/lib/
dir, which you're pretty unlikely to have!
John, did you mean to have only static lbs in your devbuild/lib dir, 
which I think would work?
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Gökhan S. <gok...@gm...> - 2009年09月23日 21:02:38
On Wed, Sep 23, 2009 at 3:51 PM, Mark Bakker <ma...@gm...> wrote:
> Hello list,
> I recently started using Eclipse with Pydev. I like it a lot but have not
> been able to get interactive plotting going (which otherwise works fine).
>
> My file is simple:
>
> from pylab import *
>
> ion()
>
> plot([1,2,3])
>
>
>
You need to issue a show() here. Thus the plotting window will hang on the
screen until you close it.
Eclipse Platform
Version: 3.5.0
Build id: I20090611-1540
PyDev for Eclipse 1.5.0.1251989166
org.python.pydev.feature.feature.group
> When I run this form within Eclipse, I do see a graphing window open up but
> then it disappears again when it is done, before I can even look at it.
>
> Any suggestions on how to keep the graphing window open?
>
> Thanks,
>
> Mark
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
-- 
Gökhan
From: Mark B. <ma...@gm...> - 2009年09月23日 20:51:58
Hello list,
I recently started using Eclipse with Pydev. I like it a lot but have not
been able to get interactive plotting going (which otherwise works fine).
My file is simple:
from pylab import *
ion()
plot([1,2,3])
When I run this form within Eclipse, I do see a graphing window open up but
then it disappears again when it is done, before I can even look at it.
Any suggestions on how to keep the graphing window open?
Thanks,
Mark
From: Teemu R. <tee...@he...> - 2009年09月23日 20:36:27
Hi,
I tried to install 0.99.1 [I installed 0.99 a few days ago. I hoped 
that with 0.99.1 I'd get rid of problems with using imshow with 
masked_array and set_bad(alpha=0.0)]:
Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> from pylab import *
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-pac
kages/pylab.py", line 1, in <module>
 from matplotlib.pylab import *
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-pac
kages/matplotlib/pylab.py", line 206, in <module>
 from matplotlib import mpl # pulls in most modules
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-pac
kages/matplotlib/mpl.py", line 2, in <module>
 from matplotlib import axis
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-pac
kages/matplotlib/axis.py", line 10, in <module>
 import matplotlib.font_manager as font_manager
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-pac
kages/matplotlib/font_manager.py", line 52, in <module>
 from matplotlib import ft2font
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/ 
lib/python
2.5/site-packages/matplotlib/ft2font.so, 2): Library not loaded: / 
Users/jdhunter
/devbuild/lib/libfreetype.6.dylib
 Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/ 
lib/python2
.5/site-packages/matplotlib/ft2font.so
 Reason: image not found
Am I missing something or is this 0.99.1 OSX package somehow broken?
Cheers,
Teemu Rinne
Dept Psychology
University of Helsinki
From: butterw <bu...@gm...> - 2009年09月23日 19:27:36
Hi,
pickers work great to make matplotlib plots more interactive/general user
friendly.
On the subject of the legend_picker.py example, I was wondering if it was
possible to combine both a legend picker and a line picker in the same plot.
>From what I gather they will both use the same onpick event callback. 
So my question is : How do I discriminate between a pick on the legend from
a pick on a line ? The event.artist is a line2D in both cases. 
 
John Hunter-4 wrote:
> 
> On Mon, Aug 3, 2009 at 11:38 PM, Gökhan Sever<gok...@gm...>
> wrote:
>> Hello,
>>
>> I was wondering if it is possible to hide some data on figures using a
>> say
>> right click option to any of the legend entry and make it temporarily
>> hidden/visible to better analyse the rest of the data?
>>
>> Check this screenshot for example:
>>
>> http://img25.imageshack.us/img25/9427/datahiding.png
>>
>> The red data clutters the rest of the figure, and I would like to be able
>> to
>> hide it temporarily so that I can investigate the other two relations
>> more
>> easily.
>>
>> Any ideas? or alternative solutions?
> 
> It's a nice idea, and should be doable with the pick interface we have
> for all mpl artists. Unfortunately, there were a few problems in the
> legend implementation which blocked the pick events from hitting the
> proxy lines they contained. I just made a few changes to mpl svn HEAD
> to support this, and added a new example.
> 
> examples/event_handling/legend_picking.py
> 
> which I'll include below. JJ could you review the changes to legend.py?
> 
> Instructions for checking out svn are at::
> 
> 
> http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
> 
> Here is the example:
> 
> """
> Enable picking on the legend to toggle the legended line on and off
> """
> import numpy as np
> import matplotlib.pyplot as plt
> 
> t = np.arange(0.0, 0.2, 0.1)
> y1 = 2*np.sin(2*np.pi*t)
> y2 = 4*np.sin(2*np.pi*2*t)
> 
> fig = plt.figure()
> ax = fig.add_subplot(111)
> 
> line1, = ax.plot(t, y1, lw=2, color='red', label='1 hz')
> line2, = ax.plot(t, y2, lw=2, color='blue', label='2 hz')
> 
> leg = ax.legend(loc='upper left', fancybox=True, shadow=True)
> leg.get_frame().set_alpha(0.4)
> 
> 
> lines = [line1, line2]
> lined = dict()
> for legline, realine in zip(leg.get_lines(), lines):
> legline.set_picker(5) # 5 pts tolerance
> lined[legline] = realine
> 
> def onpick(event):
> legline = event.artist
> realline = lined[legline]
> vis = realline.get_visible()
> realline.set_visible(not vis)
> fig.canvas.draw()
> 
> fig.canvas.mpl_connect('pick_event', onpick)
> 
> plt.show()
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day 
> trial. Simplify your report design, integration and deployment - and focus
> on 
> what you do best, core application coding. Discover what's new with 
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/Hiding-data-via-legend-tp24802219p25531267.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Cédrick F. <ced...@fr...> - 2009年09月23日 12:59:36
Hi,
I have the same problem as Andrew Kelly
I did the example code below (from coords_demo.py) to reproduce the bug :
#!/usr/bin/env python
"""
An example of how to interact with the plotting canvas by connecting
to move and click events
"""
import sys
from pylab import *
t = arange(0.0, 1.0, 0.01)
s = sin(2*pi*t)
ax = subplot(111)
ax.set_xscale('log')
#ax.plot(t,s)
ax.axhline(0.5, 0, 1)
def on_move(event):
 # get the x and y pixel coords
 x, y = event.x, event.y
 
 if event.inaxes:
 ax = event.inaxes # the axes instance
 print 'data coords', event.xdata, event.ydata
 lst = ax.hitlist(event)
 
def on_click(event):
 # get the x and y coords, flip y from top to bottom
 x, y = event.x, event.y
 if event.button==1:
 if event.inaxes is not None:
 print 'data coords', event.xdata, event.ydata
binding_id = connect('motion_notify_event', on_move)
connect('button_press_event', on_click)
if "test_disconnect" in sys.argv:
 print "disconnecting console coordinate printout..."
 disconnect(binding_id)
show()
Regards,
Cédrick
From: John H. <jd...@gm...> - 2009年09月22日 20:54:14
On Tue, Sep 22, 2009 at 3:45 PM, Michael Hearne <mh...@us...> wrote:
> Great!
You may also want to take a look at the brand-spanking-new image
tutorial, which covers this
http://matplotlib.sourceforge.net/users/image_tutorial.html
JDH
From: Michael H. <mh...@us...> - 2009年09月22日 20:46:05
Great!
Thanks,
Mike
On Sep 22, 2009, at 2:38 PM, Gary Ruben wrote:
> Yes. Use interpolation='nearest' instead.
>
> Gary R.
>
> Michael Hearne wrote:
>> Running the test script below gives me the image I have attached, 
>> which looks like it has been smoothed.
>> Does imshow perform some sort of smoothing on the data it 
>> displays? If so, is there a way to turn this off?
>> #!/usr/bin/env python
>> from pylab import *
>> data = array([[1,2,3,4],[5,6,7,8]])
>> imshow(data,interpolation=None)
>> savefig('output.png')
>> close('all')
From: Gary R. <gr...@bi...> - 2009年09月22日 20:38:30
Yes. Use interpolation='nearest' instead.
Gary R.
Michael Hearne wrote:
> Running the test script below gives me the image I have attached, which 
> looks like it has been smoothed.
> 
> Does imshow perform some sort of smoothing on the data it displays? If 
> so, is there a way to turn this off?
> 
> #!/usr/bin/env python
> 
> from pylab import *
> 
> data = array([[1,2,3,4],[5,6,7,8]])
> imshow(data,interpolation=None)
> savefig('output.png')
> close('all')
From: Michael H. <mh...@us...> - 2009年09月22日 20:31:01
Attachments: output.png
Running the test script below gives me the image I have attached, 
which looks like it has been smoothed.
Does imshow perform some sort of smoothing on the data it displays? 
If so, is there a way to turn this off?
#!/usr/bin/env python
from pylab import *
data = array([[1,2,3,4],[5,6,7,8]])
imshow(data,interpolation=None)
savefig('output.png')
close('all')
From: John H. <jd...@gm...> - 2009年09月22日 19:35:19
On Tue, Sep 22, 2009 at 1:53 PM, Pierre GM <pgm...@gm...> wrote:
>
> On Sep 19, 2009, at 12:55 PM, Pierre GM wrote:
>
>> All,
>> I'm trying to use the Cocoa backend on Snow Leopard, using r7791
>> (GCC 4.2.1 / Python 2.6.1 from Apple, 64b)
>> Unfortunately, a simple `plot(range(10),range(10))` gives me an
>> empty window and error message as such:
>>
>> Python[53010:d07] Inconsistent set of values to create
>> NSBitmapImageRep
>> /Users/pierregm/.local/lib/python2.6/site-packages/matplotlib/
>> backends/backend_cocoaagg.py:140: UninitializedDeallocWarning:
>> leaking an uninitialized object of type NSBitmapImageRep
>> 32) # bits per pixel
>>
>> Can anybody reproduce it ? Would anybody have some ideas on how to
>> fix that ?
>> Thx a lot in advance.
>> P.
>> FYI, the build log can be accessed at: http://pastebin.com/d5b3c1838
>
> I'm very, very sorry to bump my own thread, but I'm in a bit of a
> pickle. Matplotlib installs and runs nicely on my Snow Leopard
> installation, but I'm "blind": cocoa fails, wxpython is 32b only and
> compiling Qt4 is becoming increasingly frustrating on a 64b machine.
> Any help or hint would be really, really appreciated.
> (and once again, sorry for my being rude)
Are you using the CocoaAgg backend or MacOSX? If the former, is the
latter an option for you?
JDH
From: Eric B. <eri...@gm...> - 2009年09月22日 19:18:08
On Tue, Sep 22, 2009 at 2:53 PM, Pierre GM <pgm...@gm...> wrote:
>
> On Sep 19, 2009, at 12:55 PM, Pierre GM wrote:
>
>> All,
>> I'm trying to use the Cocoa backend on Snow Leopard, using r7791
>> (GCC 4.2.1 / Python 2.6.1 from Apple, 64b)
>> Unfortunately, a simple `plot(range(10),range(10))` gives me an
>> empty window and error message as such:
>>
>> Python[53010:d07] Inconsistent set of values to create
>> NSBitmapImageRep
>> /Users/pierregm/.local/lib/python2.6/site-packages/matplotlib/
>> backends/backend_cocoaagg.py:140: UninitializedDeallocWarning:
>> leaking an uninitialized object of type NSBitmapImageRep
>> 32) # bits per pixel
>>
>> Can anybody reproduce it ? Would anybody have some ideas on how to
>> fix that ?
>> Thx a lot in advance.
>> P.
>> FYI, the build log can be accessed at: http://pastebin.com/d5b3c1838
>
> I'm very, very sorry to bump my own thread, but I'm in a bit of a
> pickle. Matplotlib installs and runs nicely on my Snow Leopard
> installation, but I'm "blind": cocoa fails, wxpython is 32b only and
> compiling Qt4 is becoming increasingly frustrating on a 64b machine.
> Any help or hint would be really, really appreciated.
> (and once again, sorry for my being rude)
> P.
I'm not sure if you have the option to go 32-bit, but the cocoa
backend works fine on snow leopard with a 32-bit build (-arch i386),
that I built on leopard prior to upgrading. The 64 bit transition
should be interesting, especially given the persistence of heritage
universal (PPC) build processes.
-Eric
12 messages has been excluded from this view by a project administrator.

Showing results of 480

<< < 1 .. 5 6 7 8 9 .. 20 > >> (Page 7 of 20)
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 によって変換されたページ (->オリジナル) /