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

Showing 10 results of 10

From: Eric F. <ef...@ha...> - 2008年10月31日 17:50:34
Adam wrote:
> hi, I am trying to use ginput with some images and for some reason it 
> keeps changing the axes with the mouse click.
> I don't know if this is a feature or bug, but I would like it not to 
> affect my images at all.
Confirmed: it's a big bug. I suspect it has a simple fix, but I don't 
have time to look into it.
Eric
> 
> here is a short example:
> 
> #---
> from pylab import ginput, imshow, rand
> 
> t=rand(50,50)
> imshow(t)
> x = ginput(1)
> #---
> 
> this problem was also addressed in a post back in august: 
> http://www.nabble.com/ginput-changes-axes-limits-td18863282.html#a18863282
> but it received no replies.
> 
> any ideas on whats going on?
> 
> thanks,
> adam.
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Adam <ada...@gm...> - 2008年10月31日 17:42:53
hi, I am trying to use ginput with some images and for some reason it keeps
changing the axes with the mouse click.
I don't know if this is a feature or bug, but I would like it not to affect
my images at all.
here is a short example:
#---
from pylab import ginput, imshow, rand
t=rand(50,50)
imshow(t)
x = ginput(1)
#---
this problem was also addressed in a post back in august:
http://www.nabble.com/ginput-changes-axes-limits-td18863282.html#a18863282
but it received no replies.
any ideas on whats going on?
thanks,
adam.
From: martin.druon <mar...@wa...> - 2008年10月31日 15:48:17
Hi,
this is my best result... figure is acceptable when I use a lot of points...
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib
import matplotlib.art3d
import matplotlib.axes3d
import pylab
if __name__ == "__main__":
 data_filename = ...
 # We load data
 # 
 # x1 y1 v1
 # x2 y2 v2
 # x3 y3 v3
 # ...
 #
 data_file = pylab.load(data_filename)
 # We get x coordinate
 lstX = data_file[:, 0]
 # We get y coordinate
 lstY = data_file[:, 1]
 # We get data values
 lstV = data_file[:, 2]
 # We create list of lines from (x, y, 0) to (x, y, value)
 lstLines = [[(x, y, 0), (x, y, v)] for (x, y, v) in zip(lstX, lstY,
lstV)]
 # We create the figure
 fig = pylab.figure(1)
 # We get the axe reference
 ax = matplotlib.axes3d.Axes3D(fig)
 # We create a matplotlib line collection
 lines = matplotlib.art3d.Line3DCollection(lstLines, linewidths=5)
 # We add the collection to the axes
 ax.add_3DCollection(lines)
 # Auto scale
 ax.auto_scale_xyz(lstX, lstY, lstV, ax.has_data())
 # Draw
 pylab.show()
 # Bye
 exit(0)
Example of data file :
0 0 -4.49132
0 1 0.676531
0 2 -1.60375
0 3 -0.184649
0 4 0.958887
0 5 -0.165971
1 0 -0.0216472
1 1 0.157346
1 2 -0.372853
1 3 0.2576
1 4 0.654506
2 0 0.139453
2 1 -0.204437
2 2 0.151606
2 3 0.271027
3 0 0.222327
3 1 0.921501
3 2 0.500956
4 0 0.104108
4 1 0.415777
5 0 0.244248
-- 
View this message in context: http://www.nabble.com/3D-histogram-tp16986530p20268667.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Thomas P. <ya...@gm...> - 2008年10月31日 14:50:40
Hi Jae-Joon,
yes, that solved it. Thank you very much.
The savefig command should have been inside the for-loop.
Thomas
> -----Original Message-----
> From: Jae-Joon Lee [mailto:lee...@gm...]
> Sent: Friday, October 31, 2008 12:43 PM
> To: Thomas Pfaff
> Cc: Michael Droettboom; mat...@li...
> Subject: Re: [Matplotlib-users] no canvas reinitialization between calls
> to savefig
> 
> I can reproduce Thomas' problem with Agg backend. It does not happen
> if frame_on is True.
> And I guess Thomas' guess in the first email might be right.
> I had a quick look at the mpl source and I don't think draw(), clf()
> or savefig() try to clear the canvas.
> The problem is not visible if frame_on is True.
> 
> Thomas,
> Put following line after the savefig() function
> 
> fig.canvas._lastKey = None
> 
> and see if it solves the problem (savefig command in your original
> email is outside the for loop, I guess this was a typo).
> 
> The Agg backend has a clear() method which fills the canvas with (1,
> 1, 1, 0). I tried to put this method in a few different places. It
> worked for savefig(), but I couldn't get it work in the interactive
> backend (GtkAgg).
> 
> Regards,
> 
From: Michael D. <md...@st...> - 2008年10月31日 13:19:20
Thanks. I've committed this to SVN and should end up in the online docs 
next time they are regenerated.
Cheers,
Mike
Scott Sinclair wrote:
> Hi,
>
> There was a recent unanswered post on this topic. I hope the attached script is useful and makes it's way into the Matplotlib examples.
>
> Thanks for a great library,
> Scott
> Please find our Email Disclaimer here: http://www.ukzn.ac.za/disclaimer/
> 
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: John H. <jd...@gm...> - 2008年10月31日 12:55:15
On Fri, Oct 31, 2008 at 6:43 AM, Jae-Joon Lee <lee...@gm...> wrote:
> The Agg backend has a clear() method which fills the canvas with (1,
> 1, 1, 0). I tried to put this method in a few different places. It
> worked for savefig(), but I couldn't get it work in the interactive
> backend (GtkAgg).
>
I think what you are seeing is the problem I described here
http://www.nabble.com/gtkagg-pixel-buffer-bug-td18051692.html#a18051692
I spent some time working on it and came to the following conclusion:
if the mpl figure is fully transparent, you see whatever is in the gui
rendering buffer, which may be unintiialized memory. In some sense,
mpl is doing what is asked of it, making a fully transparent figure.
Clearing the agg buffer is not enough if it is transparent -- you also
have to init the canvas buffer. The question is: with what?
JDH
From: Jae-Joon L. <lee...@gm...> - 2008年10月31日 11:51:34
I can reproduce Thomas' problem with Agg backend. It does not happen
if frame_on is True.
And I guess Thomas' guess in the first email might be right.
I had a quick look at the mpl source and I don't think draw(), clf()
or savefig() try to clear the canvas.
The problem is not visible if frame_on is True.
Thomas,
Put following line after the savefig() function
 fig.canvas._lastKey = None
and see if it solves the problem (savefig command in your original
email is outside the for loop, I guess this was a typo).
The Agg backend has a clear() method which fills the canvas with (1,
1, 1, 0). I tried to put this method in a few different places. It
worked for savefig(), but I couldn't get it work in the interactive
backend (GtkAgg).
Regards,
-JJ
On Fri, Oct 31, 2008 at 6:35 AM, Thomas Pfaff <ya...@gm...> wrote:
> Hi,
>
> Thanks for the quick reply.
>
>
> My OS is Windows XP with Service Pack 3
>
> I'm using an easy-install .egg distribution. Whether I downloaded it
> somewhere or simply installed it using easy-install, I don't remember.
>
> I have another version of matplotlib (0.91.2) installed, which does not seem
> to be used. This one was installed using the Windows installer from the
> matplotlib homepage. This should not interfere, should it?
>
> Running the script with --verbose-helpful gives the following results (I
> removed parts of the path information)
>
> $HOME=\pfaff
> CONFIGDIR=\pfaff\.matplotlib
> matplotlib data path
> \python25\lib\site-packages\matplotlib-0.98.3-py2.5-win32.egg\matplotlib\mpl
> -data
> loaded rc file
> \python25\lib\site-packages\matplotlib-0.98.3-py2.5-win32.egg\matplotlib\mpl
> -data\matplotlibrc
> matplotlib version 0.98.3
> verbose.level helpful
> interactive is False
> units is False
> platform is win32
> Using fontManager instance from \pfaff\.matplotlib\fontManager.cache
> backend TkAgg version 8.4
>
>
> Now that I think of it:
> In the IPython reference, I read about possible problems with tk. When
> starting IPython I use -pylab -tk because otherwise I can only do one plot
> and the plotting window hangs once I issue another plotting command.
> As I didn't find where to tell matplotlib to behave like these two switches
> were set, I get by with constantly restarting my interpreter when working
> interactively.
> Could this be part of the problem?
>
> Cheers,
>
>
> Thomas
>
>> -----Original Message-----
>> From: Michael Droettboom [mailto:md...@st...]
>> Sent: Thursday, October 30, 2008 2:21 PM
>> To: Thomas Pfaff
>> Cc: mat...@li...
>> Subject: Re: [Matplotlib-users] no canvas reinitialization between calls
>> to savefig
>>
>> I can't reproduce this here with SVN trunk. I get what you expect.
>>
>> Can you provide the information outlined here:
>>
>> http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#report-a-
>> problem
>>
>> as well as the backend you are using?
>>
>> Cheers,
>> Mike
>>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Thomas P. <ya...@gm...> - 2008年10月31日 10:35:33
Hi,
Thanks for the quick reply.
My OS is Windows XP with Service Pack 3
I'm using an easy-install .egg distribution. Whether I downloaded it
somewhere or simply installed it using easy-install, I don't remember.
I have another version of matplotlib (0.91.2) installed, which does not seem
to be used. This one was installed using the Windows installer from the
matplotlib homepage. This should not interfere, should it?
Running the script with --verbose-helpful gives the following results (I
removed parts of the path information)
$HOME=\pfaff
CONFIGDIR=\pfaff\.matplotlib
matplotlib data path
\python25\lib\site-packages\matplotlib-0.98.3-py2.5-win32.egg\matplotlib\mpl
-data
loaded rc file
\python25\lib\site-packages\matplotlib-0.98.3-py2.5-win32.egg\matplotlib\mpl
-data\matplotlibrc
matplotlib version 0.98.3
verbose.level helpful
interactive is False
units is False
platform is win32
Using fontManager instance from \pfaff\.matplotlib\fontManager.cache
backend TkAgg version 8.4
Now that I think of it:
In the IPython reference, I read about possible problems with tk. When
starting IPython I use -pylab -tk because otherwise I can only do one plot
and the plotting window hangs once I issue another plotting command.
As I didn't find where to tell matplotlib to behave like these two switches
were set, I get by with constantly restarting my interpreter when working
interactively.
Could this be part of the problem?
Cheers,
Thomas
> -----Original Message-----
> From: Michael Droettboom [mailto:md...@st...]
> Sent: Thursday, October 30, 2008 2:21 PM
> To: Thomas Pfaff
> Cc: mat...@li...
> Subject: Re: [Matplotlib-users] no canvas reinitialization between calls
> to savefig
> 
> I can't reproduce this here with SVN trunk. I get what you expect.
> 
> Can you provide the information outlined here:
> 
> http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#report-a-
> problem
> 
> as well as the backend you are using?
> 
> Cheers,
> Mike
> 
From: Scott S. <sin...@uk...> - 2008年10月31日 09:44:24
Hi,
There was a recent unanswered post on this topic. I hope the attached script is useful and makes it's way into the Matplotlib examples.
Thanks for a great library,
Scott
Please find our Email Disclaimer here: http://www.ukzn.ac.za/disclaimer/
From: Amitava M. <am...@re...> - 2008年10月31日 01:49:33
Thanks,
vlines is definitely the better option. By the way, I am using 
the
Enthought python distribution for Windows. I could not get the 
desired
output from the ipython -pylab shell. But the same code when run 
in
SciTe and IDLE gave the desired output.
On 2008年10月30日 Michael Droettboom wrote :
>The limits don't get automatically adjusted when using 
>add_patch().
>
>You could do something like:
>
>plt.gca().set_xlim(min([x for x, y in vertices]), max([x for x, y 
>in
vertices]))
>plt.gca().set_ylim(min([y for x, y in vertices]), max([y for x, y 
>in
vertices]))
>
>Again, vlines will do all this for you.
>
>Mike
>

Showing 10 results of 10

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