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






Showing results of 620

<< < 1 .. 20 21 22 23 24 25 > >> (Page 22 of 25)
From: Wayne W. <sie...@sb...> - 2010年02月07日 17:11:35
As it turns out, this was easy to solve. What drove me to this point is 
that the distributor of the software I use mentioned that numpy had to 
be installed before MPL. I had only installed MPL when I ran into a 
program that failed. I thought it might be because I hadn't installed 
numpy first, in fac I had not at all installed it at that moment. Now I 
was faced with the question of backing out MPL. However, the MPL install 
had given several warnings about some file missing. This reinforced the 
idea order was needed. As it turns out order doesn't matter here. I 
installed numpy and all is working fine. I have no idea though when 
order does matter.
On 2/6/2010 4:39 AM, Christoph Gohlke wrote:
> Depending on the version and installer used, manually remove
>
> C:\Python25\Lib\site-packages\pylab.py
> C:\Python25\Lib\site-packages\matplotlib
> C:\Python25\Lib\site-packages\mpl_toolkits
> C:\Python25\Lib\site-packages\matplotlib*.egg-info
> C:\Python25\Removematplotlib.exe
> C:\Python25\matplotlib-wininst.log
>
> The packages dateutil and pytz are also installed along with matplotlib
> but might be used by other packages too.
>
> Christoph
>
>
> On 2/5/2010 12:11 PM, Wayne Watson wrote:
> 
>> I'm working in IDLE in Win7. It seems to me it gets stuck in
>> site-packages under C:\Python25. Maybe this is as simple as deleting the
>> entry?
>>
>> Well, yes there's a MPL folder under site-packages and an info MPL file
>> of 540 bytes. There are also pylab.py, pyc,and py0 files under site.
>> What to do next?
>>
>> On 2/5/2010 7:13 AM, Wayne Watson wrote:
>> 
>>> I should have installed numpy first, and got some errors installing
>>> MPL. I don't see an uninstall in Control Panel Add/Rmv.
>>>
>>> 
>> 
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> 
-- 
My life in two words. "Interrupted Projects." -- WTW (quote originator)
From: Filipe P. A. F. <oc...@gm...> - 2010年02月07日 17:11:21
Hello list,
I'm trying to create a stick-plot figure using the quiver function from
matplotlib. However, I'm failing miserably to plot dates in the x-axis. Has
anyone done this before? Also, is there an effort to create a stickplot
function?
Thanks, Filipe
*****************************************************
Filipe Pires Alvarenga Fernandes
University of Massachusetts Dartmouth
200 Mill Road - Fairhaven, MA
Tel: (508) 910-6381
Email: fal...@um...
 oc...@ya...
 oc...@gm...
http://ocefpaf.tiddlyspot.com/
*****************************************************
From: Wayne W. <sie...@sb...> - 2010年02月07日 17:02:33
(I see I "forgot" to post this solution to the list. I really have 
quickly developed a dislike for having to go to extra lengths to make 
sure this happens. Perhaps one of my difficulties is that some people 
respond directly to me, and my mail filter shuttles the message to my 
matplotlib folder instead of my inbox, so it looks like someone has sent 
their response to the list.)
Looking at your code suggests this is not what I want. The cumsum 
(summation) buffaloes me. I've just moved to Win7, and my PC is not yet 
ready for Python, so I can't really grasp what you have.
 From what I've been able to determine from a friend, who knows MatLab 
extremely well, this is not a difficult thing to do in MatLab, and 
likely in MPL. The creation of the path across a canvas/figure is done 
with plot. It will draw the zig-zag starting with x0,y0. To show the 
path clearly there are several ways to proceed. I can color each point 
successively with R,G, and B. The first red point, maybe with the 
help of an icon, says this is the start. Maybe a red circle. The next 
two points use a green and blue circle, probably of a different size, 
or maybe a square. R,G,B is repeated along the path. Another choice is 
to define an arrow and orient it in the direction of the next segment. 
An appealing way to do all of this is to pause drawing the next segment. 
That way, the dynamics of the path are clearly seen.
On 2/5/2010 5:16 AM, Alan G Isaac wrote:
> On 2/5/2010 12:51 AM, Wayne Watson wrote:
>
>> what I'm looking for is a way to draw a zig-zag path
>> indicating a path taken by a particle
>>
> Here is a 2d example:
>
> >>> import numpy as np
> >>> import matplotlib.pyplot as plt
> >>> locs = np.random.random_sample((2,30))
> >>> locs = np.random.random_sample((2,30)) - 0.5
> >>> locs = np.cumsum(locs, axis=-1)
> >>> x,y = locs
> >>> plt.plot(x,y)
>
> hth,
> Alan Isaac
>
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
-- 
My life in two words. "Interrupted Projects." -- WTW (quote originator)
From: David M. <mac...@ec...> - 2010年02月07日 14:24:34
Thanks to all who have replied. {Ipython, Vpython, Spyder, WxPython,
Eclipse} x {Windows XP, Windows 7, Mac OSX, Linux} - looks like we have many
{IDE, platform} combinations to test, and no consensus on any one choice. 
Student needs are different than large project developers. I need an IDE
that works well on all these platforms, is easy to install, and easy to use
for physics students who are writing small programs.
Unfortunately, I don't have time for beta testing these products, and I need
to make a recommendation soon. Perhaps we need an enhancement request for
Matplotlib. It needs either IDLE or one of these other IDEs thoroughly
tested and included in the packages for each platform.
One of the teachers in our group is very happy with Sage. It looks like a
good replacement for Matlab. I don't like that it is so different than
standard Python, but there is great appeal to something that "just works". 
Students will have even less time than I do to struggle with these setup
issues.
I'm still experimenting with IDLE, and it sure looks like nothing
fundamentally wrong, just a sloppy integration with Matplotlib and
documentation that either doesn't exist, or is too hard to find. For
example, if I use draw() instead of show(), I can avoid freezing the IDLE
window, and make multiple overlaid plots as needed. I can't find any
documentation on this, however, and I am probably doing it wrong.
Is there anyone here that uses IDLE with Matplotlib. Maybe we just need a
HOWTO note. What is the Console window for? What commands are available in
that window? I see that "exit" causes control to switch back to IDLE, but
then I can't continue using draw(). When should I use close() or exit()? 
Is there any way to clear the plot window of existing data, and continue
plotting without having to restart the entire session?
-- 
View this message in context: http://old.nabble.com/Matplotlib-conflicts-with-IDLE-tp27473693p27489064.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Pierre R. <co...@py...> - 2010年02月07日 09:43:44
Gael Varoquaux a écrit :
> On Sun, Feb 07, 2010 at 09:59:04AM +0100, Pierre Raybaut wrote:
> 
>> Two screenshots to prove it :-)
>>
>> Running an example script including "pdb.set_trace()" in the external 
>> console:
>> http://spyderlib.googlegroups.com/web/pdb_test.png
>> Executing the same script from a Python interpreter within the external 
>> console:
>> http://spyderlib.googlegroups.com/web/pdb_test2.png
>> 
>
> Nice. I am not sure why when I tried it, it didn't work. I don't have
> spyder around to test.
>
> Gaël
> 
I suppose you tried it in the interactive console (Spyder's internal 
console) which does not support pdb indeed.
Anyway, the external console is probably not the ultimate scientific 
console mainly because it does not support matplotlib in interactive 
mode for now (actually, I still haven't heard any complaint on this 
point because people use the interactive console for interactive work -- 
e.g. analyzing and visualizing data -- and the external console for 
application development). But I guess I could make it work eventually.
-Pierre
From: Gael V. <gae...@no...> - 2010年02月07日 09:08:20
On Sun, Feb 07, 2010 at 09:59:04AM +0100, Pierre Raybaut wrote:
> Two screenshots to prove it :-)
>
> Running an example script including "pdb.set_trace()" in the external 
> console:
> http://spyderlib.googlegroups.com/web/pdb_test.png
> Executing the same script from a Python interpreter within the external 
> console:
> http://spyderlib.googlegroups.com/web/pdb_test2.png
Nice. I am not sure why when I tried it, it didn't work. I don't have
spyder around to test.
Gaël
From: Pierre R. <co...@py...> - 2010年02月07日 08:58:39
Pierre Raybaut a écrit :
> 2010年2月6日 Gael Varoquaux <gae...@no...>:
> 
>> On Sat, Feb 06, 2010 at 11:27:50AM +0100, Pierre Raybaut wrote:
>> When you start having a somewhat complex set of functions that call
>> each other, or when you are getting failures with somebody else's code,
>> this is priceless. This is so useful that to debug some code that, when I
>> am trying to understand why some code is not working the way it should
>> be, I will purposely add an exception, to be able to introspect the code.
>> Granted, adding pdb.set_trace() will work without IPython[*], but I find
>> it very useful.
>>
>> [*] It will not work in Spyder as it is quite challenging to have these
>> features requiring user terminal interaction in a GUI.
>> 
>
> Actually it works in Spyder too (in the external console which is
> executed in a another process).
> ;-)
>
> -Pierre
> 
Two screenshots to prove it :-)
Running an example script including "pdb.set_trace()" in the external 
console:
http://spyderlib.googlegroups.com/web/pdb_test.png
Executing the same script from a Python interpreter within the external 
console:
http://spyderlib.googlegroups.com/web/pdb_test2.png
-Pierre
From: JackD <web...@we...> - 2010年02月07日 01:23:24
Hi there!
I need to know how to close a figure/chart in matplot. 
The problem is: I am developing a program that calculates >5 figures and
needs some minutes to calculate one. So it would be great if I could close
the figure if the next figure is ready cause then I am able to show both
figures and so on.....
Does anyone know how it works and could you explain on the below example?
import matplotlib.pyplot as plt
import time
fig = plt.figure(1)
ax = fig.add_subplot(111)
ax.plot((1, 3, 1))
plt.draw()
fig = plt.figure(2)
ax = fig.add_subplot(111)
ax.plot((4, 1, 0))
plt.show()
time.sleep(10)
plt.close(1)
-- 
View this message in context: http://old.nabble.com/Python-Matplotlib%3A-How-to-close-a-plot--tp27485059p27485059.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jae-Joon L. <lee...@gm...> - 2010年02月06日 22:58:50
The above version has some typos (while it works it had some
side-effects), here is the corrected one.
-JJ
import matplotlib.blocking_input as blocking_input
if blocking_input.BlockingMouseInput.add_click ==
blocking_input.BlockingContourLabeler.add_click:
 def mouse_event_stop(self, event ):
 blocking_input.BlockingInput.pop(self,-1)
 self.fig.canvas.stop_event_loop()
 def add_click(self, event):
 self.button1(event)
 def pop_click(self, event, index=-1):
 if self.inline:
 pass
 else:
 self.cs.pop_label()
 self.cs.ax.figure.canvas.draw()
 blocking_input.BlockingMouseInput.mouse_event_stop = mouse_event_stop
 blocking_input.BlockingContourLabeler.add_click = add_click
 blocking_input.BlockingContourLabeler.pop_click = pop_click
On Sat, Feb 6, 2010 at 5:52 PM, David Arnold <dwa...@su...> wrote:
> JJ,
>
> Very nice repair, as this works precisely as it should. I use this tool in Matlab all the time when teaching multivariable calculus.
>
> D.
>
> On Feb 6, 2010, at 2:41 PM, Jae-Joon Lee wrote:
>
>> This is a known bug, and I think I fixed it in the svn. Meanwhile, you
>> may use the monkey patching.
>> Insert these lines in your script (before you call clabel).
>>
>> Regards,
>>
>> -JJ
>>
>>
>> import matplotlib.blocking_input as blocking_input
>> def mouse_event_stop(self, event ):
>>  blocking_input.BlockingInput.pop(self,-1)
>>  self.fig.canvas.stop_event_loop()
>> def add_click(self, event):
>>  self.button1(event)
>> def pop_click(self, event, index=-1):
>>  if self.inline:
>>    pass
>>  else:
>>    self.cs.pop_label()
>>    self.cs.ax.figure.canvas.draw()
>>
>> blocking_input.BlockingMouseInput.mouse_event_stop = mouse_event_stop
>> blocking_input.BlockingMouseInput.add_click = add_click
>> blocking_input.BlockingMouseInput.pop_click = pop_click
>>
>>
>>
>> On Sat, Feb 6, 2010 at 2:01 AM, David Arnold <dwa...@su...> wrote:
>>> Hi,
>>>
>>> I'm trying to get manual labeling of contours to work:
>>>
>>> import numpy as np
>>> import matplotlib.mlab as mlab
>>> import matplotlib.pyplot as plt
>>>
>>> delta = 0.025
>>> x = np.arange(-3.0, 3.0, delta)
>>> y = np.arange(-2.0, 2.0, delta)
>>> X, Y = np.meshgrid(x, y)
>>> Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
>>> Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
>>> # difference of Gaussians
>>> Z = 10.0 * (Z2 - Z1)
>>>
>>> plt.figure()
>>> CS = plt.contour(X, Y, Z, 6,
>>>         linewidths=np.arange(.5, 4, .5),
>>>         colors=('r', 'green', 'blue', (1,1,0), '#afeeee', '0.5')
>>>         )
>>> plt.clabel(CS, fontsize=9, inline=1, manual=True)
>>> plt.title('Crazy lines')
>>>
>>> plt.show()
>>>
>>> On my macbook, clicking with the touchpad does not seem to work.
>>>
>>> Any ideas?
>>>
>>> David.
>>>
>>> ------------------------------------------------------------------------------
>>> The Planet: dedicated and managed hosting, cloud storage, colocation
>>> Stay online with enterprise data centers and the best network in the business
>>> Choose flexible plans and management services without long-term contracts
>>> Personal 24x7 support from experience hosting pros just a phone call away.
>>> http://p.sf.net/sfu/theplanet-com
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>
>
From: Ben A. <BAx...@co...> - 2010年02月06日 22:55:38
I looked into this issue a little bit and found that the FigureCanvas must be set on the Figure before the 3D axes is instantiated. A simple re-ordering of the lines in the code below makes mouse rotation work again.
# ...
self.figure = Figure()
self.canvas = FigureCanvas(self, -1, self.figure)
#You must set up the canvas before creating the 3D axes
self.axes = Axes3D(self.figure)
# ...
Perhaps this should be documented somehow? Or maybe a new mplot3d example code should be added. Or maybe 
Axes3D.mouse_init() should warn the user if self.figure.canvas is None.
-Ben
-----Original Message-----
From: Ben Axelrod [mailto:BAx...@co...] 
Sent: Monday, February 01, 2010 3:56 PM
To: mat...@li...
Subject: [Matplotlib-users] Axes3D rotation not working when embedded in backend
I would like to use Axes3D embedded in Wx. This works, but there is no mouse rotation. Clicking and dragging the mouse on the plot does not rotate the 3D axes like it does in the "scatter3d_demo.py". I tried: WX, WXAgg, and TkAgg with similar results. Can this be fixed soon, or can someone point me to where I can try to fix it?
I tested with the latest SVN tree on Linux and Windows.
Thanks,
-Ben
Below is some sample code adapted from "embedding_in_wx2.py", but with an Axes3D instead of the regular plot:
#!/usr/bin/env python
# adapted from example code "embedding_in_wx2.py"
# Used to guarantee to use at least Wx2.8 import wxversion
wxversion.ensureMinimal('2.8')
import numpy as np
import matplotlib
# uncomment the following to use wx rather than wxagg
#matplotlib.use('WX')
#from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas
# comment out the following to use wx rather than wxagg
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.figure import Figure
from mpl_toolkits.mplot3d import Axes3D
import wx
class CanvasFrame(wx.Frame):
 def __init__(self):
 wx.Frame.__init__(self,None,-1,
 'CanvasFrame',size=(550,350))
 self.SetBackgroundColour(wx.NamedColor("WHITE"))
 self.figure = Figure()
 self.axes = Axes3D(self.figure)
 
 xs = np.random.rand(100)
 ys = np.random.rand(100)
 zs = np.random.rand(100)
 self.axes.scatter(xs, ys, zs)
 
 self.canvas = FigureCanvas(self, -1, self.figure)
 self.sizer = wx.BoxSizer(wx.VERTICAL)
 self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
 self.SetSizer(self.sizer)
 self.Fit()
 self.add_toolbar() # comment this out for no toolbar
 def add_toolbar(self):
 self.toolbar = NavigationToolbar2Wx(self.canvas)
 self.toolbar.Realize()
 if wx.Platform == '__WXMAC__':
 # Mac platform (OSX 10.3, MacPython) does not seem to cope with
 # having a toolbar in a sizer. This work-around gets the buttons
 # back, but at the expense of having the toolbar at the top
 self.SetToolBar(self.toolbar)
 else:
 # On Windows platform, default window size is incorrect, so set
 # toolbar width to figure width.
 tw, th = self.toolbar.GetSizeTuple()
 fw, fh = self.canvas.GetSizeTuple()
 # By adding toolbar in sizer, we are able to put it at the bottom
 # of the frame - so appearance is closer to GTK version.
 # As noted above, doesn't work for Mac.
 self.toolbar.SetSize(wx.Size(fw, th))
 self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
 # update the axes menu on the toolbar
 self.toolbar.update()
 def OnPaint(self, event):
 self.canvas.draw()
class App(wx.App):
 def OnInit(self):
 'Create the main window and insert the custom frame'
 frame = CanvasFrame()
 frame.Show(True)
 return True
app = App(0)
app.MainLoop()
#end code
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: David A. <dwa...@su...> - 2010年02月06日 22:52:13
JJ,
Very nice repair, as this works precisely as it should. I use this tool in Matlab all the time when teaching multivariable calculus. 
D.
On Feb 6, 2010, at 2:41 PM, Jae-Joon Lee wrote:
> This is a known bug, and I think I fixed it in the svn. Meanwhile, you
> may use the monkey patching.
> Insert these lines in your script (before you call clabel).
> 
> Regards,
> 
> -JJ
> 
> 
> import matplotlib.blocking_input as blocking_input
> def mouse_event_stop(self, event ):
> blocking_input.BlockingInput.pop(self,-1)
> self.fig.canvas.stop_event_loop()
> def add_click(self, event):
> self.button1(event)
> def pop_click(self, event, index=-1):
> if self.inline:
> pass
> else:
> self.cs.pop_label()
> self.cs.ax.figure.canvas.draw()
> 
> blocking_input.BlockingMouseInput.mouse_event_stop = mouse_event_stop
> blocking_input.BlockingMouseInput.add_click = add_click
> blocking_input.BlockingMouseInput.pop_click = pop_click
> 
> 
> 
> On Sat, Feb 6, 2010 at 2:01 AM, David Arnold <dwa...@su...> wrote:
>> Hi,
>> 
>> I'm trying to get manual labeling of contours to work:
>> 
>> import numpy as np
>> import matplotlib.mlab as mlab
>> import matplotlib.pyplot as plt
>> 
>> delta = 0.025
>> x = np.arange(-3.0, 3.0, delta)
>> y = np.arange(-2.0, 2.0, delta)
>> X, Y = np.meshgrid(x, y)
>> Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
>> Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
>> # difference of Gaussians
>> Z = 10.0 * (Z2 - Z1)
>> 
>> plt.figure()
>> CS = plt.contour(X, Y, Z, 6,
>> linewidths=np.arange(.5, 4, .5),
>> colors=('r', 'green', 'blue', (1,1,0), '#afeeee', '0.5')
>> )
>> plt.clabel(CS, fontsize=9, inline=1, manual=True)
>> plt.title('Crazy lines')
>> 
>> plt.show()
>> 
>> On my macbook, clicking with the touchpad does not seem to work.
>> 
>> Any ideas?
>> 
>> David.
>> 
>> ------------------------------------------------------------------------------
>> The Planet: dedicated and managed hosting, cloud storage, colocation
>> Stay online with enterprise data centers and the best network in the business
>> Choose flexible plans and management services without long-term contracts
>> Personal 24x7 support from experience hosting pros just a phone call away.
>> http://p.sf.net/sfu/theplanet-com
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
From: David A. <dwa...@su...> - 2010年02月06日 22:46:42
Goyo,
Sweet little function. Thanks.
I still feel that a comet routine should be added to matplotlib for the reasons I've delineated.
D.
On Feb 6, 2010, at 1:38 PM, Goyo wrote:
> Hi David,
> 
> El sáb, 06-02-2010 a las 10:21 -0800, David Arnold escribió:
>> Hi Eric,
>> 
>> Matlab has two commands, comet and comet3, that animate the path. They are used as in the following Matlab code:
>> 
>> t=linspace(0,2*pi,2000);
>> x=-sin(t);
>> y=cos(t);
>> comet(x,y)
> 
> You can just write the function:
> 
> import matplotlib.pyplot as plt
> 
> def comet(x, y, fmt='', step=1, **kwargs):
> l, = plt.plot(x, y, fmt, **kwargs)
> num_points = len(x)
> for i in xrange(1, num_points + 1, step):
> l.set_data(x[:i], y[:i])
> plt.draw()
> l.set_data(x, y)
> plt.draw()
> 
> I think this could be better done using animation features of
> matplotlib, but I never used them and I think they varies across
> toolkits. Search the docs for animation examples anyway.
> 
> Goyo
> 
>> 
>> What then happens is the path is drawn "live", as in my python code below.
>> 
>> This is especially useful when teaching parametric equations in calculus. A typical question in that section might be: "find a parametrization for the unit circle that starts at (0,1) and moves around the circle one time in the counterclockwise direction." In this situation, the following is not helpful:
>> 
>> t=linspace(0,2*pi,2000);
>> x=-sin(t);
>> y=cos(t);
>> plot(x,y)
>> 
>> Because the student just sees sees the "finished" path. The comet command, on the other hand, allows the student to "see" that path as it is traced out in real time.
>> 
>> David.
>> 
>> On Feb 6, 2010, at 9:09 AM, Eric Firing wrote:
>> 
>>> David Arnold wrote:
>>>> All,
>>>> I am still wondering why there is no comet command in matplotlib. I was successful with the following:
>>>> import matplotlib.pyplot as plt
>>>> import numpy as np
>>>> len=200
>>>> t=np.linspace(0,2*np.pi,len)
>>>> x=np.cos(t)
>>>> y=np.sin(t)
>>>> xd=[x[0]]
>>>> yd=[y[0]]
>>>> l,=plt.plot(xd,yd)
>>>> plt.axis([-1,1,-1,1])
>>>> for i in np.arange(1,len):
>>>> 	xd.append(x[i])
>>>> 	yd.append(y[i])
>>>> 	l.set_xdata(xd)
>>>> 	l.set_ydata(yd)
>>>> 	plt.draw()
>>>> 	
>>>> plt.show()
>>>> But it seems that a comet function added to the matplotlib library would greatly simplify things for students using the interactive pylab in ipython.
>>> 
>>> I don't understand--what's the point of the example? What is "comet", and how does it simplify anything?
>>> 
>>> Eric
>>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> The Planet: dedicated and managed hosting, cloud storage, colocation
>> Stay online with enterprise data centers and the best network in the business
>> Choose flexible plans and management services without long-term contracts
>> Personal 24x7 support from experience hosting pros just a phone call away.
>> http://p.sf.net/sfu/theplanet-com
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> 
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jae-Joon L. <lee...@gm...> - 2010年02月06日 22:42:12
This is a known bug, and I think I fixed it in the svn. Meanwhile, you
may use the monkey patching.
Insert these lines in your script (before you call clabel).
Regards,
-JJ
import matplotlib.blocking_input as blocking_input
def mouse_event_stop(self, event ):
 blocking_input.BlockingInput.pop(self,-1)
 self.fig.canvas.stop_event_loop()
def add_click(self, event):
 self.button1(event)
def pop_click(self, event, index=-1):
 if self.inline:
 pass
 else:
 self.cs.pop_label()
 self.cs.ax.figure.canvas.draw()
blocking_input.BlockingMouseInput.mouse_event_stop = mouse_event_stop
blocking_input.BlockingMouseInput.add_click = add_click
blocking_input.BlockingMouseInput.pop_click = pop_click
On Sat, Feb 6, 2010 at 2:01 AM, David Arnold <dwa...@su...> wrote:
> Hi,
>
> I'm trying to get manual labeling of contours to work:
>
> import numpy as np
> import matplotlib.mlab as mlab
> import matplotlib.pyplot as plt
>
> delta = 0.025
> x = np.arange(-3.0, 3.0, delta)
> y = np.arange(-2.0, 2.0, delta)
> X, Y = np.meshgrid(x, y)
> Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
> Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
> # difference of Gaussians
> Z = 10.0 * (Z2 - Z1)
>
> plt.figure()
> CS = plt.contour(X, Y, Z, 6,
>         linewidths=np.arange(.5, 4, .5),
>         colors=('r', 'green', 'blue', (1,1,0), '#afeeee', '0.5')
>         )
> plt.clabel(CS, fontsize=9, inline=1, manual=True)
> plt.title('Crazy lines')
>
> plt.show()
>
> On my macbook, clicking with the touchpad does not seem to work.
>
> Any ideas?
>
> David.
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: James C. <clo...@jh...> - 2010年02月06日 22:07:22
>>>>> "M" == Matthias Michler <Mat...@gm...> writes:
M> I'm sorry, I'm not an expert in eps-graphics. For me the final pics
M> look good and I have no idea what is different between matplotlib
M> eps-files and eps-files generated somewhere else.
Based exclusively on the eps you posted in this thread, MPL took a ttf
font (Bitstream Vera Sans) and created a PostSctipt Type3 font from it,
rather than embedding the original font as a Type42 font. It is still
a vector font, but one which only PS interpreters can rasterize.
The OP's downstream seems to want the fonts to be in a format (such as
Type1, TTF (which is embedded in PostScipt as Type42) or CFF (which is
converted to Type1 when embedded in PostScript)) which their tools can
understand, replace, et cetera.
If one were to edit the eps in a text editor, and replace the Type3 w/
a Type42 of the original TTF, I suspect the OP's downstream might find
the eps more to its liking.
Ttftotype42 from <http://www.lcdf.org/type/> can convert TTF to Type42.
-JimC
-- 
James Cloos <cl...@jh...> OpenPGP: 1024D/ED7DAEA6
From: Goyo <goy...@gm...> - 2010年02月06日 21:38:33
Hi David,
El sáb, 06-02-2010 a las 10:21 -0800, David Arnold escribió:
> Hi Eric,
> 
> Matlab has two commands, comet and comet3, that animate the path. They are used as in the following Matlab code:
> 
> t=linspace(0,2*pi,2000);
> x=-sin(t);
> y=cos(t);
> comet(x,y)
You can just write the function:
import matplotlib.pyplot as plt
def comet(x, y, fmt='', step=1, **kwargs):
 l, = plt.plot(x, y, fmt, **kwargs)
 num_points = len(x)
 for i in xrange(1, num_points + 1, step):
 l.set_data(x[:i], y[:i])
 plt.draw()
 l.set_data(x, y)
 plt.draw()
I think this could be better done using animation features of
matplotlib, but I never used them and I think they varies across
toolkits. Search the docs for animation examples anyway.
Goyo
> 
> What then happens is the path is drawn "live", as in my python code below.
> 
> This is especially useful when teaching parametric equations in calculus. A typical question in that section might be: "find a parametrization for the unit circle that starts at (0,1) and moves around the circle one time in the counterclockwise direction." In this situation, the following is not helpful:
> 
> t=linspace(0,2*pi,2000);
> x=-sin(t);
> y=cos(t);
> plot(x,y)
> 
> Because the student just sees sees the "finished" path. The comet command, on the other hand, allows the student to "see" that path as it is traced out in real time.
> 
> David.
> 
> On Feb 6, 2010, at 9:09 AM, Eric Firing wrote:
> 
> > David Arnold wrote:
> >> All,
> >> I am still wondering why there is no comet command in matplotlib. I was successful with the following:
> >> import matplotlib.pyplot as plt
> >> import numpy as np
> >> len=200
> >> t=np.linspace(0,2*np.pi,len)
> >> x=np.cos(t)
> >> y=np.sin(t)
> >> xd=[x[0]]
> >> yd=[y[0]]
> >> l,=plt.plot(xd,yd)
> >> plt.axis([-1,1,-1,1])
> >> for i in np.arange(1,len):
> >> 	xd.append(x[i])
> >> 	yd.append(y[i])
> >> 	l.set_xdata(xd)
> >> 	l.set_ydata(yd)
> >> 	plt.draw()
> >> 	
> >> plt.show()
> >> But it seems that a comet function added to the matplotlib library would greatly simplify things for students using the interactive pylab in ipython.
> > 
> > I don't understand--what's the point of the example? What is "comet", and how does it simplify anything?
> > 
> > Eric
> > 
> 
> 
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Pierre R. <co...@py...> - 2010年02月06日 21:13:56
2010年2月6日 Gael Varoquaux <gae...@no...>:
> On Sat, Feb 06, 2010 at 11:27:50AM +0100, Pierre Raybaut wrote:
> When you start having a somewhat complex set of functions that call
> each other, or when you are getting failures with somebody else's code,
> this is priceless. This is so useful that to debug some code that, when I
> am trying to understand why some code is not working the way it should
> be, I will purposely add an exception, to be able to introspect the code.
> Granted, adding pdb.set_trace() will work without IPython[*], but I find
> it very useful.
>
> [*] It will not work in Spyder as it is quite challenging to have these
> features requiring user terminal interaction in a GUI.
Actually it works in Spyder too (in the external console which is
executed in a another process).
;-)
-Pierre
From: Ted K. <ted...@go...> - 2010年02月06日 21:09:49
Hi
I'd like to generate a surface plot using mplot3d. However, Z is not a
function of X and/or Y. It's just a set of scalar values. So, the following
doesn't work:
X = np.arange(2, 102, 2)
Y = np.arange(0, 15.15, 0.15)
X, Y = np.meshgrid(X, Y)
Z = f[2]
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet)
Is there a way that I can do this?
Thank you.
Ted
From: Ted K. <ted...@go...> - 2010年02月06日 21:05:33
Hi
I'd like to generate a surface plot using mplot3d. However, Z is not a
function of X and/or Y. It's just a set of scalar values. So, the following
doesn't work:
X = np.arange(2, 102, 2)
Y = np.arange(0, 15.15, 0.15)
X, Y = np.meshgrid(X, Y)
Z = f[2]
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet)
Is there a way that I can do this?
Thank you.
Ted
From: Wayne W. <sie...@sb...> - 2010年02月06日 19:35:33
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
I can write&nbsp; some fairly decent Python code. In fact, I've&nbsp; recently
written 400-500 lines often using numpy. There are still a number of
concepts that are fuzzy. I have a modest familiarity of OOP from years
ago with C++, and a few things I've picked up from Python. Five years
ago, I was working with Matlab, but my knowledge&nbsp; has diminished. <br>
<br>
Nevertheless, I finally decided to graphics, MPL, to display what I'm
doing. I've&nbsp; had some modest success using very basic operations,
sometime guessing at usage along the way. I've looked through the
bewildering array of MPL, pylab,&nbsp; pyplot docs and examples.&nbsp; It's&nbsp;
slowly fitting together. I decided to give the following web page a
closer look to see what are the differences between the MPL players.
<a class="moz-txt-link-rfc2396E" href="http://matplotlib.sourceforge.net/faq/usage_faq.html">&lt;http://matplotlib.sourceforge.net/faq/usage_faq.html&gt;</a>. I've
copied a few paragraphs at the start of the FAQ below.<br>
<br>
I've studied it fairly carefully, and more or less comprehend it.
However, why does it need words like state-machine, convenience
functions, and object-oriented. I'm familiar with them all, but the
concepts really aren't presented clearly in relationship to the code
below. I'm not even sure if we are&nbsp; pro-pylab or&nbsp; pyplot as the
preferred-style. What part of some of the code is pyplot or otherwise?
Highlight it. Not everyone is clear on some of the assumed Python
concepts here.<br>
<br>
It seems as though Python has a way of aligning itself with other
tools, For example, Matlab and Tk. Despite the apparent appeal of MPL
and Tkinter, seldom, maybe&nbsp; never, is anyone who is attracted to these
ideas really familiar with the tools on which they are based. (Perhaps
its the other way. Everyone knows them )Yet&nbsp; no explanation is
offered.&nbsp; What would that take, 3 pages each? <br>
<br>
============================================<br>
<h2>Matplotlib, pylab, and pyplot: how are they related?<a
 class="headerlink"
 href="http://matplotlib.sourceforge.net/faq/usage_faq.html#matplotlib-pylab-and-pyplot-how-are-they-related"
 title="Permalink to this headline">&para;</a></h2>
<p>Matplotlib is the whole package; <tt class="xref docutils literal"><span
 class="pre">pylab</span></tt> is a module in matplotlib
that gets
installed alongside <a title="" class="reference external"
 href="http://matplotlib.sourceforge.net/api/matplotlib_configuration_api.html#module-matplotlib"><tt
 class="xref docutils literal"><span class="pre">matplotlib</span></tt></a>;
and <a title="" class="reference external"
 href="http://matplotlib.sourceforge.net/api/pyplot_api.html#module-matplotlib.pyplot"><tt
 class="xref docutils literal"><span class="pre">matplotlib.pyplot</span></tt></a>
is a
module in matplotlib.</p>
<p>Pyplot provides a Matlab-style state-machine interface to
the underlying object-oriented plotting library in matplotlib.</p>
<p>Pylab combines the pyplot functionality (for plotting) with the
numpy
functionality (for mathematics and for working with arrays)
in a single namespace, making that namespace
(or environment) even more Matlab-like. This is what you get if
you use the
<em>ipython</em> shell with the <em>-pylab</em> option, which imports
everything
from pylab and makes plotting fully interactive.<br>
</p>
<p>...<br>
</p>
<p>And using pyplot convenience functions, but object-orientation for
the rest:</p>
<div class="highlight-python">
<div class="highlight">
<pre><span class="k">import</span> <span class="nn">matplotlib.pyplot</span> <span
 class="k">as</span> <span class="nn">plt</span>
<span class="k">import</span> <span class="nn">numpy</span> <span
 class="k">as</span> <span class="nn">np</span>
<span class="n">x</span> <span class="o">=</span> <span class="n">np</span><span
 class="o">.</span><span class="n">arange</span><span class="p">(</span><span
 class="mf">0</span><span class="p">,</span> <span class="mf">10</span><span
 class="p">,</span> <span class="mf">0.2</span><span class="p">)</span>
<span class="n">y</span> <span class="o">=</span> <span class="n">np</span><span
 class="o">.</span><span class="n">sin</span><span class="p">(</span><span
 class="n">x</span><span class="p">)</span>
<span class="n">fig</span> <span class="o">=</span> <span class="n">plt</span><span
 class="o">.</span><span class="n">figure</span><span class="p">()</span>
<span class="n">ax</span> <span class="o">=</span> <span class="n">fig</span><span
 class="o">.</span><span class="n">add_subplot</span><span class="p">(</span><span
 class="mf">111</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span
 class="p">(</span><span class="n">x</span><span class="p">,</span> <span
 class="n">y</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">show</span><span
 class="p">()</span>
</pre>
</div>
</div>
So, why do all the extra typing required as one moves away from...<br>
=========================<br>
<p><br>
</p>
<br>
<div class="moz-signature">-- <br>
My life in two words. "Interrupted Projects." -- WTW (quote originator)</div>
</body>
</html>
From: David A. <dwa...@su...> - 2010年02月06日 18:21:22
Hi Eric,
Matlab has two commands, comet and comet3, that animate the path. They are used as in the following Matlab code:
t=linspace(0,2*pi,2000);
x=-sin(t);
y=cos(t);
comet(x,y)
What then happens is the path is drawn "live", as in my python code below.
This is especially useful when teaching parametric equations in calculus. A typical question in that section might be: "find a parametrization for the unit circle that starts at (0,1) and moves around the circle one time in the counterclockwise direction." In this situation, the following is not helpful:
t=linspace(0,2*pi,2000);
x=-sin(t);
y=cos(t);
plot(x,y)
Because the student just sees sees the "finished" path. The comet command, on the other hand, allows the student to "see" that path as it is traced out in real time.
David.
On Feb 6, 2010, at 9:09 AM, Eric Firing wrote:
> David Arnold wrote:
>> All,
>> I am still wondering why there is no comet command in matplotlib. I was successful with the following:
>> import matplotlib.pyplot as plt
>> import numpy as np
>> len=200
>> t=np.linspace(0,2*np.pi,len)
>> x=np.cos(t)
>> y=np.sin(t)
>> xd=[x[0]]
>> yd=[y[0]]
>> l,=plt.plot(xd,yd)
>> plt.axis([-1,1,-1,1])
>> for i in np.arange(1,len):
>> 	xd.append(x[i])
>> 	yd.append(y[i])
>> 	l.set_xdata(xd)
>> 	l.set_ydata(yd)
>> 	plt.draw()
>> 	
>> plt.show()
>> But it seems that a comet function added to the matplotlib library would greatly simplify things for students using the interactive pylab in ipython.
> 
> I don't understand--what's the point of the example? What is "comet", and how does it simplify anything?
> 
> Eric
> 
From: Eric F. <ef...@ha...> - 2010年02月06日 17:09:53
David Arnold wrote:
> All,
> 
> I am still wondering why there is no comet command in matplotlib. 
> 
> I was successful with the following:
> 
> import matplotlib.pyplot as plt
> import numpy as np
> 
> len=200
> t=np.linspace(0,2*np.pi,len)
> x=np.cos(t)
> y=np.sin(t)
> xd=[x[0]]
> yd=[y[0]]
> l,=plt.plot(xd,yd)
> plt.axis([-1,1,-1,1])
> 
> for i in np.arange(1,len):
> 	xd.append(x[i])
> 	yd.append(y[i])
> 	l.set_xdata(xd)
> 	l.set_ydata(yd)
> 	plt.draw()
> 	
> plt.show()
> 
> 
> But it seems that a comet function added to the matplotlib library would greatly simplify things for students using the interactive pylab in ipython.
> 
I don't understand--what's the point of the example? What is "comet", 
and how does it simplify anything?
Eric
From: Gael V. <gae...@no...> - 2010年02月06日 15:55:55
On Sat, Feb 06, 2010 at 11:27:50AM +0100, Pierre Raybaut wrote:
> > Why not? I use Ipython on OS-X all the time, and it is fabulous, really 
> > fabulous.
> >> > Also, I would rather stick with IDLE. It is the perfect IDE for
> >> > non-CS students who shouldn't be spending their time on the
> >> > complexities of a plotting package.
> > Spyder:
> > http://packages.python.org/spyder/
> > Looks really promising, but I don't think they've got OS-X packages yet.
> > [snip]
I'd like to pitch here the reason why I think there is a huge gain in
using IPython, because I think that not everybody realizes this.
For me, the killing feature is '%debug'. It enables you to drop in the
debugger post mortem. That means that if there is an exception raised
during a calculation, I can drop right where the exception occurred and
inspect the variables there. I can for instance check if a numpy array
has NaNs, and if so where they are, or if a matrix that is supposed to be
symmetric really is. I can also go up the call stack, and see what the
variables are at each level of function calls. Here is a trivial example:
In [1]: def f(x, y=0):
 ...: z = x+y
 ...: return 1/z
 ...: 
In [2]: f(0)
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call
last)
/home/varoquau/<ipython console> in <module>()
/home/varoquau/<ipython console> in f(x, y)
ZeroDivisionError: integer division or modulo by zero
In [3]: %debug
> <ipython console>(3)f()
ipdb> print x
0
ipdb> print y
0
ipdb> print z
0
ipdb> 
Jose Unpinco has written a nice video introducing these features:
http://showmedo.com/videotutorials/video?name=7200060&fromSeriesID=720
When you start having a somewhat complex set of functions that call
each other, or when you are getting failures with somebody else's code,
this is priceless. This is so useful that to debug some code that, when I
am trying to understand why some code is not working the way it should
be, I will purposely add an exception, to be able to introspect the code.
Granted, adding pdb.set_trace() will work without IPython[*], but I find
it very useful.
I am to the point where the post-mortem debugging of IPython may be the
killing feature of Python that I lack with every other work flow. The
reason being that I develop data processing code, and that I am always
experiment and trying to implement new algorithms. As a result, my code
is seldom mature, and I often spend time tracking down where bugs lie.
Also, running my various processing steps take a while. This is why I
rely a lot on post-mortem: I find bugs after minutes or hours of number
crunching, and I want to be as efficient as possible. Post-portem enables
me not to restart the script that crashed.
My 2 cents,
Gaël
[*] It will not work in Spyder as it is quite challenging to have these
features requiring user terminal interaction in a GUI.
From: Christoph G. <cg...@uc...> - 2010年02月06日 12:53:19
Depending on the version and installer used, manually remove
C:\Python25\Lib\site-packages\pylab.py
C:\Python25\Lib\site-packages\matplotlib
C:\Python25\Lib\site-packages\mpl_toolkits
C:\Python25\Lib\site-packages\matplotlib*.egg-info
C:\Python25\Removematplotlib.exe
C:\Python25\matplotlib-wininst.log
The packages dateutil and pytz are also installed along with matplotlib
but might be used by other packages too.
Christoph
On 2/5/2010 12:11 PM, Wayne Watson wrote:
> I'm working in IDLE in Win7. It seems to me it gets stuck in 
> site-packages under C:\Python25. Maybe this is as simple as deleting the 
> entry?
> 
> Well, yes there's a MPL folder under site-packages and an info MPL file 
> of 540 bytes. There are also pylab.py, pyc,and py0 files under site. 
> What to do next?
> 
> On 2/5/2010 7:13 AM, Wayne Watson wrote:
>> I should have installed numpy first, and got some errors installing
>> MPL. I don't see an uninstall in Control Panel Add/Rmv.
>> 
> 
From: Pierre R. <co...@py...> - 2010年02月06日 10:27:26
>
> Date: 2010年2月05日 12:59:41 -0800 From: Christopher Barker 
> <Chr...@no...> Subject: Re: [Matplotlib-users] Matplotlib 
> conflicts with IDLE To: mat...@li... 
> Message-ID: <4B6...@no...> Content-Type: text/plain; 
> charset=ISO-8859-1; format=flowed David MacQuigg wrote:
>> > I can't get Matplotlib to work with IDLE. 
>> 
>
> Sorry, I don't know anything about IDLE, but...
>
> 
>> > I'm running on Mac OS-X, so it looks like IPython is not an option.
>> 
>
> Why not? I use Ipython on OS-X all the time, and it is fabulous, really 
> fabulous.
>
> 
>> > Also, I
>> > would rather stick with IDLE. It is the perfect IDE for non-CS students who
>> > shouldn't be spending their time on the complexities of a plotting package.
>> 
>
> Spyder:
>
> http://packages.python.org/spyder/
>
> Looks really promising, but I don't think they've got OS-X packages yet.
>
> -Chris
> 
Hi there,
I can confirm that Spyder will make these GUI event loop issues go away 
(BTW I saw it running on OS-X, 2 days ago -- note that it requires PyQt 
to be installed). If you are familiar with MATLAB's IDE, you won't be 
disappointed because it works almost the same way (it even communicates 
well with MATLAB thanks to .mat files import/export features).
The great advantage of Spyder over other Python IDEs is the exclusive 
"Workspace" feature: like MATLAB's workspace, that is a global variable 
explorer allowing GUI-based edition of the most used Python objects 
(integers, floats, strings, dictionaries, lists, NumPy arrays, ...). It 
seems unbelievable, but Spyder is really the only IDE providing this 
feature which is IMHO essential for scientific users.
Cheers,
Pierre
From: David A. <dwa...@su...> - 2010年02月06日 07:11:31
All,
I am still wondering why there is no comet command in matplotlib. 
I was successful with the following:
import matplotlib.pyplot as plt
import numpy as np
len=200
t=np.linspace(0,2*np.pi,len)
x=np.cos(t)
y=np.sin(t)
xd=[x[0]]
yd=[y[0]]
l,=plt.plot(xd,yd)
plt.axis([-1,1,-1,1])
for i in np.arange(1,len):
	xd.append(x[i])
	yd.append(y[i])
	l.set_xdata(xd)
	l.set_ydata(yd)
	plt.draw()
	
plt.show()
But it seems that a comet function added to the matplotlib library would greatly simplify things for students using the interactive pylab in ipython.
Any plans?
David
37 messages has been excluded from this view by a project administrator.

Showing results of 620

<< < 1 .. 20 21 22 23 24 25 > >> (Page 22 of 25)
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 によって変換されたページ (->オリジナル) /