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
(19) |
2
(30) |
3
(14) |
4
(1) |
5
(16) |
6
(7) |
7
(12) |
8
(14) |
9
(35) |
10
(16) |
11
(31) |
12
(6) |
13
(14) |
14
(13) |
15
(20) |
16
(15) |
17
(27) |
18
(5) |
19
(10) |
20
(22) |
21
(20) |
22
(30) |
23
(25) |
24
(11) |
25
(2) |
26
(2) |
27
(23) |
28
(20) |
29
(26) |
30
(25) |
31
(7) |
|
Thank you Russell. I did post to the wrong group and I apologize for the inconvenience. I'll be posting there. Paul Simon --- Your python is missing the _tkinter library, so it cannot use Tkinter. Normally if you build from source then all you have to do is build and install tcl and tk first, then build python and it should find the tcl/tk and build _tkinter (the library that links to Tcl/Tk and allows Tkinter to work). If you installed from an RPM or some such then perhaps you need to get some additional RPMs. If you have additional questions about installing python with Tkinter support I suggest you post to the python-tkinter mailing list (gmane.comp.python.tkinter on gmane). -- Russell In article <7483F0868D484AE6A0A7DDB5BFBFDFF5@newhome>, "Paul Simon" <ps...@so...> wrote: > I have the "tkinter" problem and need some assistance to straighten it out. > >From the web page "http://wiki.python.org/moin/TkInter" I tested as in "step > 1" and cannot import "_tkinter." I do not have that file on my computer, but > do have tkinter.py in /usr/local/lib/python2.6/lib-tk. as well as the > directories /usr/lib/tk8.5 and /usr/lib/tcl8.5. > This matplotlib and python stuff is great, but the documentation frequently > feels like it is just a bit out of my grasp. I realize that all of this is > free but I understand the instructions on the web page to repair only to the > point of confusion. I'm not an expert. How do I modify my python > configuration? Is there a file that needs to be edited? Which setup.py file > do I use? Make? or python setup.py build and python setup.py install? > Thanks. I appreciate your help. > Paul Simon
On Wed, Jul 8, 2009 at 3:10 AM, Ole Streicher <ole...@gm...>wrote: > Hi again, > > Ole Streicher <ole...@gm...> writes: > > could anyone reproduce this problem and/or has a solution for it? Is > > there anything wrong with my code? > > after some discussion on the PyQt mailing list, I found the cause of the > problem: > > In matplotlib.FigureCanvasQTAgg, the following piece of code is called > on a resizeEvent: > > def draw( self ): > > # ... some internal code > > # Added following line to improve realtime pan/zoom on windows: > QtGui.qApp.processEvents() > > This makes the problem clear: > - if we resize the window quickly, several resizeEvents are created and > are in the event queue of Qt > - the first one gets processed by the QVBoxLayout which starts the > processing in its first (matplotlib) widget. > - the matplotlib widget does what it should and at some point calls > matplotlib.FigureCanvasQTAgg.draw(self). > - this starts the processing of the next event in the queue which is > the next (2nd) resize event. BUT: we are still in the processing of > the first event!!! > - the 2nd event goes to the QVBoxLayout, from there to the matlotlib > widget (eventually starting some recursive behaviour here) > - if the 2nd event is finished, QVBoxLayout sends it to its other widget > (the scrollbar). The scrollbar is resized according to the *2nd event*. > - if the processing of the 2nd event was finished and no more events are > in the queue, the matplotlib.FigureCanvasQTAgg.draw() finishes > - at the end, this will finish the processing of the first resize event > in the matplotlib widget and start the *first resize event* for the > scrollbar > > This is exactly the behaviour that I observed. It is caused by the > QtGui.qApp.processEvents() call in the draw() function. > > So, I think this is clearly a bug in matplotlib: > QtGui.qApp.processEvents() should not be called while processing another > event. > Thank you Ole for tracking this down. I have submitted a change in svn 7250 which I think fixes this problem. However, the offending line was originally added to improve performance of panning and zooming on windows. I have tested the changes on 64-bit windows vista, and panning and zooming appear to be responsive, but I would appreciate it if other windows users would test as well. Just save the attached files into your site-packages/matplotlib/backends directory to test the new code. Thanks, Darren
Are matplotlib backends pluggable? That is, can package X provide an experimental backend and tell matplotlib to use it? If so, how?
Hi Jef, please apologize me for the delay i had days without internet connection :-/ sorry if i gived you a bad explanation ... for sky plot i means plot like : http://www.tpub.com/content/armyengineer/en0593a/en0593a0209.htm the data i'm receiving from the gps device are : PRN = satellite ID EL = ELevation (integer 0-90) AZ = Azimuth (integer 0-359) Ss = Signal-Strenghts (decibels) Used = (1,0) for each satellite visible at the moment, i receive data for each second. i'm printing the data in an html table http://img43.imageshack.us/i/immagine3ftd.png/ but i tring to learn how to use matplotlib to display the data in a "sky-plot" (i don't know the real name of this polar-diagram) i gived a look at matplotlib tutorial pages .. and i find really usefull the "web-plot" example ... i'll follow that way but the real problem is : i don't know the math formulae and matplotlib syntax needed to create a such kind of plot. thanks for any suggestion! regards, Massimo. Il giorno 03/lug/09, alle ore 03:34, Jeff Whitaker ha scritto: > Massimo Di Stefano wrote: >> Hi All, >> >> >> i'm starting to learn matplotlib, >> for my study i need to parse the nmea sentence from a gps >> and plot a "sky graphic" to plot satellite visibility. >> >> (i tried to write code from scratch ... it works but my teacher >> suggest me to not reinvent the well, so, to have a good nema >> parser, i installed gpsd ... it has in the source code a nice >> python code that allow me to retrieve satellite constallation >> iformation). >> >> now i need to learn how to produce a sky plot, >> have you any suggestion on how to produce such kind of graphic ? >> > > Massimo: I've no idea what a "sky plot" is. Can you point us to an > example? > > -Jeff >> thanks to all for any suggestion! >> >> Massimo. >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >
Your python is missing the _tkinter library, so it cannot use Tkinter. Normally if you build from source then all you have to do is build and install tcl and tk first, then build python and it should find the tcl/tk and build _tkinter (the library that links to Tcl/Tk and allows Tkinter to work). If you installed from an RPM or some such then perhaps you need to get some additional RPMs. If you have additional questions about installing python with Tkinter support I suggest you post to the python-tkinter mailing list (gmane.comp.python.tkinter on gmane). -- Russell In article <7483F0868D484AE6A0A7DDB5BFBFDFF5@newhome>, "Paul Simon" <ps...@so...> wrote: > I have the "tkinter" problem and need some assistance to straighten it out. > >From the web page "http://wiki.python.org/moin/TkInter" I tested as in "step > 1" and cannot import "_tkinter." I do not have that file on my computer, but > do have tkinter.py in /usr/local/lib/python2.6/lib-tk. as well as the > directories /usr/lib/tk8.5 and /usr/lib/tcl8.5. > This matplotlib and python stuff is great, but the documentation frequently > feels like it is just a bit out of my grasp. I realize that all of this is > free but I understand the instructions on the web page to repair only to the > point of confusion. I'm not an expert. How do I modify my python > configuration? Is there a file that needs to be edited? Which setup.py file > do I use? Make? or python setup.py build and python setup.py install? > Thanks. I appreciate your help. > Paul Simon > > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge
Again, apologies if this is an obvious question but I couldn't find the answer. With a lw=1 dotted (:) line the dots are square and it looks very nice. But when I put lw up say to 2 or 3, the dots become rectangular, which looks a bit odd, particularly at points where the underlying graph curves sharply compared to the spacing of the dots. Is there anyway to keep the dots square (ie as lw=2 for both dimensions) instead of rectangular? Cheers Robin
Hi Robin, What version of matplotlib do you use? For me the following works: ax.set_position(ax.get_position()) The object returned by get_position is "A mutable bounding box.", which is also supported in set_position. Nevertheless set_position supports lists with '[left, bottom, width, height]', too. E.g. ax.set_position([0.2, .4, 0.4, .5]) best regards Matthias On Wednesday 08 July 2009 16:10:37 Robin wrote: > Hi, > > After quite a bit of trial and error I realised that ax.get_position() > is returning numbers in the form a Bbox which are very different to > the numbers you need for ax.set_position(). > > Often I want to use the subplot positioning first, then get the > positions that sets up for some manual tweaking. Is there a way to > convert the output of get_position into the same form as for > set_position? > > Cheers > > Robin
Hi, I'm running the example code dynamic_image_gtkagg.py, but am only getting about 6 FPS. Does anyone know how to speed this up (eg by a factor of 10 or so!)? The call to manager.canvas.draw() it taking the bulk of the time. Thanks, agb.
Hi, After quite a bit of trial and error I realised that ax.get_position() is returning numbers in the form a Bbox which are very different to the numbers you need for ax.set_position(). Often I want to use the subplot positioning first, then get the positions that sets up for some manual tweaking. Is there a way to convert the output of get_position into the same form as for set_position? Cheers Robin
Hi, I'm sure its a bit lazy to ask but I can't think of the right keywords to search for... I would like to produce a plot with a zoomed in box detail section. What I have in mind is a plot of an exponentially decaying line with some fine detail, so I would like the main plot to show the scale of the exponential decay, but then in the large space in the center/top/right of the plot I would like to have a zoomed in box showing more detail of a particular bit to show the level of the noise etc. No idea where to start with acheiving this so I thought I'd ask if anyone has done anything similar or if there would be any examples on the web site - or whether it would be easier just to produce 2 plots at different scales then chop them together in a graphics editing program. (I thought of inkscape, but in the past when I've tried to edit matplotlib vector output it messed up the fonts - or at least changed them - so I'm not sure if theres a better program, or some trick to using it). Cheers Robin
Hi list (yes, me, again :D) I'm having difficulties with matplotlib svn (rev 7249) and animations. I'm a bit lost on what I have to do to get my animation running smoothly? I had various attempts, It seems that the best result I can have is by totally skipping the canvas.restore_region(self.background) shown in the examples : the resizing of the window make the plot look terribly broken sorry for this question that seems well covered by documentation and examples :S I'm attaching a sample code that reproduces the behavior of my app, It's a bit long but I hope there's some good things in it that can be usefull to others :) ===code snippet=== import wxversion wxversion.ensureMinimal('2.8') import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas import wx import wx.aui from matplotlib.figure import Figure import sys import getopt from threading import * from itertools import izip import time class myplotData(Figure): def __init__(self,name,width=5,height=4,dpi=60,x_axis=None): Figure.__init__(self,figsize=(width, height),dpi=dpi) self.name = name self.ax = self.add_subplot(111,label=name,animated=True) self.bg = None self.mdirty = False def refreshbg(self): self.bg = self.canvas.copy_from_bbox(self.ax.bbox) def feed(self,n): timestamp = n[0] self.n = 0 if self.bg == None: self.canvas = self.ax.figure.canvas self.canvas.draw() self.bg = self.canvas.copy_from_bbox(self.ax.bbox) for xs in n[1:]: self.ax.plot([timestamp],[xs],animated=True) return #self.canvas.restore_region(self.bg) mylines = self.ax.get_lines() for xs,line in izip(n[1:],mylines): x,y = line.get_data() x = np.concatenate((x,[timestamp])) y = np.concatenate((y,[xs])) line.set_data([x,y]) self.ax.set_xlim(xmax=timestamp) curyminlim,curymaxlim = self.ax.get_ylim() self.ax.set_ylim(ymin=min(xs,curyminlim),ymax=max(xs,curymaxlim)) self.ax.draw_artist(line) self.mdirty = True wx.WakeUpIdle() def blit(self): if self.mdirty: self.mdirty = False self.canvas.blit(self.ax.get_figure().bbox) class CanvasPanel(wx.Panel): def __init__(self,name,callback=None,parent=None): wx.Panel.__init__(self, parent) self.SetSize((120, 80)) self.figure = myplotData(name) self.canvas = FigureCanvas(self,-1,self.figure) self.parent = parent self.callback = callback color = (255,255,255) self.SetColor(color) self._SetSize() self._resizeflag = False self.Bind(wx.EVT_IDLE, self._onIdle) self.Bind(wx.EVT_SIZE, self._onSize) def SetColor(self,rgbtuple=None): """Set figure and canvas colours to be the same.""" if rgbtuple is None: rgbtuple = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE).Get() clr = [c/255. for c in rgbtuple] self.figure.set_facecolor(clr) self.figure.set_edgecolor(clr) self.canvas.SetBackgroundColour(wx.Colour(*rgbtuple)) def _onSize(self,event): self._resizeflag = True def _onIdle(self,evt): if self._resizeflag: self._resizeflag = False self._SetSize() self.figure.blit() def _SetSize(self): pixels = tuple(self.parent.GetClientSize()) self.SetSize(pixels) self.canvas.SetSize(pixels) self.figure.set_size_inches(float(pixels[0])/self.figure.get_dpi(), float(pixels[1])/self.figure.get_dpi()) #self.figure.refreshbg() def process(self,data): if self.callback != None: x = self.callback(data) self.figure.feed(x) else: self.figure.feed(data) # Define notification event for thread notifications EVT_RESULT_ID = wx.NewId() def EVT_RESULT(win, func): """Define Result Event.""" win.Connect(-1, -1, EVT_RESULT_ID, func) class ResultEvent(wx.PyEvent): """Simple event to carry arbitrary result data.""" def __init__(self, data): """Init Result Event.""" wx.PyEvent.__init__(self) self.SetEventType(EVT_RESULT_ID) self.data = data class ParserThread(Thread): def __init__(self,source,notify_window): Thread.__init__(self) self._notify_window = notify_window self.data = np.arange(0,2*np.pi,0.01) self.n = 0 self.round = 0 self.start() def run(self): while(1): mbuff = {} mbuff['name'] = "My Sin Plot" mbuff['x'] = self.data[self.n] + self.round*2*np.pi mbuff['y1'] = np.sin(mbuff['x']) mbuff['y2'] = np.sin(mbuff['x'] + np.pi/2) self.n+=1 if self.n == len(self.data): self.n = 0 self.round += 1 wx.PostEvent(self._notify_window, ResultEvent(('test',[mbuff]))) time.sleep(.1) def mycback(data): return data['x'],data['y1'],data['y2'] class MyApp(wx.Frame): def __init__(self,parent=None, id=wx.ID_ANY,pos=wx.DefaultPosition,size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE): wx.Frame.__init__(self, parent) self.bestsize = (120,75) self.SetSize(self.GetBestSize()) self.panel = wx.Panel(self,wx.ID_ANY) self.panel.nb = wx.aui.AuiNotebook(self.panel) self.label = wx.StaticText(self.panel.nb,wx.ID_ANY,"\n\n\n\naaa\n") self.panel.nb.AddPage(self.label, "txt") sizer = wx.BoxSizer() sizer.Add(self.panel.nb, 1, wx.EXPAND) self.panel.SetSizer(sizer) self.plotlist = {} self.Fit() EVT_RESULT(self,self.OnResult) self.worker = ParserThread(5758,self) def OnResult(self,event): tag,mbuff = event.data if tag == -1: return for buff in mbuff: if not self.plotlist.has_key(buff['name']): cback = mycback page = CanvasPanel(buff['name'],mycback,self.panel.nb) self.panel.nb.AddPage(page,buff['name']) self.plotlist[buff['name']] = page myPlot = self.plotlist[buff['name']] myPlot.process(buff) def main(argv=None): if argv != None: sys.argv = argv app = wx.App() frame = MyApp() frame.Show() app.MainLoop() if __name__ == "__main__": main() ===code snippet=== ---- This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie. ----
Hi again, Ole Streicher <ole...@gm...> writes: > could anyone reproduce this problem and/or has a solution for it? Is > there anything wrong with my code? after some discussion on the PyQt mailing list, I found the cause of the problem: In matplotlib.FigureCanvasQTAgg, the following piece of code is called on a resizeEvent: def draw( self ): # ... some internal code # Added following line to improve realtime pan/zoom on windows: QtGui.qApp.processEvents() This makes the problem clear: - if we resize the window quickly, several resizeEvents are created and are in the event queue of Qt - the first one gets processed by the QVBoxLayout which starts the processing in its first (matplotlib) widget. - the matplotlib widget does what it should and at some point calls matplotlib.FigureCanvasQTAgg.draw(self). - this starts the processing of the next event in the queue which is the next (2nd) resize event. BUT: we are still in the processing of the first event!!! - the 2nd event goes to the QVBoxLayout, from there to the matlotlib widget (eventually starting some recursive behaviour here) - if the 2nd event is finished, QVBoxLayout sends it to its other widget (the scrollbar). The scrollbar is resized according to the *2nd event*. - if the processing of the 2nd event was finished and no more events are in the queue, the matplotlib.FigureCanvasQTAgg.draw() finishes - at the end, this will finish the processing of the first resize event in the matplotlib widget and start the *first resize event* for the scrollbar This is exactly the behaviour that I observed. It is caused by the QtGui.qApp.processEvents() call in the draw() function. So, I think this is clearly a bug in matplotlib: QtGui.qApp.processEvents() should not be called while processing another event. Best regards Ole
I have the "tkinter" problem and need some assistance to straighten it out. >From the web page "http://wiki.python.org/moin/TkInter" I tested as in "step 1" and cannot import "_tkinter." I do not have that file on my computer, but do have tkinter.py in /usr/local/lib/python2.6/lib-tk. as well as the directories /usr/lib/tk8.5 and /usr/lib/tcl8.5. This matplotlib and python stuff is great, but the documentation frequently feels like it is just a bit out of my grasp. I realize that all of this is free but I understand the instructions on the web page to repair only to the point of confusion. I'm not an expert. How do I modify my python configuration? Is there a file that needs to be edited? Which setup.py file do I use? Make? or python setup.py build and python setup.py install? Thanks. I appreciate your help. Paul Simon
Mauro Cavalcanti wrote: > Dear Jeff, > > Thanks for your fast reply. No problem with manually installing the > Basemap data files -- indeed, this is just what I do intend in order > to create a frozen application. But other than setting up the > BASEMAPDATA environment variable, is there any way to tell an > application to look for the data in a specific directory? > > No. -Jeff > Best regards, > > 2009年7月7日 Jeff Whitaker <js...@fa...>: > >> Mauro Cavalcanti wrote: >> >>> Dear Jeff & ALL, >>> >>> In trying to freeze my app using bb-freeze >>> (http://pypi.python.org/pypi/bbfreeze/), I stumbled upon a problem: >>> the app is correctly freezed, but it then looks for the Basemap >>> datafiles and since cannot find them, fails to start (with a message >>> complaining that the above mentioned files are missing). So, my >>> question is: can Basemap data files be installed in a directory other >>> than the default one? And if so, how to instruct a program to look for >>> them in another location? >>> >>> Thanks in advance for any assistance you can provide. >>> >>> Best regards, >>> >>> >>> >> Mauro: If you set the env var BASEMAPDATA, it will look for the basemap >> data files there. There is no way supported way to install the files in a >> different directory using setup.py, so if you want them somewhere other than >> the default location you'll have to install them there manually. >> >> -Jeff >> >> -- >> 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 >> >> >> > > > >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I am using matplotlib in a django application and would like to render a graph and return it directly. Currently I have plt.savefig("some/location.png") working. But since the images I will be generating are only EVER needed once, I would like to simply return the image directly through django without needing to save it, then return an URI. so instead of doing plt.savefig("some/location.png") return HttpResponse("<html><body><img src='some/location.png' /></body></html>") I could do return HttpResponse(plt.image_render('image/png'), mimetype="image/png") and not have to worry about deleting the image later (there are LOT that get generated) Any help would be greatly appreciated. ~Doug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkpT3SAACgkQznigyIaDZ0VyPACgg0CoapaPTdLT1vGKKMK9En8O gasAn1LV9F1ElT6vOOq/PCRzp7kkW+5s =6oe8 -----END PGP SIGNATURE-----
Dear Jeff, Thanks for your fast reply. No problem with manually installing the Basemap data files -- indeed, this is just what I do intend in order to create a frozen application. But other than setting up the BASEMAPDATA environment variable, is there any way to tell an application to look for the data in a specific directory? Best regards, 2009年7月7日 Jeff Whitaker <js...@fa...>: > Mauro Cavalcanti wrote: >> >> Dear Jeff & ALL, >> >> In trying to freeze my app using bb-freeze >> (http://pypi.python.org/pypi/bbfreeze/), I stumbled upon a problem: >> the app is correctly freezed, but it then looks for the Basemap >> datafiles and since cannot find them, fails to start (with a message >> complaining that the above mentioned files are missing). So, my >> question is: can Basemap data files be installed in a directory other >> than the default one? And if so, how to instruct a program to look for >> them in another location? >> >> Thanks in advance for any assistance you can provide. >> >> Best regards, >> >> > > Mauro: If you set the env var BASEMAPDATA, it will look for the basemap > data files there. There is no way supported way to install the files in a > different directory using setup.py, so if you want them somewhere other than > the default location you'll have to install them there manually. > > -Jeff > > -- > 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 > > -- 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."
Mauro Cavalcanti wrote: > Dear Jeff & ALL, > > In trying to freeze my app using bb-freeze > (http://pypi.python.org/pypi/bbfreeze/), I stumbled upon a problem: > the app is correctly freezed, but it then looks for the Basemap > datafiles and since cannot find them, fails to start (with a message > complaining that the above mentioned files are missing). So, my > question is: can Basemap data files be installed in a directory other > than the default one? And if so, how to instruct a program to look for > them in another location? > > Thanks in advance for any assistance you can provide. > > Best regards, > > Mauro: If you set the env var BASEMAPDATA, it will look for the basemap data files there. There is no way supported way to install the files in a different directory using setup.py, so if you want them somewhere other than the default location you'll have to install them there manually. -Jeff -- 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
Hi Matthias! many thanks for the help, that was it. I will now remember to use show() only once and use other techniques to create something like show(), but that can be called multiple times. Thanks, Ondrej On Tue, Jul 7, 2009 at 5:35 AM, Matthias Michler<Mat...@gm...> wrote: > Hi Ondrej, > > I'm not sure where to find a good explanation of that, but let me give you > some hints. It is intended to use show only once per program. Namely 'show' > should be the last line in your script. If you want interactive plotting you > may consider interactive mode (pyplot.ion-ioff) like in the example below. > > Furthermore for dynamic plotting all animation demos might be useful. > > Maybe you want to have also a look at > http://matplotlib.sourceforge.net/users/shell.html . > > best regards Matthias > > #################### > from pylab import * > > t = linspace(0.0, pi, 100) > x = cos(t) > y = sin(t) > > ion() # turn on interactive mode > figure(0) > subplot(111, autoscale_on=False, xlim=(-1.2, 1.2), ylim=(-.2, 1.2)) > > point = plot([x[0]], [y[0]], marker='o', mfc='r', ms=3) > > for j in arange(len(t)): > # reset x/y-data of point > setp(point[0], data=(x[j], y[j])) > draw() # redraw current figure > > ioff() # turn off interactive mode > show() > ################ > > On Monday 06 July 2009 08:13:37 Ondrej Certik wrote: >> On Tue, Jun 30, 2009 at 12:09 PM, Ondrej Certik<on...@ce...> wrote: >> > Hi, >> > >> > this must have been answered many times already, but I searched the >> > archives, online docs, but couldn't find anything. >> > >> > If I do: >> > >> > $ python >> > Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18) >> > [GCC 4.3.3] on linux2 >> > Type "help", "copyright", "credits" or "license" for more information. >> > >> >>>> import pylab >> >>>> pylab.plot([1, 3, 3]) >> > >> > [<matplotlib.lines.Line2D object at 0x2154350>] >> > >> >>>> pylab.show() >> >>>> pylab.show() >> > >> > the first pylab.show() shows the plot and stays hanging (this is ok) >> > and then if I close it, to get back to the shell, the second call to >> > show() does nothing. >> > >> > One fix is to use: >> > >> > ipython --pylab >> > >> > but if I just want to call regular python, or from my own script --- >> > how do I plot for the second time? >> >> I still haven't figured out how to fix it, so any feedback would be >> appreciated. >> >> Thanks, >> Ondrej > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/blackberry > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hello, two days ago Sebastian helped me to finish in a hurry a histogram with bar() I would like now to understand how to make the plot with hist() First of all, my data (after a massage) looks like : ----------------------------------------- 0.00e+00 1.00e-04 81039 1.00e-04 2.00e-04 4472 2.00e-04 3.00e-04 2033 3.00e-04 4.00e-04 1155 4.00e-04 5.00e-04 823 5.00e-04 6.00e-04 643 6.00e-04 7.00e-04 534 7.00e-04 8.00e-04 361 8.00e-04 9.00e-04 313 9.00e-04 1.00e-03 269 1.00e-03 1.10e-03 230 1.10e-03 1.20e-03 195 1.20e-03 1.30e-03 178 1.30e-03 1.40e-03 165 1.40e-03 1.50e-03 175 1.50e-03 1.60e-03 125 1.60e-03 1.70e-03 109 1.70e-03 1.80e-03 112 1.80e-03 1.90e-03 90 . . . . 9.86e-02 9.87e-02 0 9.87e-02 9.88e-02 0 9.88e-02 9.89e-02 0 9.89e-02 9.90e-02 0 9.90e-02 9.91e-02 0 9.91e-02 9.92e-02 0 9.92e-02 9.93e-02 0 9.93e-02 9.94e-02 0 9.94e-02 9.95e-02 0 9.95e-02 9.96e-02 1 ----------------------------------------- The bins are given by the two first number columns. For instance, the first bin is from 0.00e+00 to 1.00e-04 and has the number of data 81039 Then I run the following script on them: ---------------------------------------------- #!/usr/bin/env python from pylab import * H = load ( './histo3.dat') h = H[:, 2] # the third column n, bins, patches = hist(h, 997, normed=0, log=0, facecolor='lightblue', alpha=0.75) show() ---------------------------------------------- The number 997 is because this is the number of lines I have in my file (and, thus, the number of bins) But the plot is ranging between 0 - 90000 --> on x axis 0 - 1000 --> on y axis Notice in the data file that x does not get further than 9.96e-02 So the maximum should be 0.0996 and I am getting 90000 Why is that? What am I doing wrong? I have tried to substitute lower-case e with E in the data file but this did not help Any help would be appreciated. thanks, Pau
Dear Jeff & ALL, In trying to freeze my app using bb-freeze (http://pypi.python.org/pypi/bbfreeze/), I stumbled upon a problem: the app is correctly freezed, but it then looks for the Basemap datafiles and since cannot find them, fails to start (with a message complaining that the above mentioned files are missing). So, my question is: can Basemap data files be installed in a directory other than the default one? And if so, how to instruct a program to look for them in another location? 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."
I have several plots where the scientific notation exponential overflows to the top of the plot like this: http://matplotlib.sourceforge.net/examples/pylab_examples/plotfile_demo.html. Is there any way to add units to this? So that, if I wanted, the units would show up in the overflow as: 1e8 m^3 , for meters cubed? Also, is there an easy way to add units to the numbers on the x or y axis in general? Thanks. Joseph Smidt -- ------------------------------------------------------------------------ Joseph Smidt <jos...@gm...> Physics and Astronomy 4129 Frederick Reines Hall Irvine, CA 92697-4575 Office: 949-824-3269
Hi, I compiled matplotlib svn revision 7246 yesterday to try the 3D stuff. >From mpl's website, an example for 3D bar plotting is shown[1]. I just don't understand the axes. From the code, shouldn't X values go from 0 to 20, instead of 0 to 400 000 like shown on the graph? Where does these values for the X and Z axes comes from (in the graph)? I'm trying my own 3D bar plot, with similar "weird" results. Could it be a bug? Thanx a lot. [1] http://matplotlib.sourceforge.net/examples/mplot3d/bars3d_demo.html
Hi everyone, I just installed matplotlib (after suffering from Numpy, Scipy, Atlas, Lapack...), and I have this weird problem. When I plot the first time I have no problem, the plot comes out just fine and the plot window is interactive. After I close the plotting window and try to plot again I can see the graph but the plot window doesn't response (not interactive). When I import pylab I get this warning: >>> import pylab Warning (from warnings module): File "/home/yoavv/ActivePython-2.6_64/lib/python2.6/site-packages/pytz/tzinfo.py", line 5 from sets import Set DeprecationWarning: the sets module is deprecated >>> pylab.plot(range(100)) [<matplotlib.lines.Line2D object at 0x2b921d0>] >>> p = _ >>> pylab.show() >>> pylab.plot(range(200)) [<matplotlib.lines.Line2D object at 0x3113510>] - Here no response. I am using: - ActivePython-2.6 - matplotlib 0.98.5.3 I would appreciate any help, Thanks, voichek -- View this message in context: http://www.nabble.com/Problem-plotting-with-matplotlib-on-ActivePython-tp24374558p24374558.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi Steve, matplotlib-0.98.5.3.win32-py2.6.exe was compiled without support for GTK. If you don't mind trying, I have a build of the matplotlib trunk available on my homepage that has GTK support enabled: http://www.lfd.uci.edu/~gohlke/#pythonlibs It should work with the PyGTK 2.12 Windows binaries from http://www.pygtk.org/downloads.html. SVG support seems broken: the window.set_icon_from_file() function in backend_gtk.py will raise an exception, not recognizing SVG files. The PNG icon works. Christoph
Hi everyone, I use matplotlib to render a figure in a tkinter (the Tix library more precisely) canvas. It works very well but I can't turn off the autoscale (and I would like to), even by setting ax.set_autoscale_on(False). When I test with ax.get_autoscale_on(), the result is False, but the axes continues to autoscale. I didn't had this problem in the past with ubuntu 8.04. I have it since I made the update to the 8.10 distribution so I guess that it's because the version of matplotlib I use have changed also (but I don't remember the number of this previous version). Now I use python 2.5.2, Tix 8.4.0, mpl 0.98.3, numpy 1.2.1 ppa release, scipy 0.7.0 ppa release. Here is the graphic part of my app : class GraphFrame(Tix.Frame): def __init__(self,master): Tix.Frame.__init__(self,master,bd=10) self.gen = Tix.Frame(self) self.fps = Figure(figsize=(5,4),dpi=100,facecolor='w') self.tlps = 'Phase Space' self.xlps = {'xlabel' : r'$x$','fontsize' : 16} self.ylps = {'ylabel' : r'$p$','rotation' : 'horizontal','fontsize' : 16} self.aps = self.fps.add_subplot(111) self.aps.set_title(self.tlps) self.aps.set_xlabel(**self.xlps) self.aps.set_ylabel(**self.ylps) self.canvasps = FigureCanvasTkAgg(self.fps,master=self.gen) self.canvasps.get_tk_widget().pack(side=Tix.TOP,fill=Tix.BOTH,expand=1) self.toolbar = NavigationToolbar2TkAgg(self.canvasps, self.gen) self.toolbar.update() self.canvasps._tkcanvas.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) self.gen.grid(row=0, columnspan=14, sticky='NWSE') self.aps.set_autoscale_on(False) #doesn't work !!! # self.aps.autoscale_view(scalex=False,scaley=False) self.psLin = [] self.cl = ('r','g','b','c','y','m','k') self.coch = self.canvasps.mpl_connect('button_press_event', self.onpsclick) self.crh = self.canvasps.mpl_connect('button_release_event', self.onpsrelease) self.cmh = self.canvasps.mpl_connect('motion_notify_event', self.onpsmotion) self.cFrame = None self.press = False def ocps_connect(self): self.coch = self.canvasps.mpl_connect('button_press_event', self.onpsclick) self.crh = self.canvasps.mpl_connect('button_release_event', self.onpsrelease) self.cmh = self.canvasps.mpl_connect('motion_notify_event', self.onpsmotion) def ocps_disconnect(self): self.canvasps.mpl_disconnect(self.coch) self.canvasps.mpl_disconnect(self.crh) self.canvasps.mpl_disconnect(self.cmh) #some method I use to update the graph def psaddData_m(self,u,xmin,xmax,pmin,pmax,m=','): line = lines.Line2D(u[:,0],u[:,1], linestyle='None', marker=m, color=self.cl[np.mod(len(self.psLin)-1,6)]) self.psLin.append(line) self.psDraw(xmin,xmax,pmin,pmax) def psaddData_l(self,u,xmin,xmax,pmin,pmax,l='-'): line = lines.Line2D(u[:,0],u[:,1], linestyle=l, color=self.cl[np.mod(len(self.psLin)-1,6)]) self.psLin.append(line) self.psDraw(xmin,xmax,pmin,pmax) def psdelData(self,n): del self.psLin[n] self.aps.clear() # self.aps.cla() for l in self.psLin: self.aps.add_line(l) self.aps.set_title(self.tlps) self.aps.set_xlabel(**self.xlps) self.aps.set_ylabel(**self.ylps) self.aps.redraw_in_frame() self.canvasps.blit() def psDraw(self,xmin,xmax,pmin,pmax): # self.aps.clear() self.aps.cla() self.aps.set_xlim(xmin,xmax) self.aps.set_ylim(pmin,pmax) for l in self.psLin: self.aps.add_line(l) self.aps.set_title(self.tlps) self.aps.set_xlabel(**self.xlps) self.aps.set_ylabel(**self.ylps) self.aps.draw() self.canvasps.blit() # self.aps.set_autoscale_on(False) # self.aps.autoscale_view(scalex=False,scaley=False) # a = self.aps.get_autoscale_on() # print a def psifRedraw(self): self.aps.clear() # self.aps.cla() for l in self.psLin: self.aps.add_line(l) self.aps.set_title(self.tlps) self.aps.set_xlabel(**self.xlps) self.aps.set_ylabel(**self.ylps) self.aps.redraw_in_frame() self.canvasps.blit() def psRedraw(self): self.aps.redraw_in_frame() self.canvasps.blit() # click event handling def onpsclick(self,event): Bhv=self.cFrame.stDico['psMode'].get() if event.inaxes!=self.aps: return if Bhv == 'Nothing': return self.press = True if Bhv == 'Traj': niter=int(self.cFrame.stDico['n iter'].get()) jb = self.cFrame.TrajJacob.get() if jb: lj = float(self.cFrame.TJDirlStr.get()) hj = float(self.cFrame.TJDirhderStr.get()) jnb = self.cFrame.nTrajJacob.get() if jnb: ljn = float(self.cFrame.nTJDirlStr.get()) hjn = float(self.cFrame.nTJDirhderStr.get()) v = np.array([event.xdata,event.ydata]) s = [v] if jb: sj = [Jacob(v,hj,utils.dfridr)] if jnb: sjn = [Jacob(v,hjn,utils.dfridr)] for i in xrange(0,niter): u = pm.Map(v) s.append(u) v = u if jb: sj.append(Jacob(v,hj,utils.dfridr)) if jnb: sjn.append(np.dot(sjn[-1],Jacob(v,hjn,utils.dfridr))) w = np.vstack(s) line = lines.Line2D(w[:,0],w[:,1],color='b') if jb: for i in xrange(len(sj)): J = sj[i] v = s[i] (lr,vr) = eig(J,right=True) if reduce(lambda x,y : (np.abs(x)-1.)*(np.abs(y)-1.),lr) >= 0: print 'Problem : The point '+str(i+1)+' is not hyperbolic' print 'J=',J print 'l=',lr else: if abs(lr[0]) < 1.: u1 = vr[:,0] u2 = vr[:,1] else: u1 = vr[:,1] u2 = vr[:,0] ul1 = np.vstack([v-lj*u1,v+lj*u1]) ul2 = np.vstack([v-lj*u2,v+lj*u2]) line1 = lines.Line2D(ul1[:,0],ul1[:,1],color='b') line2 = lines.Line2D(ul2[:,0],ul2[:,1],color='r') self.aps.add_line(line1) self.aps.add_line(line2) if jnb: for i in xrange(len(sjn)): J = sjn[i] v = s[i] (lr,vr) = eig(J,right=True) if reduce(lambda x,y : (np.abs(x)-1.)*(np.abs(y)-1.),lr) >= 0: print 'Problem : The traj '+str(i+1)+' is not hyperbolic' print 'J=',J print 'l=',lr else: if abs(lr[0]) < 1.: u1 = vr[:,0] u2 = vr[:,1] else: u1 = vr[:,1] u2 = vr[:,0] ul1 = np.vstack([v-ljn*u1,v+ljn*u1]) ul2 = np.vstack([v-ljn*u2,v+ljn*u2]) line1 = lines.Line2D(ul1[:,0],ul1[:,1],color='g') line2 = lines.Line2D(ul2[:,0],ul2[:,1],color='m') self.aps.add_line(line1) self.aps.add_line(line2) elif Bhv == '1it': v = np.array([event.xdata,event.ydata]) u = pm.Map(v) w = np.vstack([v,u]) line = lines.Line2D(w[:,0],w[:,1], linestyle='None', marker='+', markersize=10., color='k') elif Bhv == 'Preim': xmin=float(self.cFrame.stDico['pixmin'].get()) xmax=float(self.cFrame.stDico['pixmax'].get()) pmin=float(self.cFrame.stDico['pipmin'].get()) pmax=float(self.cFrame.stDico['pipmax'].get()) nx=int(self.cFrame.stDico['pinx'].get()) ny=int(self.cFrame.stDico['pinp'].get()) tol=float(self.cFrame.stDico['pitol'].get()) it=int(self.cFrame.stDico['piter'].get()) al=float(self.cFrame.stDico['pialpha'].get()) npim = self.cFrame.preimmVar.get() v = np.array([event.xdata,event.ydata]) u = preMap(npim,v,xmin,xmax,pmin,pmax,nx,ny,tol,it,al) if u != None: w = np.vstack([v,u]) else: w = v w.shape = 1,2 line = lines.Line2D(w[:,0],w[:,1], linestyle='None', marker='+', markersize=10., color='k') elif Bhv == 'Jacob': l = float(self.cFrame.DirlStr.get()) h = float(self.cFrame.DirhderStr.get()) v = np.array([event.xdata,event.ydata]) J = Jacob(v,h,utils.dfridr) (lr,vr) = eig(J,right=True) if reduce(lambda x,y : (np.abs(x)-1.)*(np.abs(y)-1.),lr) >= 0: print 'Problem : The point is not hyperbolic' print 'J=',J print 'l=',lr return if abs(lr[0]) < 1.: u1 = vr[:,0] u2 = vr[:,1] else: u1 = vr[:,1] u2 = vr[:,0] ul1 = np.vstack([v-l*u1,v+l*u1]) ul2 = np.vstack([v-l*u2,v+l*u2]) line = lines.Line2D(ul1[:,0],ul1[:,1],color='b') line1 = lines.Line2D(ul2[:,0],ul2[:,1],color='r') self.aps.add_line(line1) self.aps.add_line(line) # self.aps.set_title(self.tlps) # self.aps.set_xlabel(**self.xlps) # self.aps.set_ylabel(**self.ylps) self.aps.redraw_in_frame() self.canvasps.blit() def onpsmotion(self,event): Bhv=self.cFrame.stDico['psMode'].get() if event.inaxes!=self.aps: return if self.press == False: return if Bhv == 'Nothing': return self.aps.clear() # self.aps.cla() for l in self.psLin: self.aps.add_line(l) self.aps.set_title(self.tlps) self.aps.set_xlabel(**self.xlps) self.aps.set_ylabel(**self.ylps) if Bhv == 'Traj': niter=int(self.cFrame.stDico['n iter'].get()) jb = self.cFrame.TrajJacob.get() if jb: lj = float(self.cFrame.TJDirlStr.get()) hj = float(self.cFrame.TJDirhderStr.get()) jnb = self.cFrame.nTrajJacob.get() if jnb: ljn = float(self.cFrame.nTJDirlStr.get()) hjn = float(self.cFrame.nTJDirhderStr.get()) v = np.array([event.xdata,event.ydata]) s = [v] if jb: sj = [Jacob(v,hj,utils.dfridr)] if jnb: sjn = [Jacob(v,hjn,utils.dfridr)] for i in xrange(0,niter): u = pm.Map(v) s.append(u) v = u if jb: sj.append(Jacob(v,hj,utils.dfridr)) if jnb: sjn.append(np.dot(sjn[-1],Jacob(v,hjn,utils.dfridr))) w = np.vstack(s) line = lines.Line2D(w[:,0],w[:,1],color='b') if jb: for i in xrange(len(sj)): J = sj[i] v = s[i] (lr,vr) = eig(J,right=True) if reduce(lambda x,y : (np.abs(x)-1.)*(np.abs(y)-1.),lr) >= 0: print 'Problem : The point '+str(i+1)+' is not hyperbolic' print 'J=',J print 'l=',lr else: if abs(lr[0]) < 1.: u1 = vr[:,0] u2 = vr[:,1] else: u1 = vr[:,1] u2 = vr[:,0] ul1 = np.vstack([v-lj*u1,v+lj*u1]) ul2 = np.vstack([v-lj*u2,v+lj*u2]) line1 = lines.Line2D(ul1[:,0],ul1[:,1],color='b') line2 = lines.Line2D(ul2[:,0],ul2[:,1],color='r') self.aps.add_line(line1) self.aps.add_line(line2) if jnb: for i in xrange(len(sjn)): J = sjn[i] v = s[i] (lr,vr) = eig(J,right=True) if reduce(lambda x,y : (np.abs(x)-1.)*(np.abs(y)-1.),lr) >= 0: print 'Problem : The traj '+str(i+1)+' is not hyperbolic' print 'J=',J print 'l=',lr else: if abs(lr[0]) < 1.: u1 = vr[:,0] u2 = vr[:,1] else: u1 = vr[:,1] u2 = vr[:,0] ul1 = np.vstack([v-ljn*u1,v+ljn*u1]) ul2 = np.vstack([v-ljn*u2,v+ljn*u2]) line1 = lines.Line2D(ul1[:,0],ul1[:,1],color='g') line2 = lines.Line2D(ul2[:,0],ul2[:,1],color='m') self.aps.add_line(line1) self.aps.add_line(line2) elif Bhv == '1it': v = np.array([event.xdata,event.ydata]) u = pm.Map(v) w = np.vstack([v,u]) line = lines.Line2D(w[:,0],w[:,1], linestyle='None', marker='+', markersize=10., color='k') elif Bhv == 'Preim': xmin=float(self.cFrame.stDico['pixmin'].get()) xmax=float(self.cFrame.stDico['pixmax'].get()) pmin=float(self.cFrame.stDico['pipmin'].get()) pmax=float(self.cFrame.stDico['pipmax'].get()) nx=int(self.cFrame.stDico['pinx'].get()) ny=int(self.cFrame.stDico['pinp'].get()) tol=float(self.cFrame.stDico['pitol'].get()) it=int(self.cFrame.stDico['piter'].get()) al=float(self.cFrame.stDico['pialpha'].get()) npim = self.cFrame.preimmVar.get() v = np.array([event.xdata,event.ydata]) u = preMap(npim,v,xmin,xmax,pmin,pmax,nx,ny,tol,it,al) if u != None: w = np.vstack([v,u]) else: w = v w.shape = 1,2 line = lines.Line2D(w[:,0],w[:,1], linestyle='None', marker='+', markersize=10., color='k') elif Bhv == 'Jacob': l = float(self.cFrame.DirlStr.get()) h = float(self.cFrame.DirhderStr.get()) v = np.array([event.xdata,event.ydata]) J = Jacob(v,h,utils.dfridr) (lr,vr) = eig(J,right=True) if reduce(lambda x,y : (np.abs(x)-1.)*(np.abs(y)-1.),lr) >= 0: print 'Problem : The point is not hyperbolic' print 'J=',J print 'l=',lr return if abs(lr[0]) < 1.: u1 = vr[:,0] u2 = vr[:,1] else: u1 = vr[:,1] u2 = vr[:,0] ul1 = np.vstack([v-l*u1,v+l*u1]) ul2 = np.vstack([v-l*u2,v+l*u2]) line = lines.Line2D(ul1[:,0],ul1[:,1],color='b') line1 = lines.Line2D(ul2[:,0],ul2[:,1],color='r') self.aps.add_line(line1) self.aps.add_line(line) # self.aps.set_title(self.tlps) # self.aps.set_xlabel(**self.xlps) # self.aps.set_ylabel(**self.ylps) self.aps.redraw_in_frame() self.canvasps.blit() def onpsrelease(self,event): self.press = False self.aps.clear() # self.aps.cla() for l in self.psLin: self.aps.add_line(l) self.aps.set_title(self.tlps) self.aps.set_xlabel(**self.xlps) self.aps.set_ylabel(**self.ylps) self.aps.redraw_in_frame() self.canvasps.blit() # end I don't know if it is a bug or something else but thank you in advance if you can help me. Jonathan