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
(10) |
2
(17) |
3
(14) |
4
(28) |
5
(23) |
6
(12) |
7
(3) |
8
(11) |
9
(29) |
10
(31) |
11
(9) |
12
(35) |
13
(3) |
14
(9) |
15
(16) |
16
(14) |
17
(10) |
18
(7) |
19
(3) |
20
|
21
(4) |
22
(6) |
23
(14) |
24
(16) |
25
(10) |
26
(5) |
27
(4) |
28
(8) |
29
(19) |
30
(21) |
|
|
|
|
From: Esmail <eb...@ho...> - 2009-06-04 23:48:34
|
Hi, Beginning Python Visualization: Crafting Visual Transformation Scripts by Shai Vaingast http://www.amazon.com/Beginning-Python-Visualization-Transformation-Professionals/dp/1430218436/ref=sr_1_1?ie=UTF8&s=books&qid=1244158389&sr=8-1 Has anyone seen/read this book? I am looking for a good hardcopy reference for matplotlib and associated tools. While the gallery on the matplotlib site is a good way to learn, I would like a reference guide that I could easily print out or a tutorial of sorts, or possibly this book. Thanks, Esmail ps: here's an example of the sort of thing I'd like to learn and know about. Someone recently generously shared this code with me on the python list. While I have used pylab/matplotlib a bit, I didn't know about ion() (line 12), nor am I sure about what is happening on line 19 and 21, does plot return a list? Why is it subscripted to? Hadn't seen draw() before either, though I know show() .. these sort of things I am curious to learn about before I see them in code for the first time. 1 #!/usr/bin/env python 2 3 from pylab import * 4 5 # of elements 6 ELEMS = 250 7 # initial positions 8 9 x0 = rand(ELEMS) 10 y0 = rand(ELEMS) 11 12 ion() # interactive on 13 14 for t in linspace(0, 1, 100): 15 x = x0 + 0.1*cos(t) 16 y = y0 + 0.1*sin(t) 17 18 if t == 0: # first time calling 19 h = plot(x,y,'ro') 20 else: 21 h[0].set_data(x,y) 22 23 draw() pps: I slightly reformatted/modified the original code. |
From: Karl Y. <kar...@uc...> - 2009-06-04 23:39:09
|
I have 2 float arrays of the same dimension which I use to generate a 3rd array, again of the same dimension, containing integers from a small set (I obtain the 3rd array via clustering in the 2 dimensional space of points obtained as values from the same location in the initial 2 arrays). I'd like to do a scatter plot using scatter, with x-axis values as values from the first array, y-values as values from the second array and color of the points corresponding to the integer in the 3rd array (so far so good; I can do that much). Then I'd like to plot an image using imshow of the 3rd array with colors corresponding to those in the scatter plot. I can generate the image with imshow ok but can't the colors to match those in the scatter plot. Here's a snippet (assume array1,array2, and array3 are 2D arrays): hot() scatter(array1.ravel(), array2.ravel(), c = numpy.array(array3.ravel(),float)) imshow(array3) show() The main problem is that I can't figure out how to force the plot colors for imshow to correspond to those in scatter. Thanks for any thought or suggestions. Cheers, -- KY |
From: Sandro T. <mat...@gm...> - 2009-06-04 22:34:23
|
Hi, On Thu, Jun 4, 2009 at 23:26, citronade <ric...@ma...> wrote: > > I am trying to set the x and y axis range on a log-log plot. The ranges I > give are automatically adjusted to the nearest power of 10, but I would like > to have the minimum and maximum axis values not be powers of 10. Is there a > way to set the axis range so that it is not automatically rescaled? you can explicitly set the X and Y limits, actually overriding the autoscale selection (to disable autoscale completely, exec ax.set_autoscale_on(False) ). depending on your code, you can use xlim([xmin, xmax]), ylim([ymin, ymax]) or axis([xmin, xmax, ymin, ymax]). Or directly from the Axes instances: set_xlim(), set_ylim(). You can check for the complete references of these functions on matplotlib.sf.net Regards, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi |
From: citronade <ric...@ma...> - 2009-06-04 21:27:05
|
I am trying to set the x and y axis range on a log-log plot. The ranges I give are automatically adjusted to the nearest power of 10, but I would like to have the minimum and maximum axis values not be powers of 10. Is there a way to set the axis range so that it is not automatically rescaled? -- View this message in context: http://www.nabble.com/Setting-axis-range-so-it-is-not-rescaled-tp23878124p23878124.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: musik <xi....@gm...> - 2009-06-04 18:19:11
|
This works nicely. Thank you JJ. Jae-Joon Lee wrote: > > I hope the code below gives you some idea. > > > def Tc(Tf): return (5./9.)*(Tf-32) > > ax1 = subplot(111) # y-axis in F > ax2 = twinx() # y-axis in C > > def update_ax2(ax1): > y1, y2 = ax1.get_ylim() > ax2.set_ylim(Tc(y1), Tc(y2)) > > # automatically update ylim of ax2 when ylim of ax1 changes. > ax1.callbacks.connect("ylim_changed", update_ax2) > ax1.plot([78, 79, 79, 77]) > > -JJ > > > On Thu, Jun 4, 2009 at 11:08 AM, musik <xi....@gm...> wrote: >> >> Exactly. I want to plot the original data once, but the two y axes show >> different scales (units). Is twinx() good for that? How? >> >> Thanks. >> > > -- View this message in context: http://www.nabble.com/one-data-set%2C-two-y-axis-scales-tp23863680p23875221.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Ryan M. <rm...@gm...> - 2009-06-04 18:12:25
|
On Thu, Jun 4, 2009 at 12:16 PM, Jae-Joon Lee <lee...@gm...> wrote: > I hope the code below gives you some idea. > > > def Tc(Tf): return (5./9.)*(Tf-32) > > ax1 = subplot(111) # y-axis in F > ax2 = twinx() # y-axis in C > > def update_ax2(ax1): > y1, y2 = ax1.get_ylim() > ax2.set_ylim(Tc(y1), Tc(y2)) > > # automatically update ylim of ax2 when ylim of ax1 changes. > ax1.callbacks.connect("ylim_changed", update_ax2) > ax1.plot([78, 79, 79, 77]) Well I know I just learned something.... Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from Norman, Oklahoma, United States |
From: Carlos G. G. <car...@gm...> - 2009-06-04 17:50:13
|
Hello all I'm trying to add a custom button in the navigation toolbar for a wx app. so far, I can add the button, but can't get it to work. here is a snippet of the code (the classes are in the same file): #custom matplotlib navigation toolbar #from: http://www.nabble.com/Re%3A-Navigation-toolbar-w-o-subplot-configuration-button-p18754379.html class VMToolbar(NavigationToolbar2WxAgg): def __init__(self, plotCanvas): NavigationToolbar2WxAgg.__init__(self, plotCanvas) self.SetToolBitmapSize(wx.Size(12,12)) app_ico = application.getBitmap() drawButtonNT = self.AddLabelTool(-1, 'Plot', app_ico, wx.NullBitmap, wx.ITEM_NORMAL,'Draw/Clear Stereonet') # delete unwanted tools self.DeleteToolByPos(6) # Configure subplots self.DeleteToolByPos(3) # Pan self.Bind(wx.EVT_TOOL, StereoPanel.PlotStereonett, drawButtonNT) class StereoPanel(wx.Panel): """class for the second page of the notebook """ def __init__(self, parent): wx.Panel.__init__(self, parent, style=wx.BORDER_SUNKEN) #... some code #creates / redraws the stereonet def PlotStereonett(self, event): """Create the Stereonet """ axes = self.plotaxes print 'it works!!' This gives me this error: TypeError: unbound method PlotStereonett() must be called with StereoPanel instance as first argument (got CommandEvent instance instead) TIA Carlos -- Carlos Henrique Grohmann - Geologist D.Sc. a.k.a. Guano - Linux User #89721 ResearcherID: A-9030-2008 carlos dot grohmann at gmail dot com http://www.igc.usp.br/pessoais/guano/ _________________ "Good morning, doctors. I have taken the liberty of removing Windows 95 from my hard drive." --The winning entry in a "What were HAL's first words" contest judged by 2001: A SPACE ODYSSEY creator Arthur C. Clarke Can’t stop the signal. |
From: Pierre R. <co...@py...> - 2009-06-04 17:35:42
|
mat...@li... a écrit : > Message: 3 > Date: Thu, 4 Jun 2009 08:01:06 -0500 > From: "Christophe Dupre" <chr...@vh...> > Subject: [Matplotlib-users] matplotlib and qtdesigner > To: <mat...@li...> > Message-ID: > <F7D...@vh...> > Content-Type: text/plain; charset="us-ascii" > > Hello there, > > > > This is my first post, so first of all, thanks to the > creators/contributors of matplotlib. It's a very nice software. > > > > I've been developping an application using PyQT and matplotlib for a > while now, and instead of coding the GUI, I'd like to make use of QT > designer. > > Does anyone know how I can add a MPL FigureCanvasQTAgg to a Main Window > form in QT designer? Any (simple) example would be great. > > > > Thanks, > > > > Christophe Hi, Someone asked me the same question on Python(x,y) discussion group (http://pythonxy.googlegroups.com) a few days ago. So I've included a QtDesigner plugin in Python(x,y) matplotlib package. Here is a screenshot: http://pythonxy.googlegroups.com/web/mplplugin.png Here is the source code (it's quite simple actually): http://groups.google.fr/group/pythonxy/web/QtDesigner_Plugins.zip (simply extract this in your site-packages directory) Cheers, Pierre |
From: Markus F. <fel...@gm...> - 2009-06-04 17:33:51
|
Hi All, i want to change my subplots sometimes, but how to do this ? I am adding subplots with this command: self.subplot1 = self.figure.add_subplot(211) Deleting axes with(as i read in this mailing list): [self.figure.delaxes(a) for a in self.figure.get_axes()] but then i can not show up my graph. What do i have to do ? regards Markus |
From: Jae-Joon L. <lee...@gm...> - 2009-06-04 17:16:22
|
I hope the code below gives you some idea. def Tc(Tf): return (5./9.)*(Tf-32) ax1 = subplot(111) # y-axis in F ax2 = twinx() # y-axis in C def update_ax2(ax1): y1, y2 = ax1.get_ylim() ax2.set_ylim(Tc(y1), Tc(y2)) # automatically update ylim of ax2 when ylim of ax1 changes. ax1.callbacks.connect("ylim_changed", update_ax2) ax1.plot([78, 79, 79, 77]) -JJ On Thu, Jun 4, 2009 at 11:08 AM, musik <xi....@gm...> wrote: > > Exactly. I want to plot the original data once, but the two y axes show > different scales (units). Is twinx() good for that? How? > > Thanks. > > > > Ryan May-3 wrote: >> >> On Thu, Jun 4, 2009 at 6:01 AM, Sandro Tosi <mat...@gm...> wrote: >> >>> Hi, >>> >>> On Thu, Jun 4, 2009 at 06:56, musik <xi....@gm...> wrote: >>> > I want to make a plot with both y axes labeled. The one on the left >>> (y1) >>> > will be in Fahrenheit, while the one on the right (y2) in Celsius. Is >>> there >>> > a way to do this? >>> >>> what you're looking for is [1] >>> >>> [1] >>> http://matplotlib.sourceforge.net/api/pyplot_api.html?highlight=twinx#matplotlib.pyplot.twinx >> >> >> Well you can make it work that way, but I think what the original poster >> wants is just to plot the data once, with one set of units on the left and >> another on the right. Using twinx would make two identical lines just to >> make two different scales. It seems to me that there *should* be an >> easier >> way, but I'm not sure that one exists... >> >> Ryan >> >> -- >> Ryan May >> Graduate Research Assistant >> School of Meteorology >> University of Oklahoma >> Sent from Norman, Oklahoma, United States >> >> ------------------------------------------------------------------------------ >> OpenSolaris 2009.06 is a cutting edge operating system for enterprises >> looking to deploy the next generation of Solaris that includes the latest >> innovations from Sun and the OpenSource community. Download a copy and >> enjoy capabilities such as Networking, Storage and Virtualization. >> Go to: http://p.sf.net/sfu/opensolaris-get >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > -- > View this message in context: http://www.nabble.com/one-data-set%2C-two-y-axis-scales-tp23863680p23871873.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Ryan M. <rm...@gm...> - 2009-06-04 16:50:32
|
On Thu, Jun 4, 2009 at 10:08 AM, musik <xi....@gm...> wrote: > > Exactly. I want to plot the original data once, but the two y axes show > different scales (units). Is twinx() good for that? How? > I wouldn't call it "good", but you can make it work. Basically, you'd plot your data once in F, then convert it to C and plot it a second time. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from Norman, Oklahoma, United States |
From: projetmbc <pro...@cl...> - 2009-06-04 15:50:31
|
Christophe Dupre a écrit : > > I've been developping an application using PyQT and matplotlib for a > while now, and instead of coding the GUI, I'd like to make use of QT > designer. > Hello, I'm interested by your code or simple parts of it wich show intercation between PyQt and matplotilib. Best regards. Another Christophe. |
From: musik <xi....@gm...> - 2009-06-04 15:08:38
|
Exactly. I want to plot the original data once, but the two y axes show different scales (units). Is twinx() good for that? How? Thanks. Ryan May-3 wrote: > > On Thu, Jun 4, 2009 at 6:01 AM, Sandro Tosi <mat...@gm...> wrote: > >> Hi, >> >> On Thu, Jun 4, 2009 at 06:56, musik <xi....@gm...> wrote: >> > I want to make a plot with both y axes labeled. The one on the left >> (y1) >> > will be in Fahrenheit, while the one on the right (y2) in Celsius. Is >> there >> > a way to do this? >> >> what you're looking for is [1] >> >> [1] >> http://matplotlib.sourceforge.net/api/pyplot_api.html?highlight=twinx#matplotlib.pyplot.twinx > > > Well you can make it work that way, but I think what the original poster > wants is just to plot the data once, with one set of units on the left and > another on the right. Using twinx would make two identical lines just to > make two different scales. It seems to me that there *should* be an > easier > way, but I'm not sure that one exists... > > Ryan > > -- > Ryan May > Graduate Research Assistant > School of Meteorology > University of Oklahoma > Sent from Norman, Oklahoma, United States > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/one-data-set%2C-two-y-axis-scales-tp23863680p23871873.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Ole S. <ole...@gm...> - 2009-06-04 14:35:46
|
Hi John, John Hunter <jd...@gm...> writes: > On Thu, Jun 4, 2009 at 9:00 AM, Ole Streicher <ole...@gm...> wrote: >> when I scroll or zoom with the mouse wheel, the scaling of the x and y >> axes are changed within the event. I would need now the new value of >> these to update the status bar. How can I get them without waiting for a >> new mouse event? > > Not sure I understand the question... Could you be more specific, > maybe post a code sample? The point is that there may occure changes in the diagram axes that are not connected to a mouse event. Example: I use the Qt backend, and defined an QAction "zoom in" connected to the Ctrl-"+" key. At the same time, the status bar of my application shows the position of the mouse in the diagram. Usually, the updates of the position is connected to the "motion_notify_event" which returns the mouse position on change. When the mouse is not moved, but the "zoom in" action is triggered (via hotkey in this example), I would need to update the status bar so that it shows the coordinated that are under the mouse cursor *after* the zoom was applied. Does this make my problem better understandable? Cheers Ole |
From: John H. <jd...@gm...> - 2009-06-04 14:32:05
|
On Thu, Jun 4, 2009 at 9:26 AM, Ole Streicher <ole...@gm...> wrote: >> But to answer your question about matplotlib transforms. You could do >> ax = event.inaxes # the axes the event occurred in >> x, y = ax.transData.transform_point((event.xdata, event.ydata)) Yes: xdata, ydata = ax.transData.inverted().transform_point((xdisplay, ydisplay)) And the transAxes attribute maps 0..1 relative axes position to display. JDH |
From: Ryan M. <rm...@gm...> - 2009-06-04 14:30:28
|
On Thu, Jun 4, 2009 at 6:01 AM, Sandro Tosi <mat...@gm...> wrote: > Hi, > > On Thu, Jun 4, 2009 at 06:56, musik <xi....@gm...> wrote: > > I want to make a plot with both y axes labeled. The one on the left (y1) > > will be in Fahrenheit, while the one on the right (y2) in Celsius. Is > there > > a way to do this? > > what you're looking for is [1] > > [1] > http://matplotlib.sourceforge.net/api/pyplot_api.html?highlight=twinx#matplotlib.pyplot.twinx Well you can make it work that way, but I think what the original poster wants is just to plot the data once, with one set of units on the left and another on the right. Using twinx would make two identical lines just to make two different scales. It seems to me that there *should* be an easier way, but I'm not sure that one exists... Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from Norman, Oklahoma, United States |
From: Ole S. <ole...@gm...> - 2009-06-04 14:26:42
|
Hi John, thank you four your helpful answer. John Hunter <jd...@gm...> writes: > On Thu, Jun 4, 2009 at 8:49 AM, Ole Streicher <ole...@gm...> wrote: >> def on_move(self, event) >> mouse_pos_diag_x = ???(event.xdata) >> mouse_pos_diag_y = ???(event.ydata) >> where I would need to replace the ??? with some transformation from >> event.xdata, event.ydata, and the min and max of the y axis. How could I >> do that? > The mouse event object already has display coords attached in the > event.x and event.y attributes. My example was a bit simplified. What I want to do is to connect several diagrams to show the same cursor. For the diagram with the mouse in it, I can get ofcourse pixel coordinates, too. But for all other diagrams I need to convert the cursor position to pixel coordinates. > But to answer your question about matplotlib transforms. You could do > ax = event.inaxes # the axes the event occurred in > x, y = ax.transData.transform_point((event.xdata, event.ydata)) This is exactly what I need. Does the reverse transformation also exist? Cheers Ole |
From: John H. <jd...@gm...> - 2009-06-04 14:20:38
|
On Thu, Jun 4, 2009 at 9:00 AM, Ole Streicher <ole...@gm...> wrote: > Hi again, > > when I scroll or zoom with the mouse wheel, the scaling of the x and y > axes are changed within the event. I would need now the new value of > these to update the status bar. How can I get them without waiting for a > new mouse event? Not sure I understand the question... Could you be more specific, maybe post a code sample? JDH |
From: John H. <jd...@gm...> - 2009-06-04 14:19:12
|
On Thu, Jun 4, 2009 at 8:49 AM, Ole Streicher <ole...@gm...> wrote: setParent(parent) > self.mpl_connect('motion_notify_event', self.on_move) > > def on_move(self, event) > mouse_pos_diag_x = ???(event.xdata) > mouse_pos_diag_y = ???(event.ydata) > lower_limit_diag_y = ??? > upper_limit_diag_y = ??? > ... > > where I would need to replace the ??? with some transformation from > event.xdata, event.ydata, and the min and max of the y axis. How could I > do that? The mouse event object already has display coords attached in the event.x and event.y attributes. See http://matplotlib.sourceforge.net/api/backend_bases_api.html#matplotlib.backend_bases.LocationEvent and http://matplotlib.sourceforge.net/users/event_handling.html But to answer your question about matplotlib transforms. You could do ax = event.inaxes # the axes the event occurred in x, y = ax.transData.transform_point((event.xdata, event.ydata)) and you should get the same answer. JDH |
From: Ole S. <ole...@gm...> - 2009-06-04 14:05:10
|
Hi, I want to implement a cursor on a diagram using native Qt routines. For this, I would need to transform data (axis) coordinates to display coordinates. The manual of matplotlib, API "axes" just jays that there are some public attributes 'transData' and 'transAxis', but without an explanation. So, if I have something like class DiagramWidget(FigureCanvas): def __init__(self, parent): fig = Figure() self.axes = fig.add_subplot(111) self.xlimits = (0, 4000) FigureCanvas.__init__(self, fig) self.setParent(parent) self.mpl_connect('motion_notify_event', self.on_move) def on_move(self, event) mouse_pos_diag_x = ???(event.xdata) mouse_pos_diag_y = ???(event.ydata) lower_limit_diag_y = ??? upper_limit_diag_y = ??? ... where I would need to replace the ??? with some transformation from event.xdata, event.ydata, and the min and max of the y axis. How could I do that? Cheers Ole |
From: Ole S. <ole...@gm...> - 2009-06-04 14:05:08
|
Hi again, when I scroll or zoom with the mouse wheel, the scaling of the x and y axes are changed within the event. I would need now the new value of these to update the status bar. How can I get them without waiting for a new mouse event? Cheers Ole |
From: Christophe D. <chr...@vh...> - 2009-06-04 13:01:12
|
Hello there, This is my first post, so first of all, thanks to the creators/contributors of matplotlib. It's a very nice software. I've been developping an application using PyQT and matplotlib for a while now, and instead of coding the GUI, I'd like to make use of QT designer. Does anyone know how I can add a MPL FigureCanvasQTAgg to a Main Window form in QT designer? Any (simple) example would be great. Thanks, Christophe |
From: Alan G I. <ala...@gm...> - 2009-06-04 12:01:03
|
On 6/4/2009 3:59 AM jor...@ya... apparently wrote: > I need a file selection dialog or similar Tkinter makes this pretty easy. E.g., >>> import tkFileDialog as fd >>> fname = fd.askopenfilename(initialdir='c:/temp') >>> fname 'C:/temp/note.jpg' That's all, as long as you don't mind destroying the Window manually. (Otherwise, you need just a couple more lines.) Cheers, Alan Isaac |
From: Jeff W. <js...@fa...> - 2009-06-04 11:46:49
|
Kilian Koepsell wrote: > Hi Jeff, I hope it is ok to contact you directly with this bug report > -- feel free to reply to the list if appropriate. I found your > previous posting through a web search, > <http://www.mail-archive.com/mat...@li.../msg10637.html>and > then tried to use your implementation in matplotlib svn. Killian: That's fine, just please CC the mailing list. > I noticed that the svn version is different from the one in the > posting above and it seems to have two bugs: * in the function > rgb_to_hsv_arr, the line arr = arr/255. is missing and therefore the > script doesn't normalize the input any more and it doesn't type-cast > it to float any more if used with uint8 rgb input. That function is to be called by LightSource.shade using normalized rgb floats (between 0 and 1). You don't need to call it directly - instead just use the LightSource class as show in shading_example.py. > This seems to cause wrong results. * the script in the current form > returns NaNs when applied to white [255,255,255] or white [0,0,0] > inputs. This can be solved by adding the following line just before > the return statement: out[delta==0,0] = 0 Best regards, Kilian Again, don't use that old script you found in the email archive, but follow the shading_example.py example. The rgb_to_hsv function is not really part of the public API. -Jeff |
From: Sandro T. <mat...@gm...> - 2009-06-04 11:01:59
|
Hi, On Thu, Jun 4, 2009 at 06:56, musik <xi....@gm...> wrote: > I want to make a plot with both y axes labeled. The one on the left (y1) > will be in Fahrenheit, while the one on the right (y2) in Celsius. Is there > a way to do this? what you're looking for is [1] [1] http://matplotlib.sourceforge.net/api/pyplot_api.html?highlight=twinx#matplotlib.pyplot.twinx Cheers, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi |