You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
|
1
|
2
(2) |
3
(16) |
4
(22) |
5
(7) |
6
|
7
(9) |
8
(2) |
9
|
10
(7) |
11
(15) |
12
(7) |
13
(4) |
14
(7) |
15
(3) |
16
(6) |
17
(20) |
18
(18) |
19
(15) |
20
(27) |
21
(14) |
22
|
23
(1) |
24
(18) |
25
(22) |
26
(36) |
27
(17) |
28
(6) |
29
(2) |
30
(3) |
31
(6) |
|
|
|
|
|
Hi, I'm trying to remove or delete an annotate arrow but I'm unsuccessful. Can some please help? Thanks. I tried the [artist].remove() but that will not work with arrows or annotate objects... Here is some example code, please add in the code I need if you can: import numpy as np import matplotlib.pyplot as plt t = np.arange(0, np.pi*2, 0.01) x = np.sin(2*np.pi*t) fig = plt.figure() myplot = ax.plot(t, x, 'b') arrow = ax. annotate('my arrow', xy=(3, -0.5), xycoords='data', horizontalalignment='center', verticalalignment='center', color='red', alpha=0.5, xytext=(0, -2), textcoords='offset points', arrowprops=dict(facecolor='red', frac=0.4, shrink = 0.05, alpha=0.5, width=2, headwidth=5), ) #Code to remove arrow... # arrow.remove() #this does not work... plt.show() ----- Krishna Adrianto Pribadi Test Engineer Harley-Davidson Motor Co. Talladega Test Facility Vehicle Test Stands -- View this message in context: http://old.nabble.com/remove---delete-arrow---annotate%2C-how-to--tp28451836p28451836.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On 05/03/2010 11:45 PM, Kun Hong wrote: > Eric, > > Thanks a lot for the pointers. Sorry for the double posting. > > I tried fill_between, which works better than bar graph. > But I need to change the data set to be able to get the filling > into a nicely-formed rectangle, and the performance is still not very good. > > As the below example shows: > > import matplotlib.mlab as mlab > from matplotlib.pyplot import figure, show > import numpy as np > > x1 = np.arange(0.0, 10000.0, 0.1) > y1 = np.sin(2*np.pi*x1) > > fig = figure() > ax1 = fig.add_subplot(111) > > x = [] > for i in x1: > x += [i-0.05, i-0.05, i, i+0.05, i+0.05] > > y = [] > for i in y1: > y += [0, i, i, i, 0] > > ax1.fill_between(x, 0, y) > > > > I have also tried step, but it doesn't seem to be able > to fill the rectangular area. Am I missing something? > Given that you want filled regions, step won't help. It might make sense to make the step logic available to fill_between, but this has not been done yet. I don't understand what you really want, though; your code above is trying to plot 100,000 bars. Your screen probably has fewer than 2000 pixels width. You can print with higher resolution than that, but if you are making plots for printing, usually the performance is not such an issue--and even then, I don't think that packing 100,000 bars onto a sheet of paper is going to be very useful. Eric > Kun >
On Tue, May 4, 2010 at 10:58 AM, Gökhan Sever <gok...@gm...> wrote: > > > On Mon, May 3, 2010 at 4:02 PM, Darren Dale <dsd...@gm...> wrote: >> >> I got a suggestion at the PyQt4 mailing list, and the following patch >> appears to resolve the problem. >> >> Darren >> > > Thanks Darren. > > Your patch fixes the wrong sized figure creation problem. Both for WXAgg and > Qt4Agg the maximum figure size is limited with the physical screen > dimensions, right? Just out of curiosity I am asking this. I don't see any > scroll-bars appearing if one figure dimension is bigger than screen's. The change was committed in svn 8294. No, the figure windows are not designed to include scrollbars if the canvas is bigger than the window will allow. I don't think such a feature would be compatible with the current ability to resize a canvas by resizing the figure window. Darren
Pim Schellart wrote: > Hi Everyone, > > I am currently building an interactive display using matplotlib but I > need the following two options. > 1. Setting the r axis of a polar plot to logaritmic scale. > axis.set_rscale('log') > 2. Setting alpha for each point individually (preferably by giving > alpha an array of the same length as the data containing a value > between zero and one). > Is this currently possible and if not which alternative approach do > you recommend. > You can't give alpha an array, but you can create an Nx4 RGBA array (which will let you control the color individually, too). For example: r = np.arange(0, 3.0, 0.01) theta = 2*np.pi*r c = np.zeros((len(r), 4)) c[:,0:3] = (1, 0, 0) # red c[:,3] = np.arange(0, 1.0, 1.0 / len(r)) ax.scatter(theta, r, c=c, lw=0) > The display needs to plot about a thousand points (using scatter at > the moment) roughly updating every second with older points fading > away (lower value of alpha). > Scatter is pretty heavily optimized in the *Agg backends, but not so much in the others. Make sure you are using Agg and IIRC this level of performance should be possible (depending on machine etc., of course). Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hi Everyone, I am currently building an interactive display using matplotlib but I need the following two options. 1. Setting the r axis of a polar plot to logaritmic scale. 2. Setting alpha for each point individually (preferably by giving alpha an array of the same length as the data containing a value between zero and one). Is this currently possible and if not which alternative approach do you recommend. The display needs to plot about a thousand points (using scatter at the moment) roughly updating every second with older points fading away (lower value of alpha). Kind regards, Pim Schellart
On Mon, May 3, 2010 at 4:02 PM, Darren Dale <dsd...@gm...> wrote: > > I got a suggestion at the PyQt4 mailing list, and the following patch > appears to resolve the problem. > > Darren > > Thanks Darren. Your patch fixes the wrong sized figure creation problem. Both for WXAgg and Qt4Agg the maximum figure size is limited with the physical screen dimensions, right? Just out of curiosity I am asking this. I don't see any scroll-bars appearing if one figure dimension is bigger than screen's. -- Gökhan
Eric, Thanks a lot for the pointers. Sorry for the double posting. I tried fill_between, which works better than bar graph. But I need to change the data set to be able to get the filling into a nicely-formed rectangle, and the performance is still not very good. As the below example shows: import matplotlib.mlab as mlab from matplotlib.pyplot import figure, show import numpy as np x1 = np.arange(0.0, 10000.0, 0.1) y1 = np.sin(2*np.pi*x1) fig = figure() ax1 = fig.add_subplot(111) x = [] for i in x1: x += [i-0.05, i-0.05, i, i+0.05, i+0.05] y = [] for i in y1: y += [0, i, i, i, 0] ax1.fill_between(x, 0, y) I have also tried step, but it doesn't seem to be able to fill the rectangular area. Am I missing something? Kun Eric Firing wrote: > On 05/02/2010 05:48 PM, Kun Hong wrote: > >> Hi, >> >> I am new to matplotlib. So if I ask sth stupid, please bear with me. >> >> I am using matplotlib to present large data set in different graph >> types, >> bar, dot, line, etc. I find that the bar graph has very bad performance. >> Say, I draw data points of about ten thousand. Using dot graph, it draws >> in a second. But using bar graph, it draws in tens of seconds. >> >> I was wondering what causes this difference. Is there a way to improve >> the >> bar graph performace? (Maybe I am not drawing it right, then, please >> give >> me a pointer) >> >> > > Also check out step(). > http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.step > > Eric > >
Hello! Is it possible with the matplotlib basemap tool to draw locations of interest on my own map e.g. a Garmin Image Map File File? Thanks in advance! Stefanie
2010年05月04日 04:13, Joe Kington skrev: > Isn't that what quiver > <http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.quiver> > does? Or am I misunderstanding the question? Regardless of the OPs question, the quiver seems to be the solution I should use for my purpose. Thanks. / Johan
I don't think that plots a vector. Here's the sort of thing I was looking for: http://www.mathworks.com/matlabcentral/fx_files/23608/1/content/html/drawLAInro_02.png Of course it doesn't need to be a point...it can be a line or a line segment too. Adit On Mon, May 3, 2010 at 9:13 PM, Joe Kington <jki...@wi...> wrote: > Isn't that what quiver<http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.quiver>does? Or am I misunderstanding the question? > > 2010年5月3日 aditya bhargava <blu...@gm...> > >> Thanks Johan and Matthias, >> I was just wondering if there was a built-in way to do this in matplotlib. >> It seems like it would be a useful method to have. >> >> Adit >> >> >> 2010年5月3日 Johan Grönqvist <joh...@gm...> >> >> 2010年05月02日 20:19, aditya bhargava skrev: >>> > Is there a straightforward way of plotting a vector in matplotlib? >>> > Suppose I want to plot the vector [1 2]'. If I pass this vector in to >>> > plot(), I get the line that passes through (0,1), (1,2). Instead I want >>> > the line that passes through (0,0),(1,2). >>> > >>> >>> I use pyplot.Arrow to visualize displacement fields. >>> >>> This is a snippet copied from the code I use (it sits in a loop over all >>> vectors I want to plot): >>> >>> >>> arr = plt.Arrow(x, y, dx, dy) >>> plt.gca().add_patch(arr) >>> >>> In your case, you would have (x, y) = (0, 0) and (dx, dy) = (1, 2). >>> >>> Regards >>> >>> Johan >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> >> >> >> -- >> wefoundland.com >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > -- wefoundland.com
Isn't that what quiver<http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.quiver>does? Or am I misunderstanding the question? 2010年5月3日 aditya bhargava <blu...@gm...> > Thanks Johan and Matthias, > I was just wondering if there was a built-in way to do this in matplotlib. > It seems like it would be a useful method to have. > > Adit > > > 2010年5月3日 Johan Grönqvist <joh...@gm...> > > 2010年05月02日 20:19, aditya bhargava skrev: >> > Is there a straightforward way of plotting a vector in matplotlib? >> > Suppose I want to plot the vector [1 2]'. If I pass this vector in to >> > plot(), I get the line that passes through (0,1), (1,2). Instead I want >> > the line that passes through (0,0),(1,2). >> > >> >> I use pyplot.Arrow to visualize displacement fields. >> >> This is a snippet copied from the code I use (it sits in a loop over all >> vectors I want to plot): >> >> >> arr = plt.Arrow(x, y, dx, dy) >> plt.gca().add_patch(arr) >> >> In your case, you would have (x, y) = (0, 0) and (dx, dy) = (1, 2). >> >> Regards >> >> Johan >> >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > > -- > wefoundland.com > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Thanks Johan and Matthias, I was just wondering if there was a built-in way to do this in matplotlib. It seems like it would be a useful method to have. Adit 2010年5月3日 Johan Grönqvist <joh...@gm...> > 2010年05月02日 20:19, aditya bhargava skrev: > > Is there a straightforward way of plotting a vector in matplotlib? > > Suppose I want to plot the vector [1 2]'. If I pass this vector in to > > plot(), I get the line that passes through (0,1), (1,2). Instead I want > > the line that passes through (0,0),(1,2). > > > > I use pyplot.Arrow to visualize displacement fields. > > This is a snippet copied from the code I use (it sits in a loop over all > vectors I want to plot): > > > arr = plt.Arrow(x, y, dx, dy) > plt.gca().add_patch(arr) > > In your case, you would have (x, y) = (0, 0) and (dx, dy) = (1, 2). > > Regards > > Johan > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- wefoundland.com
Hi Stefan, > I've hit a problem when using the button_press_event to pop up a > wx.MessageBox. After the messagebox is loaded the mouse becomes completely > unresponsive (even outside the application) until the application is shut > down (by using ALT+F4). I'm making a feature where the user, after right > clicking on the figure (after doing some manipulations etc), are requested > to answer a question in a message box. > > This problem seems only to occur on Linux.. > > Am I doing something wrong or is this a bug? > > I've attached the source that demonstrates the problem. Oddly, I saw very similar behavior recently (I didn't see the attachment...). What I found was that the canvas was still responsive, but that it "stole" the mouse from any other window (wx widgets or system widgets) and that this happened on Linux but not Windows. I believe that adding self.ReleaseMouse() at the end of the event handler will alleviate this problem. It might be best to do (assuming you bound mouse events with the Canvas.mpl_connect() ) to do evt.guiEvent.Skip() if self.HasCapture(): self.ReleaseMouse() I haven't fully explored this problem myself, but I am no longer experiencing it... Cheers, --Matt Newville <newville at cars.uchicago.edu>
On Mon, May 3, 2010 at 4:02 PM, Darren Dale <dsd...@gm...> wrote: > On Sun, Apr 18, 2010 at 12:55 PM, Gökhan Sever <gok...@gm...> wrote: >> >> >> On Sun, Apr 18, 2010 at 11:47 AM, Darren Dale <dsd...@gm...> wrote: >>> >>> On Tue, Apr 13, 2010 at 8:14 PM, Gökhan Sever <gok...@gm...> >>> wrote: >>> > Hello, >>> > >>> > Could someone confirm me if there is any malfunctioning using these >>> > simple >>> > figure functions? >>> > >>> > plt.figure(figsize=(2,3)) >>> > >>> > plt.figure(figsize=(5,6)) >>> > >>> > plt.figure(figsize=(9,15)) >>> > >>> > plt.figure(figsize=(19,5)) >>> > >>> > For some reason I can't get Qt4Agg creating last two figures in >>> > specified >>> > sizes. (WXAgg works fine.) >>> > >>> > matplotlib.__version__ >>> > '1.0.svn' >>> > >>> > matplotlib.__revision__ >>> > '$Revision: 8226 $' >>> > >>> > from PyQt4 import QtCore >>> > QtCore.PYQT_VERSION_STR >>> > '4.7' >>> >>> I can reproduce this behavior with a pure pyqt4 example with no mpl >>> code, see below. I asked for advice on the pyqt mailing list. >>> >>> import sys >>> from PyQt4 import QtCore, QtGui >>> >>> class Test(QtGui.QWidget): >>> >>> def __init__(self, width, height): >>> QtGui.QWidget.__init__(self) >>> #self.setSizePolicy(QtGui.QSizePolicy.Fixed, >>> QtGui.QSizePolicy.Fixed) >>> print 'Central widget should have width=%d, height=%d' %(width, >>> height) >>> self._width = width >>> self._height = height >>> >>> def sizeHint(self): >>> return QtCore.QSize(self._width, self._height) >>> >>> app = QtGui.QApplication([]) >>> m = QtGui.QMainWindow() >>> c = Test(1000, 700) >>> m.setCentralWidget(c) >>> m.show() >>> s = c.size() >>> print 'but central widget has width=%d, height=%d'% (s.width(), >>> s.height()) >>> sys.exit(app.exec_()) >> >> Same here with your sample: >> >> Central widget should have width=1000, height=700 >> but central widget has width=960, height=600 >> >> I resorted to WXAgg for the time being. Waiting for some updates till I hear >> a resolution. The annoying part is when I created a plot using specified >> width and height Qt4Agg doesn't follow these dimensions as in this case and >> resulting savefig(file.pdf) produces wrongly sized file unless I manually >> extend the figure area and re-issue a savefig afterwards. > > I got a suggestion at the PyQt4 mailing list, and the following patch > appears to resolve the problem. However, before I commit the change, > I'd like to hear from John or Andrew: What is the protocol for dealing > with a change that may affect unit tests? This shouldn't affects tests I don't think because it is a change to a GUI backend and we are only doing unit tests on hardcopy images at this point. In general, run matplotlib.test > python -c 'import matplotlib; matplotlib.test()' and look to see if any tests are failing. If any are, either fix the problem or if you decide the baseline image is broken update that in lib/matplotlib/tests/baseline_images. There is more in doc/devel/coding_guide.rst under "Testing". Andrew may have more to add... JDH
On Sun, Apr 18, 2010 at 12:55 PM, Gökhan Sever <gok...@gm...> wrote: > > > On Sun, Apr 18, 2010 at 11:47 AM, Darren Dale <dsd...@gm...> wrote: >> >> On Tue, Apr 13, 2010 at 8:14 PM, Gökhan Sever <gok...@gm...> >> wrote: >> > Hello, >> > >> > Could someone confirm me if there is any malfunctioning using these >> > simple >> > figure functions? >> > >> > plt.figure(figsize=(2,3)) >> > >> > plt.figure(figsize=(5,6)) >> > >> > plt.figure(figsize=(9,15)) >> > >> > plt.figure(figsize=(19,5)) >> > >> > For some reason I can't get Qt4Agg creating last two figures in >> > specified >> > sizes. (WXAgg works fine.) >> > >> > matplotlib.__version__ >> > '1.0.svn' >> > >> > matplotlib.__revision__ >> > '$Revision: 8226 $' >> > >> > from PyQt4 import QtCore >> > QtCore.PYQT_VERSION_STR >> > '4.7' >> >> I can reproduce this behavior with a pure pyqt4 example with no mpl >> code, see below. I asked for advice on the pyqt mailing list. >> >> import sys >> from PyQt4 import QtCore, QtGui >> >> class Test(QtGui.QWidget): >> >> def __init__(self, width, height): >> QtGui.QWidget.__init__(self) >> #self.setSizePolicy(QtGui.QSizePolicy.Fixed, >> QtGui.QSizePolicy.Fixed) >> print 'Central widget should have width=%d, height=%d' %(width, >> height) >> self._width = width >> self._height = height >> >> def sizeHint(self): >> return QtCore.QSize(self._width, self._height) >> >> app = QtGui.QApplication([]) >> m = QtGui.QMainWindow() >> c = Test(1000, 700) >> m.setCentralWidget(c) >> m.show() >> s = c.size() >> print 'but central widget has width=%d, height=%d'% (s.width(), >> s.height()) >> sys.exit(app.exec_()) > > Same here with your sample: > > Central widget should have width=1000, height=700 > but central widget has width=960, height=600 > > I resorted to WXAgg for the time being. Waiting for some updates till I hear > a resolution. The annoying part is when I created a plot using specified > width and height Qt4Agg doesn't follow these dimensions as in this case and > resulting savefig(file.pdf) produces wrongly sized file unless I manually > extend the figure area and re-issue a savefig afterwards. I got a suggestion at the PyQt4 mailing list, and the following patch appears to resolve the problem. However, before I commit the change, I'd like to hear from John or Andrew: What is the protocol for dealing with a change that may affect unit tests? Darren Index: lib/matplotlib/backends/backend_qt4.py =================================================================== --- lib/matplotlib/backends/backend_qt4.py (revision 8292) +++ lib/matplotlib/backends/backend_qt4.py (working copy) @@ -318,6 +318,11 @@ QtCore.QObject.connect(self.toolbar, QtCore.SIGNAL("message"), self.window.statusBar().showMessage) + cs = canvas.sizeHint() + tbs = self.toolbar.sizeHint() + sbs = self.window.statusBar().sizeHint() + self.window.resize(cs.width(), cs.height()+tbs.height()+sbs.height()) + self.window.setCentralWidget(self.canvas) if matplotlib.is_interactive():
I don't know why this happens, but did note that using a "button_release_event" instead seems to work fine. Mike Søren Nielsen wrote: > Hi, > > I've hit a problem when using the button_press_event to pop up a > wx.MessageBox. After the messagebox is loaded the mouse becomes > completely unresponsive (even outside the application) until the > application is shut down (by using ALT+F4). I'm making a feature where > the user, after right clicking on the figure (after doing some > manipulations etc), are requested to answer a question in a message box. > > This problem seems only to occur on Linux.. > > Am I doing something wrong or is this a bug? > > I've attached the source that demonstrates the problem. > > Thanks, > Soren > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
On Mon, May 3, 2010 at 1:12 PM, Christopher Brown <c-...@as...> wrote: > Hi List, > > How can I change the (fore)color of a figure title (pp.title('Wow!')) > after it has been added to the figure? I can do this with axes labels > like this: > > pp.gca().axes.xaxis.label.set_color(color) pp.gca().axes.title.set_color(color) You can also save the return value from pp.title: t = pp.title('Wow!') t.set_color(color) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma
Hi List, How can I change the (fore)color of a figure title (pp.title('Wow!')) after it has been added to the figure? I can do this with axes labels like this: pp.gca().axes.xaxis.label.set_color(color) -- Christopher Brown, Ph.D. Associate Research Professor Department of Speech and Hearing Science Arizona State University http://pal.asu.edu
Hello Eric, thank you so much fo your feedback and the fix! it works as expected. bye for now Margherita ----- Original Message ----- From: Eric Firing <ef...@ha...> Date: Friday, April 30, 2010 6:01 pm Subject: Re: [Matplotlib-users] question about axis scale multiplier > Margherita Vittone wiersma wrote: > > HI, > > i am making a scatter plot and i simply use defaults for tick > formatting etc; > > when i plot the data the plot show on the x axis a multiplier > scaling with scintific notation; > > i would like to get rid of it , the data looks like this: > > > > values5 = [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47 > > -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52 > > -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52 > > ......] > > > > values6 = [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52, > > -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47, > > -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55, > > -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58, > > ....] > > > > > > and when the plot is shown as in the the attachement it show the > scintific notation > > at the x scale. > > If it were just a matter of scientific notation, you would be able to > > use the ticklabel_format Axes method with style='plain' to turn it > off. > The real problem, though, is that an offset is being used. With > mpl > from svn, you can also turn that off with the ticklabel_format() > function or method, but with released versions you need something a > little more arcane, e.g. > > import pyplot as plt > plt.scatter(values5, values6) > ax = plt.gca() > ax.xaxis.set_major_formatter(plt.ScalarFormatter(useOffset=False)) > #ax.xaxis.set_major_locator(plt.MaxNLocator(nbins=6, steps=[1,2,5,10])) > plt.draw() > > The commented-out line reduces the number of tick marks; you may want > to > do this because without the offset, the tick labels can get a bit > long > and crowded. > > Eric > > > > > > Any input is appreciated. Thank you much > > bye for now > > > > Margherita > > > > > > > > > > ------------------------------------------------------------------------ > > > > HI, > > i am making a scatter plot and i simply use defaults for tick > formatting etc; > > when i plot the data the plot show on the x axis a multiplier > scaling with scintific notation; > > i would like to get rid of it , the data looks like this: > > > > values5 = [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47 > > -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52 > > -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52 > > ......] > > > > values6 = [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52, > > -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47, > > -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55, > > -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58, > > ....] > > > > > > and when the plot is shown as in the the attachement it show the > scintific notation > > at the x scale. > > > > Any input is appreciated. Thank you much > > bye for now > > > > Margherita > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > ------------------------------------------------------------------------ > > > > ------------------------------------------------------------------------------ > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Hello, I send this message because I have a problem with "On-Pick" Funtion. When I use this function with my datas, cartesian coordinates don't correspond. Seems to work with the example, but not with my data, somebody knows why ? Thanks you for your reply !!! My code : """ compute the mean and stddev of 100 data sets and plot mean vs stddev. When you click on one of the mu, sigma points, plot the raw data from the dataset that generated the mean and stddev """ import numpy as np import matplotlib.pyplot as plt compteurdata = 0 positif = 0 datas = [0] myrange = [] xs = range(2500) chemin = "C:/Users/utilisateur/Desktop/ProtoData/1902-1/plotcolonne.txt" fichier = open(chemin,'r') # 5 points tolerance #declaration de variables # Lecture de la table for l in fichier.readlines(): if compteurdata < 2499 : l = float(l) datas.append(l) compteurdata = compteurdata + 1 else: pass ys = datas fig = plt.figure() ax = fig.add_subplot(111) ax.set_title('click on point to plot time series') line, = ax.plot(xs, ys, 'o', picker=5) def onpick(event): if event.artist!=line: return True N = len(event.ind) if not N: return True print xs[event.ind],ys[event.ind] fig.canvas.mpl_connect('pick_event', onpick) plt.show() -- View this message in context: http://old.nabble.com/Why-when-I-Use--ZooM%2C-On-Pick-Event-don%27t-correspond-to-my-plots-datas-tp28433072p28433072.html Sent from the matplotlib - users mailing list archive at Nabble.com.
2010年05月02日 20:19, aditya bhargava skrev: > Is there a straightforward way of plotting a vector in matplotlib? > Suppose I want to plot the vector [1 2]'. If I pass this vector in to > plot(), I get the line that passes through (0,1), (1,2). Instead I want > the line that passes through (0,0),(1,2). > I use pyplot.Arrow to visualize displacement fields. This is a snippet copied from the code I use (it sits in a loop over all vectors I want to plot): arr = plt.Arrow(x, y, dx, dy) plt.gca().add_patch(arr) In your case, you would have (x, y) = (0, 0) and (dx, dy) = (1, 2). Regards Johan
I'm using wxagg, but actually it's working now... I put show()s a bit everywhere in my code so I must confess I don't really know how it's working, though I'll probably have to go back and clean the mess at some point. Antony 2010年4月22日 Michiel de Hoon <mjl...@ya...> > Actually which backend are you using? I'd like to try this to see what > happens if show() is called more than once. > > --Michiel. > > > --- On *Tue, 4/20/10, Antony Lee <ant...@en...>* wrote: > > That would be a solution, indeed. However, is there really no way of > coming back to a pre-plt.show() state once all windows are closed? What > kind of irreversible things does plt.show() do? > > >
On 05/02/2010 05:48 PM, Kun Hong wrote: > Hi, > > I am new to matplotlib. So if I ask sth stupid, please bear with me. > > I am using matplotlib to present large data set in different graph > types, > bar, dot, line, etc. I find that the bar graph has very bad performance. > Say, I draw data points of about ten thousand. Using dot graph, it draws > in a second. But using bar graph, it draws in tens of seconds. > > I was wondering what causes this difference. Is there a way to improve > the > bar graph performace? (Maybe I am not drawing it right, then, please > give > me a pointer) > Also check out step(). http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.step Eric > Below is a simple example: > > from np.random import uniform > from numpy.random import uniform > x = uniform(0, 10, 14000) > y = uniform(0, 100, 14000) > plt.plot(x, y, 'bo') > plt.bar(x, y) > > > Thanks, > Kun > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On 05/02/2010 05:48 PM, Kun Hong wrote: > Hi, > > I am new to matplotlib. So if I ask sth stupid, please bear with me. > > I am using matplotlib to present large data set in different graph > types, > bar, dot, line, etc. I find that the bar graph has very bad performance. > Say, I draw data points of about ten thousand. Using dot graph, it draws > in a second. But using bar graph, it draws in tens of seconds. > > I was wondering what causes this difference. Is there a way to improve > the > bar graph performace? (Maybe I am not drawing it right, then, please > give > me a pointer) Bar is intended for plots in which the bars are individually visible, so it makes sense only for a small number--say 10 or 20 bars. It is implemented using an individual patch for each bar, and this is inherently slow in mpl--but for under 100 bars, it doesn't matter at all. If you have a large number of points, maybe what you are looking for is fill() or fill_between(). Check the links for these in http://matplotlib.sourceforge.net/. Eric > > Below is a simple example: > > from np.random import uniform > from numpy.random import uniform > x = uniform(0, 10, 14000) > y = uniform(0, 100, 14000) > plt.plot(x, y, 'bo') > plt.bar(x, y) > > > Thanks, > Kun
Hi, I am new to matplotlib. So if I ask sth stupid, please bear with me. I am using matplotlib to present large data set in different graph types, bar, dot, line, etc. I find that the bar graph has very bad performance. Say, I draw data points of about ten thousand. Using dot graph, it draws in a second. But using bar graph, it draws in tens of seconds. I was wondering what causes this difference. Is there a way to improve the bar graph performace? (Maybe I am not drawing it right, then, please give me a pointer) Below is a simple example: from np.random import uniform from numpy.random import uniform x = uniform(0, 10, 14000) y = uniform(0, 100, 14000) plt.plot(x, y, 'bo') plt.bar(x, y) Thanks, Kun