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

Showing results of 29

1 2 > >> (Page 1 of 2)
On Tue, Jan 6, 2009 at 00:20, Christopher Barker <Chr...@no...> wrote:
> Sandro Tosi wrote:
>>
>> The idea of the book is to start with simple plots, describing the
>> methods we call and how they work, to go into more details along the
>> book.
>
> I suggest that you focus on the OO interface, rather than the pylab
> interface from the beginning. This will ease the transition from command
> line use to embedding, help folks understand the structure of MPL, and is
> the "right" way to do it (IMHO) with an OO language anyway.
So you suggest to start from matplotlib.pyplot and not from pylab?
Well, sure it's an interesting point-of-view. I'll reflect about your
proposal.
Thanks!!
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Christopher B. <Chr...@no...> - 2009年01月05日 23:20:48
Sandro Tosi wrote:
> The idea of the book is to start with simple plots, describing the
> methods we call and how they work, to go into more details along the
> book.
I suggest that you focus on the OO interface, rather than the pylab 
interface from the beginning. This will ease the transition from command 
line use to embedding, help folks understand the structure of MPL, and 
is the "right" way to do it (IMHO) with an OO language anyway.
-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...
Hello Russell,
thanks for getting back to me
On Mon, Jan 5, 2009 at 20:29, Russell E. Owen <rowen@u.washington.edu> wrote:
> In article
> <8b2...@ma...>,
> "Sandro Tosi" <mo...@de...> wrote:
>> - what are you using matplotlib for?
>
> Plotting data from a networked Tkinter application.
May I ask you to expand a bit what "networked" is? something like:
read data from a remote server and plot on the client? Just to have an
idea :)
>> - what are the (basic) things that, when you were beginning to use
>> matplotlib, you wanted to see grouped up but couldn't find?
>> - what would you like to see in a book about matplotlib?
>
> I want a user's guide for the class API. So far I've figured it out by
> reading examples, trying to extrapolate from the pylab user's guide
> (which is quite good) and reading the class API reference, but I feel
> that I barely understand what I am doing.
The idea of the book is to start with simple plots, describing the
methods we call and how they work, to go into more details along the
book.
>> - what are the things you'd like to explore of matplotlib and never
>> had time to do?
>
> I'd like to know how best to handle plotting data as it arrives (e.g.
> strip charts and evolving x-y plots). I've got code that works but am
> not convinced I'm doing it in the best fashion.
I already thought about an examples of "plotting with data changing on
time" like plotting the cpu usage or so, so it might be useful to you
that too :)
> Histograms.
If there's something particular interesting for you, it would be
helpful to me to know it :)
Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
Hello Andrew,
thanks for taking the time to reply.
First of all, let me clarify that I received a proposal (and not the
opposite) so some decision were already made about the book format.
On Mon, Jan 5, 2009 at 20:00, Andrew Straw <str...@as...> wrote:
> Hi Sandro,
>
> It's great news that a book may come out on MPL.
>
> Speaking as an aspiring university professor in neuroscience, I would
> like to see something that could be used as a resource for undergraduate
> students just learning Python and MPL.
The cut of the book is for already experienced Python programmers. For
sure, in the "approaching" chapter to mpl, I won't go too much into
deep of python programming, and I suppose they'll be easy to read even
for new comers.
> Due to this perspective, I think
> such a book would cover both numpy and MPL. The emphasis could clearly
> by on MPL, but basic numpy idioms and concepts should also be taught.
Mh, the focus the editor would like to see is about introducing mpl +
integrating into apps. The examples I have in mind for the pratical
part of apps integration already cointains some sort of "introduction"
to gather data and plot them (but I can't go to much on the scientific
side :) ). I will propose a chapter like "Matplotlib for the science"
and here your suggestion on what you'd like to see there is welcome.
> I
> think an example-driven approach would be very useful -- something like
> an undergraduate laboratory experiment where students measure and plot
> raw values and compute histograms and statistics (e.g. mean and std).
> More advanced sections might perform statistical comparisons of
> different treatments (e.g. using chi squared, KS and/or T tests), do
> linear least squares fitting (with np.linalg.lstsq), and possibly
> non-linear curve fitting using something like scipy.optimize.fmin.
That could be a beginning of that chapter contents: more more more ideas :)
> That's my self-serving 0ドル.02, since you asked! :)
And they are very much welcome!!
> You may also want to speak with John Hunter and Fernando Perez about the
> possibility of collaborating -- they've already done some work towards a
> book, too.
I'm sure be happy to hear their voice on this product, but (given the
preamble) I don't know if the editor would be fine with co-authorship;
I'll ask, just to be sure.
Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Sandro T. <mo...@de...> - 2009年01月05日 22:58:30
Hello João,
thanks for replying
On Mon, Jan 5, 2009 at 13:40, João Luís Silva <js...@fc...> wrote:
> Sandro Tosi wrote:
>> - what are the (basic) things that, when you were beginning to use
>> matplotlib, you wanted to see grouped up but couldn't find?
>
> I don't know if you consider it basic or not, but I would have liked
> better documentation of the object oriented interface (matplotlib). The
could you be a little more specific on what you mean here?
>> - what would you like to see in a book about matplotlib?
>
> As above, at least a chapter about the object oriented interface showing
> how to embed matplotlib on a application, and outlining the structure of
> the OO interface.
Well, this is part of the purpose of the book: show how to embed mpl
in applications.
>> - what are some those advanced feature that made you yell "WOW!!" ?
>
> I haven't really used matplotlib's advanced features. There are some
> that I like, such as automatic legend placement and mathtext support.
mathtext and latex support will be in the advanced features section
> The number of supported backends is impressive just by itself, making
> matplotlib much more useful. There are some little things such as the
> search order for the matplotlibrc file that make it possible to specify
> different settings for a given directory.
There will be a part even on configuration (of course :) ).
>> - what are the things you'd like to explore of matplotlib and never
>> had time to do?
>
> I never had the time to try the masked arrays although I think they will
> be useful for me. I should also explore how to create custom color maps.
2 points added to the adv featues list (in part because something was
already there, in a different form).
>> Your suggestions are really appreciated :) And wish me good luck!
>
> I was going to! Good luck, I hope you manage to take this project to
> completion.
Eheh, thanks! I really hope I'll be able to handle even this task :)
Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: John H. <jd...@gm...> - 2009年01月05日 21:15:17
On Mon, Jan 5, 2009 at 1:56 PM, Mauro Cavalcanti <mau...@gm...> wrote:
> Dear ALL,
>
> Is there any way to exclude (ie., make invlsible) one or more of the
> standard buttons which appear on the toolbar (either the "Classic" or
> the "Toolbar2") of the MPL backends?
>
> Thanks in advance for any assistance you can provide!
There are some examples using a custom toolbar which depends on which
user interface you are using (there is no API for customizing from
withing pylab/pyplot but it is on the wishlist to have a toolbar
customization/extension API)
See for example
http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_wx4.html?highlight=codex%20custom%20toolbar
In this example a button is added to the default toolbar. You could
copy the toolbar code out of the backend and remove the things you do
not want and then add new buttons, etc.
JDH
From: Oz N. <na...@gm...> - 2009年01月05日 20:06:50
Hi,
I can't find a way to do a logarithmic regression in matplotlib,
This can be done relatively easily in spread sheets like gnumeric and excel.
Has anyone got a clue how to do it ?
Thanks, Oz.
-- 
----
 Imagine there's no countries
 It isn't hard to do
 Nothing to kill or die for
 And no religion too
 Imagine all the people
 Living life in peace
---
when one person suffers from a delusion it is called insanity. When many
people suffer from a delusion it is called religion."
Robert Pirsig, Zen and the Art of Motorcycle Maintenance
From: Mauro C. <mau...@gm...> - 2009年01月05日 19:56:58
Dear ALL,
Is there any way to exclude (ie., make invlsible) one or more of the
standard buttons which appear on the toolbar (either the "Classic" or
the "Toolbar2") of the MPL backends?
Thanks in advance for any assistance you can provide!
Best regards,
-- 
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: mau...@gm...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."
From: Russell E. O. <rowen@u.washington.edu> - 2009年01月05日 19:35:07
In article 
<8b2...@ma...>,
 "Sandro Tosi" <mo...@de...> wrote:
> Hello and Happy 2009!
> 
> I received the interesting proposal to author a book on Matplotlib,
> the powerful 2D plotting library for Python.
> 
> While preparing the arguments list, I'd like to hear even your
> opinion, because different points-of-view will lead to a better
> product.
> 
> Some basic question I'd like to ask are:
> 
> - what are you using matplotlib for?
Plotting data from a networked Tkinter application.
> - what are the (basic) things that, when you were beginning to use
> matplotlib, you wanted to see grouped up but couldn't find?
> - what would you like to see in a book about matplotlib?
I want a user's guide for the class API. So far I've figured it out by 
reading examples, trying to extrapolate from the pylab user's guide 
(which is quite good) and reading the class API reference, but I feel 
that I barely understand what I am doing.
> - what are the things you'd like to explore of matplotlib and never
> had time to do?
I'd like to know how best to handle plotting data as it arrives (e.g. 
strip charts and evolving x-y plots). I've got code that works but am 
not convinced I'm doing it in the best fashion.
Histograms.
-- Russell
Hi Sandro,
It's great news that a book may come out on MPL.
Speaking as an aspiring university professor in neuroscience, I would
like to see something that could be used as a resource for undergraduate
students just learning Python and MPL. Due to this perspective, I think
such a book would cover both numpy and MPL. The emphasis could clearly
by on MPL, but basic numpy idioms and concepts should also be taught. I
think an example-driven approach would be very useful -- something like
an undergraduate laboratory experiment where students measure and plot
raw values and compute histograms and statistics (e.g. mean and std).
More advanced sections might perform statistical comparisons of
different treatments (e.g. using chi squared, KS and/or T tests), do
linear least squares fitting (with np.linalg.lstsq), and possibly
non-linear curve fitting using something like scipy.optimize.fmin.
That's my self-serving 0ドル.02, since you asked! :)
You may also want to speak with John Hunter and Fernando Perez about the
possibility of collaborating -- they've already done some work towards a
book, too.
Andrew
Sandro Tosi wrote:
> Hello and Happy 2009!
> 
> I received the interesting proposal to author a book on Matplotlib,
> the powerful 2D plotting library for Python.
> 
> While preparing the arguments list, I'd like to hear even your
> opinion, because different points-of-view will lead to a better
> product.
> 
> Some basic question I'd like to ask are:
> 
> - what are you using matplotlib for?
> - what are the things you like the most of matplotlib, that you want
> to give emphasis to? And why?
> - what are the (basic) things that, when you were beginning to use
> matplotlib, you wanted to see grouped up but couldn't find?
> - what would you like to see in a book about matplotlib?
> - what are some those advanced feature that made you yell "WOW!!" ?
> - what are the things you'd like to explore of matplotlib and never
> had time to do?
> 
> Your suggestions are really appreciated :) And wish me good luck!
> 
> Cheers,
From: antonv <vas...@ya...> - 2009年01月05日 18:42:12
Hi all,
I have an issue with the colormap for my plots. The data I'm plotting ranges
between 0 and 24 but I am trying to have the colormap display values from 0
to 30. What happens is that the colormap reads the min and max values in my
data and uses those disregarding the vmin and vmax set.
Here is a snippet of code to show how I'm using the colormap:
cmap= mpl.cm.jet
norm= mpl.colors.Normalize(vmin=0,vmax=30)
..........
m.contourf(X,Y, zi, cmap = cmap, norm = norm)
Another question is how can you setup the levels displyed in the colormap.
In my previous example they are st at 0,3,6,9,12,...24. How can I make them
every 2 values or every 1 value?
Thanks,
Anton
-- 
View this message in context: http://www.nabble.com/Colormap-range-and-data-values-tp21296666p21296666.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jeff W. <js...@fa...> - 2009年01月05日 18:26:41
Michael Hearne wrote:
> All: I'm trying to make a map (using Basemap), and plot names of cities 
> on that map. I'd like to avoid "collisions" of city names (where the 
> bounding boxes of the text objects would overlap), but I'm having 
> trouble figuring out how I can do this without actually drawing the text 
> on the figure.
>
> I found this thread:
>
> http://osdir.com/ml/python.matplotlib.general/2005-02/msg00174.html
>
> which describes how to do it _after_ drawing the text on the plot. This 
> would only be useful to me if there were some way to un-draw the text, 
> which isn't something I know how to do either.
> 
Michael: Each Text instance that you add to the plot has a remove 
method that you can call to 'undraw' it.
-Jeff
> Figure resizing is not a problem for my application.
>
> Java has a FontMetrics class, which tells you how big a string will be 
> in a given font - is there an equivalent for Matplotlib?
>
> --Mike
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Sven S. <sve...@gm...> - 2009年01月05日 16:59:15
Hi,
I'm stumbling (=getting an error) over the fact that cohere_pairs in the
mlab module makes use of an unknown typecode() function. I'm guessing
that typecode(X) comes from the pre-numpy era, and maybe it should be
X.dtype or X.dtype.char or whatever.
Is this a known bug, is it a bug at all, or what's happening?
oh, I'm using a standard package setup on current Ubuntu 8.10, so in
particular this should mean mpl version 0.98.3 and numpy 1.1.1. But I
have checked the bleeding edge mlab in svn and at least the typecode(X)
thing appears to be still there.
thanks,
sven
(it would be very nice if you cc me in this thread, but of course I
understand if the list's settings might make it impractical)
From: Michael H. <mh...@us...> - 2009年01月05日 16:54:36
All: I'm trying to make a map (using Basemap), and plot names of cities 
on that map. I'd like to avoid "collisions" of city names (where the 
bounding boxes of the text objects would overlap), but I'm having 
trouble figuring out how I can do this without actually drawing the text 
on the figure.
I found this thread:
http://osdir.com/ml/python.matplotlib.general/2005-02/msg00174.html
which describes how to do it _after_ drawing the text on the plot. This 
would only be useful to me if there were some way to un-draw the text, 
which isn't something I know how to do either.
Figure resizing is not a problem for my application.
Java has a FontMetrics class, which tells you how big a string will be 
in a given font - is there an equivalent for Matplotlib?
--Mike
From: flo_wer <we...@ew...> - 2009年01月05日 16:48:43
It looks like you are trying to use pyplot is an embedded GUI and you
might be better off trying to "embed" mpl in the GUI following the
examples at...
You were right about that. Thanks for the refererences. it helped a lot. The
code is a bit longer now and contains parts from the examples that are hard
for me to fully understand, but it works!!
Florian
-- 
View this message in context: http://www.nabble.com/problems-returning-to-main-program-after-ploting-a-figure-tp21292503p21294467.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Lionel R. <lro...@li...> - 2009年01月05日 16:27:51
Thanks for your responses,
Looking comments in the tickets, putting 
import locale
locale.setlocale(locale.LC_NUMERIC, 'C')
after the pylab import resolves the problem (but not the bug...).
Have a happy new year
Le lundi 05 janvier 2009 à 15:37 +0100, Lionel Roubeyrie a écrit :
> Hi all,
> Trying to write to text files some plotted datas, we have a strange
> behavour on masked arrays after importing pylab, with the dot decimal
> separator replaced by a comma (but not all) : 
> ##############################
> Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) 
> [GCC 4.3.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import numpy as np
> >>> a=np.ma.array([1., 1.01, 2.11, 3.61])
> >>> for i in a:str(i)
> ... 
> '1.0'
> '1.01'
> '2.11'
> '3.61'
> >>> import matplotlib
> >>> for i in a:str(i)
> ... 
> '1.0'
> '1.01'
> '2.11'
> '3.61'
> >>> import pylab
> >>> for i in a:str(i)
> ... 
> '1.0'
> '1,01'
> '2,11'
> '3,61'
> >>> np.__version__, matplotlib.__version__
> ('1.2.1', '0.98.3')
> #############################
> 
> Any help welcomes!
> 
-- 
Lionel Roubeyrie
chargé d'études
LIMAIR - La Surveillance de l'Air en Limousin
http://www.limair.asso.fr
From: John H. <jd...@gm...> - 2009年01月05日 15:42:08
On Mon, Jan 5, 2009 at 9:00 AM, flo_wer <we...@ew...> wrote:
>
> Hi,
> I am using matplotlib to create a figure in a pythonCard script that looks
> like this
>
> def on_button_mouseClick(self, event):
> import matplotlib.pyplot as plt
>
> plt.figure(1)
> for point in list:
> plt.plot([x],[y],'bo')
> plt.title('Water balance %10s' % Gew_Name[0])
> plt.xlabel('Station in km')
> plt.ylabel('Flux in L/s')
> plt.show()
>
> plt.clf()
>
> My problem is that the program will not continue after that. I tried to look
> for commands to delete the figure but clf() was all I found. I am working
> with windows xp and the idle shell. To close idle is the only thing that
> helps. I intended to produce some more figures after the script has
> calculated balances for a stream network. As you might have noticed, I am
> not a python expert so please excuse my humpy description of the problem.
It looks like you are trying to use pyplot is an embedded GUI and you
might be better off trying to "embed" mpl in the GUI following the
examples at
 http://matplotlib.sourceforge.net/examples/user_interfaces/index.html
See also:
http://matplotlib.sourceforge.net/faq/usage_faq.html#matplotlib-pylab-and-pyplot-how-are-they-related
http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show
http://matplotlib.sourceforge.net/faq/installing_faq.html#id1
JDH
From: John H. <jd...@gm...> - 2009年01月05日 15:38:30
On Mon, Jan 5, 2009 at 9:30 AM, <znd...@ya...> wrote:
> but doing so does not save the lines.
> The only workaround I've found is to set animated=false for all the objects,
> print the figure and then set animated=true again.
Yes, that is the way to do it -- we could add some logic to savefig to do this.
JDH
From: <znd...@ya...> - 2009年01月05日 15:30:22
Hello:
I would like to know how to print_figure or savefig with animated elements. The only thing I get is the axis but no animated objects.
The idea is that I've written a program embedding matplotlib in wx and then I create plots and animations in a similar way as in the example animation_blit_wx.py. 
In that way, I do something like:
lines, = self.axes.plot(x,y,animated=True)
background = self.canvas.copy_from_bbox(self.figure.bbox)
and afterwards, I create some animation by updating the ydata in the following way:
self.canvas.restore_region(background)
lines.set_ydata(value)
self.axes.draw_artist(lines)
self.canvas.blit(self.figure.bbox)
and now I would like to save the picture:
self.canvas.print_figure(filename, format)
but doing so does not save the lines.
The only workaround I've found is to set animated=false for all the objects, print the figure and then set animated=true again.
Thanks,
Thomas
 
From: David C. <da...@ar...> - 2009年01月05日 15:28:27
Hi Ryan,
Ryan May wrote:
> Lionel Roubeyrie wrote:
> 
>> Hi all,
>> Trying to write to text files some plotted datas, we have a strange
>> behavour on masked arrays after importing pylab, with the dot decimal
>> separator replaced by a comma (but not all) : 
>> ##############################
>> Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) 
>> [GCC 4.3.2] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> 
>
> This has been reported before, and IIRC, it's a problem with PyGTK.
> 
The fact that pygtk changes the local at import sounds buggy indeed, but
numpy should not be dependent on the locale anyway, so it also shows a
numpy bug I think:
http://scipy.org/scipy/numpy/ticket/884
Pauli and other have been working on those locale-related bugs in numpy,
but they are a bit fastidious to fix - hopefully, they will make their
way into numpy 1.3
David
From: Michael D. <md...@st...> - 2009年01月05日 15:28:18
It's a bug with PyGTK in that merely importing it sets the locale.
But more seriously, it's also a bug in Numpy, in that its string 
formatting is dependent on locale (unlike standard floats in Python).
See this Numpy bug:
http://projects.scipy.org/scipy/numpy/ticket/902
*
*and this mailing list thread:
http://www.mail-archive.com/num...@sc.../msg14563.html
Cheers,
Mike
Ryan May wrote:
> Lionel Roubeyrie wrote:
> 
>> Hi all,
>> Trying to write to text files some plotted datas, we have a strange
>> behavour on masked arrays after importing pylab, with the dot decimal
>> separator replaced by a comma (but not all) : 
>> ##############################
>> Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) 
>> [GCC 4.3.2] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> 
>
> This has been reported before, and IIRC, it's a problem with PyGTK.
>
> Ryan
>
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Michael D. <md...@st...> - 2009年01月05日 15:23:15
This seems to be a bug (or at least inconsistent behavior) in numpy when 
the locale is set (which happens when gtk is imported -- replace 'import 
pylab' with 'import gtk' and you'll see the same behavior).
We actually use a workaround for this in other parts of matplotlib, 
which is:
 for i in a: str(float(i))
By forcing the conversion to a Python float first, you can get around 
the localized number output.
I'll follow up with this on the numpy bug tracker or mailing list, since 
this has been a long-standing niggle of mine as well.
Cheers,
Mike
Lionel Roubeyrie wrote:
> Hi all,
> Trying to write to text files some plotted datas, we have a strange
> behavour on masked arrays after importing pylab, with the dot decimal
> separator replaced by a comma (but not all) : 
> ##############################
> Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) 
> [GCC 4.3.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> 
>>>> import numpy as np
>>>> a=np.ma.array([1., 1.01, 2.11, 3.61])
>>>> for i in a:str(i)
>>>> 
> ... 
> '1.0'
> '1.01'
> '2.11'
> '3.61'
> 
>>>> import matplotlib
>>>> for i in a:str(i)
>>>> 
> ... 
> '1.0'
> '1.01'
> '2.11'
> '3.61'
> 
>>>> import pylab
>>>> for i in a:str(i)
>>>> 
> ... 
> '1.0'
> '1,01'
> '2,11'
> '3,61'
> 
>>>> np.__version__, matplotlib.__version__
>>>> 
> ('1.2.1', '0.98.3')
> #############################
>
> Any help welcomes!
>
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Ryan M. <rm...@gm...> - 2009年01月05日 15:18:21
Lionel Roubeyrie wrote:
> Hi all,
> Trying to write to text files some plotted datas, we have a strange
> behavour on masked arrays after importing pylab, with the dot decimal
> separator replaced by a comma (but not all) : 
> ##############################
> Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) 
> [GCC 4.3.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
This has been reported before, and IIRC, it's a problem with PyGTK.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Lionel R. <lro...@li...> - 2009年01月05日 15:06:18
Hi all,
Trying to write to text files some plotted datas, we have a strange
behavour on masked arrays after importing pylab, with the dot decimal
separator replaced by a comma (but not all) : 
##############################
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> a=np.ma.array([1., 1.01, 2.11, 3.61])
>>> for i in a:str(i)
... 
'1.0'
'1.01'
'2.11'
'3.61'
>>> import matplotlib
>>> for i in a:str(i)
... 
'1.0'
'1.01'
'2.11'
'3.61'
>>> import pylab
>>> for i in a:str(i)
... 
'1.0'
'1,01'
'2,11'
'3,61'
>>> np.__version__, matplotlib.__version__
('1.2.1', '0.98.3')
#############################
Any help welcomes!
-- 
Lionel Roubeyrie
chargé d'études
LIMAIR - La Surveillance de l'Air en Limousin
http://www.limair.asso.fr
From: flo_wer <we...@ew...> - 2009年01月05日 15:00:32
Hi,
I am using matplotlib to create a figure in a pythonCard script that looks
like this
 
def on_button_mouseClick(self, event):
 import matplotlib.pyplot as plt
 
 plt.figure(1)
 for point in list:
 plt.plot([x],[y],'bo')
 plt.title('Water balance %10s' % Gew_Name[0])
 plt.xlabel('Station in km')
 plt.ylabel('Flux in L/s')
 plt.show()
 
 plt.clf()
 
My problem is that the program will not continue after that. I tried to look
for commands to delete the figure but clf() was all I found. I am working
with windows xp and the idle shell. To close idle is the only thing that
helps. I intended to produce some more figures after the script has
calculated balances for a stream network. As you might have noticed, I am
not a python expert so please excuse my humpy description of the problem.
Thanks,
Florian
-- 
View this message in context: http://www.nabble.com/problems-returning-to-main-program-after-ploting-a-figure-tp21292503p21292503.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
1 message has been excluded from this view by a project administrator.

Showing results of 29

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