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




Showing 13 results of 13

From: Andrew S. <str...@as...> - 2005年05月03日 21:32:42
Hi all,
Not of interest to most, and you'll probably know it you need it:
Debian users users of P4 machines using the atlas3-sse2 package may be 
interested in a set of .debs which fix the "feclearexcept() error on 
CPUs with SSE" bug [1]
The .debs generated are available here: 
http://www.its.caltech.edu/~astraw/coding.html
1. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=279294
From: Matt N. <new...@ca...> - 2005年05月03日 19:52:53
Svein-Erik,
I can't run your example because I don't have pyFDTF06:
> from pyFDTD06 import *
But it seems you have a classic case of putting a resource
intensive loop inside a GUI (in this case, in the OnStart
method) and not allowing the GUI toolkit to respond to 
other events.
As a first attempt to fix this, you probably want to add a
self.Refresh() in your loop in OnStart:
# if ( (self.el.iteration % self.el.PLOT_MODULUS) == 0):
# self.im.set_array(self.el.Ex[:,:,22])
# self.canvas.draw()
# self.Refresh() # <--- !!
# self.el.pointsource(45,20,22)
A better approach might be to replace your
 for self.el.iteration in range(0, self.el.TIME_STEPS)
loop with a timer loop.
Hope that helps, 
--Matt
From: Svein-Erik H. <se...@ff...> - 2005年05月03日 18:43:24
I have been trying to get a dynamic plot using imagesc. I have copied some examples I have found. The problem is that if I make another window come in front of the matplotlib wondow the plot window freezes. If I click in the window it will tell me that it is not responding. I have tried to modify several of the examples but all end up where the plot window freeze. I attach the latest code at the end. It will not run as I am including another file I have. Any tips on what the problem is would be very helpful.
Is there any way to use the pylab interface to make dynamic plots?
Svein-Erik
import matplotlib
matplotlib.use("WXAgg")
matplotlib.interactive(True)
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.figure import Figure
from matplotlib.axes import Subplot
from pyFDTD06 import *
import wx
class PlotFigure(wx.Frame):
 def __init__(self):
 wx.Frame.__init__(self, None, -1, "Test embedded wxFigure")
 self.fig = Figure((5,4), 75)
 self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
 sizer = wx.BoxSizer(wx.VERTICAL)
 sizer.Add(self.canvas, 1, wx.TOP)
 # create start/stop buttons
 self.button_start = wx.Button(self,-1, " Start ", size=(-1,-1))
 self.button_stop = wx.Button(self,-1, " Stop ", size=(-1,-1))
 # bind actions to the buttons
 self.button_start.Bind(wx.EVT_BUTTON,self.OnStart)
 self.button_stop.Bind(wx.EVT_BUTTON, self.OnStop)
 # pack the buttons in the Sizer
 btnsizer = wx.BoxSizer(wx.HORIZONTAL)
 btnsizer.Add(self.button_start, 1, wx.LEFT)
 btnsizer.Add(self.button_stop, 1, wx.LEFT)
 sizer.Add(btnsizer, 0, wx.TOP)
 self.SetSizer(sizer)
 self.Fit()
 # initialize the data here 
 self.el = FDTD()
 self.el.TIME_STEPS = 100
 self.el.initmatrix()
 a = self.fig.add_subplot(111)
 self.im = a.imshow( self.el.Ex[:,:,22], vmin=-0.002, vmax=0.002)
 
 def OnStop(self):
 pass
 
 def OnStart(self,event=None):
 for self.el.iteration in range(0, self.el.TIME_STEPS):
 self.el.currentSimulatedTime = self.el.dt*self.el.iteration
 print "#%d %E sec" %(self.el.iteration,self.el.currentSimulatedTime) 
 if ( (self.el.iteration % self.el.PLOT_MODULUS) == 0):
 self.im.set_array(self.el.Ex[:,:,22])
 self.canvas.draw()
 self.el.pointsourceEx(45,20,22)
 self.el.calcHB()
 self.el.calcED()
if __name__ == "__main__":
 app = wx.PySimpleApp(0)
 frame = PlotFigure()
 frame.Show(True)
 app.MainLoop()
From: Darren D. <dd...@co...> - 2005年05月03日 17:31:41
Hi Everyone,
The x axis can draw ticks on the top and/or the bottom of the window. The 
default is both, with ticklabels on the bottom. xaxis.tick_top will cause 
ticks and labels to draw only on the top, tick_bottom will do the same on the 
bottom. But if I make such a change, there is no xaxis method to draw ticks 
(and maybe labels) on both the top and the bottom, if I want to undo the 
changes.
I would like to change the top and bottom ticks and labels independently, 
which would require a small change in these methods:
 def tick_top(self):
 'use ticks only on top'
 ticks = self.get_major_ticks()
 ticks.extend( self.get_minor_ticks() )
 for t in ticks:
 t.tick1On = False
 t.tick2On = True
 t.label1On = False
 t.label2On = True
could become this:
 def tick_top(self, draw=True):
 'use ticks on top'
 ticks = self.get_major_ticks()
 ticks.extend( self.get_minor_ticks() )
 for t in ticks:
 t.tick2On = draw
 def tick_label_top(self, draw=True):
 'use tick labels on top'
 ticks = self.get_major_ticks()
 ticks.extend( self.get_minor_ticks() )
 for t in ticks:
 t.label2On = draw
Would that cause problems for anyone? Of course, the same would hold for the 
y-axis...
-- 
Darren S. Dale
Bard Hall
Department of Materials Science and Engineering
Cornell University
Ithaca, NY. 14850
dd...@co...
From: Darren D. <dd...@co...> - 2005年05月03日 14:48:11
On Tuesday 03 May 2005 10:02 am, Humufr wrote:
> I tried the new notation and I think it's good but sometimes the result
> is not so good. For example with the plot ( plot(x+2e10, -x+2e6) ) I
> have a: +1.99999e6 for the y scale and it's not exactly the goal of this
> change I think.
> But good idea for this change.
>
This was by design. I had a version at one point that would have looked lik=
e=20
this for your example:
=A0----------------------------------------------
=A0 -5 =A0 =A0 =A0 -4 =A0 =A0 =A0 =A0-3 =A0 =A0 =A0 -2 =A0 =A0 =A0 -1 =A0 =
=A0 =A0 =A00
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 x1e5+2e10=20
I didnt want positive data to have negative ticklabels, I think it is more=
=20
important to understand the plot at a glance, even if it results in an ugly=
=20
offset. What really settled the issue in my mind is that you can always fin=
d=20
a case that produces an ugly offset, for example:=20
plot(arange(0,1e5,1e4)+7.777777777e15). When you consider zooming the plot=
=20
and panning the plot, there needs to be a consistent method to determine th=
e=20
offset, otherwise the ticklabels could switch from positive or negative whi=
le=20
you navigate.
in ticker.py, you can set useOffset in ScalarFormatter.__init__() to False,=
=20
which would give you more or less the current behavior:
 ----------------------------------------------
 2 2 2 2 2 2
 x1e10=20
With the new default behavior (useOffset=3DTrue), if you don't like the off=
set,=20
you can at least interpret your data and decide how to process it in order =
to=20
generate a more acceptable plot.
Thank you for pointing this out.
=2D-=20
Darren S. Dale
Bard Hall
Department of Materials Science and Engineering
Cornell University
Ithaca, NY. 14850
dd...@co...
From: Humufr <hu...@ya...> - 2005年05月03日 14:02:39
I tried the new notation and I think it's good but sometimes the result 
is not so good. For example with the plot ( plot(x+2e10, -x+2e6) ) I 
have a: +1.99999e6 for the y scale and it's not exactly the goal of this 
change I think.
But good idea for this change.
N.
From: Werner F. B. <wer...@fr...> - 2005年05月03日 13:55:34
Hi John,
I'll have a look at it, so I am not sure if I have code which excersises 
them all. Give me a few days.
See you
Werner
John Hunter wrote:
>>>>>>"Florent" == Florent Rougon <f.r...@fr...> writes:
> 
> 
> 
> Florent> There are several other uses of strftime. Maybe some of
> Florent> them should be changed, also...
> 
> Werner, could I trouble you to do this -- update all the uses of
> strftime to properly handle locales and send me a patch?
> 
> Thanks,
> JDH
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games.
> Get your fingers limbered up and give it your best shot. 4 great events, 4
> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
From: John H. <jdh...@ac...> - 2005年05月03日 13:43:16
>>>>> "Florent" == Florent Rougon <f.r...@fr...> writes:
 Florent> There are several other uses of strftime. Maybe some of
 Florent> them should be changed, also...
Werner, could I trouble you to do this -- update all the uses of
strftime to properly handle locales and send me a patch?
Thanks,
JDH
From: Darren D. <dd...@co...> - 2005年05月03日 13:28:57
On Tuesday 03 May 2005 3:25 am, Sascha Schnepp wrote:
> Hi,
>
> this seems to be very nice! Unfortunately my knowledge about the inner life
> of matplotlib is not that deep, so I didn't understand where and what to
> change to benefit from the new format.
>
> Could you please give some further information.
Sure, I forgot to mention that I made the changes in CVS, so for now you will 
need to get a fresh copy of MPL from CVS, make the changes I suggested in 
ticker.py, remove your old MPL from python/site-packages, and install from 
CVS. If you dont want to deal with CVS, you can probably try it in the next 
release.
In addition to the example John gave, there are two more improvements. If you 
plot(arange(0,5e10,1e9)) you would get something like this:
 ----------------------------------------------
 0 1 2 3 4 5
 x1e10
if you plot(arange(0,5e6,1e5)+2e10) you would get something like this:
 ----------------------------------------------
 0 1 2 3 4 5
 x1e6+2e10
Finally, I look at all the ticklabels together to figure out how to format 
them. Labels that used to look like this:
 ----------------------------------------------
 0 0.5 1 1.5 2 2.5
Will now look like this:
 ----------------------------------------------
 0 0.5 1.0 1.5 2.0 2.5
I think it looks better, especially on the y axis.
>
> ===================================================================
>
> > Message: 7
> > From: Darren Dale <dd...@co...>
> > Reply-To: dd...@co...
> > To: mat...@li...,
> > mat...@li...
> > Date: Mon, 2 May 2005 19:57:08 -0400
> > Subject: [Matplotlib-users] new scientific notation format
> >Hi Everyone,
> >There is a new formatter in ticker.py called NewScalarFormatter. If you
> > have scientific notation in your plots, you may like the results. If you
> > would like to try it out, you need to change
> > ScalarFormatter->OldScalarFormatter, and
> > NewScalarFormatter->ScalarFormatter. It will then be the default for
> > linear scale axes. I would appreciate feedback, it will hopefully become
> > the default at some point.
> >Darren
> >--__--__--
> >Message: 8
> > To: dd...@co...
> > Cc: mat...@li...
> > From: John Hunter <jdh...@ac...>
> > Date: 2005年5月02日 21:08:20 -0500
> > Subject: [Matplotlib-users] Re: [matplotlib-devel] new scientific
> > notation format
> >
> >>>>>> "Darren" == Darren Dale <dd...@co...> writes:
> >
> > Darren> Hi Everyone, There is a new formatter in ticker.py called
> > Darren> NewScalarFormatter. If you have scientific notation in
> > Darren> your plots, you may like the results. If you would like to
> > Darren> try it out, you need to change
> > Darren> ScalarFormatter->OldScalarFormatter, and
> > Darren> NewScalarFormatter->ScalarFormatter. It will then be the
> > Darren> default for linear scale axes. I would appreciate
> > Darren> feedback, it will hopefully become the default at some
> > Darren> point.
> >Maybe you can provide an example that illustrates the range of normal
> > and pathological changes that the new formatter is designed to
> > address, so that people can compare the results visually.
> >The basic problem the new formatter is trying to solve is to properly
> > format cases where the view limits range from something like 2e10 to
> > 2e10+5.
> > from pylab import *
> > x = arange(5.0)
> > plot(x+2e10, x)
> > show()
> >Ie, limits where the range is small compared to end values. In this
> > case the new formatter figures out what the offset is, factors it out
> > of the ticks, and displays it on the axis, so for the case above, you
> > would see something like this for the x-axis
> > ----------------------------------------------
> > 0 1 2 3 4 5
> > +2e10
> >and the location of the offset text (2e10) is configurable.
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games.
> Get your fingers limbered up and give it your best shot. 4 great events, 4
> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Darren S. Dale
Bard Hall
Department of Materials Science and Engineering
Cornell University
Ithaca, NY. 14850
dd...@co...
From: Florent R. <f.r...@fr...> - 2005年05月03日 09:53:13
Hi,
"Werner F. Bruhin" <wer...@fr...> wrote:
> The solution which works for me is to "import locale" and get the default
> encoding from it. I have tested it on both Win XP and 2000 and it works for
> me, i.e. in English locale I get "Dec" and in French locale I get "déc." etc.
> without the correction I would get a graphic sign for the "é".
Successfully tested on Linux with LC_TIME=fr_FR.
> The only two changes needed to dates.py are:
>
> import locale
>
> and change
>
> return dt.strftime(fmt)
There are several other uses of strftime. Maybe some of them should be
changed, also...
-- 
Florent
From: Sascha S. <sc...@te...> - 2005年05月03日 07:26:06
Hi,
this seems to be very nice! Unfortunately my knowledge about the inner li=
fe of matplotlib is not that deep, so I didn't understand where and what =
to change to benefit from the new format.
Could you please give some further information.
Thanks!
Sascha
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> Message: 7
> From: Darren Dale <dd...@co...>
> Reply-To: dd...@co...
> To: mat...@li...,
> mat...@li...
> Date: Mon, 2 May 2005 19:57:08 -0400
> Subject: [Matplotlib-users] new scientific notation format
>Hi Everyone,
>There is a new formatter in ticker.py called NewScalarFormatter. If you =
have
> scientific notation in your plots, you may like the results. If you wou=
ld
> like to try it out, you need to change ScalarFormatter->OldScalarFormat=
ter,
> and NewScalarFormatter->ScalarFormatter. It will then be the default fo=
r
> linear scale axes. I would appreciate feedback, it will hopefully becom=
e the
> default at some point.
>Darren
>--__--__--
>Message: 8
> To: dd...@co...
> Cc: mat...@li...
> From: John Hunter <jdh...@ac...>
> Date: 2005年5月02日 21:08:20 -0500
> Subject: [Matplotlib-users] Re: [matplotlib-devel] new scientific notat=
ion format
>
>>>>>> "Darren" =3D=3D Darren Dale <dd...@co...> writes:
> Darren> Hi Everyone, There is a new formatter in ticker.py called
> Darren> NewScalarFormatter. If you have scientific notation in
> Darren> your plots, you may like the results. If you would like to
> Darren> try it out, you need to change
> Darren> ScalarFormatter->OldScalarFormatter, and
> Darren> NewScalarFormatter->ScalarFormatter. It will then be the
> Darren> default for linear scale axes. I would appreciate
> Darren> feedback, it will hopefully become the default at some
> Darren> point.
>Maybe you can provide an example that illustrates the range of normal
> and pathological changes that the new formatter is designed to
> address, so that people can compare the results visually.
>The basic problem the new formatter is trying to solve is to properly
> format cases where the view limits range from something like 2e10 to
> 2e10+5.
> from pylab import *
> x =3D arange(5.0)
> plot(x+2e10, x)
> show()
>Ie, limits where the range is small compared to end values. In this
> case the new formatter figures out what the offset is, factors it out
> of the ticks, and displays it on the axis, so for the case above, you
> would see something like this for the x-axis
> ----------------------------------------------
> 0 1 2 3 4 5
> +2e10
>and the location of the offset text (2e10) is configurable.
From: Werner F. B. <wer...@fr...> - 2005年05月03日 07:17:47
I haven't had any feedback on my original post for this, would be great 
if someone could verify that this works in other configurations, e.g. on 
Linux or other language then French which uses accented characters in 
the month name abreviations.
The problem is that if a plot shows month names as axes labels.
When I run this on a machine in "French" (i.e. on Win XP changing the
Settings - Regional and Language settings" to French the labels don't
show correctly if there is an accented character in there e.g. "déc".
The solution which works for me is to "import locale" and get the 
default encoding from it. I have tested it on both Win XP and 2000 and 
it works for me, i.e. in English locale I get "Dec" and in French locale 
I get "déc." etc. without the correction I would get a graphic sign for 
the "é".
The only two changes needed to dates.py are:
import locale
and change
return dt.strftime(fmt)
to
return unicode(dt.strftime(fmt), locale.getpreferredencoding())
Best regards
Werner
Werner F. Bruhin wrote:
From: John H. <jdh...@ac...> - 2005年05月03日 02:08:24
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
 Darren> Hi Everyone, There is a new formatter in ticker.py called
 Darren> NewScalarFormatter. If you have scientific notation in
 Darren> your plots, you may like the results. If you would like to
 Darren> try it out, you need to change
 Darren> ScalarFormatter->OldScalarFormatter, and
 Darren> NewScalarFormatter->ScalarFormatter. It will then be the
 Darren> default for linear scale axes. I would appreciate
 Darren> feedback, it will hopefully become the default at some
 Darren> point.
Maybe you can provide an example that illustrates the range of normal
and pathological changes that the new formatter is designed to
address, so that people can compare the results visually.
The basic problem the new formatter is trying to solve is to properly
format cases where the view limits range from something like 2e10 to
2e10+5. 
 from pylab import *
 x = arange(5.0)
 plot(x+2e10, x)
 show()
Ie, limits where the range is small compared to end values. In this
case the new formatter figures out what the offset is, factors it out
of the ticks, and displays it on the axis, so for the case above, you
would see something like this for the x-axis
 ----------------------------------------------
 0 1 2 3 4 5 
 +2e10
and the location of the offset text (2e10) is configurable.
JDH

Showing 13 results of 13

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