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
(10) |
3
(9) |
4
(3) |
5
(2) |
6
(6) |
7
(12) |
8
(21) |
9
(4) |
10
(19) |
11
(7) |
12
(2) |
13
(28) |
14
(13) |
15
(27) |
16
(17) |
17
(21) |
18
(22) |
19
(3) |
20
(25) |
21
(17) |
22
(16) |
23
(28) |
24
(19) |
25
(4) |
26
(4) |
27
(23) |
28
(13) |
29
(15) |
30
(19) |
|
|
On Thu, Sep 30, 2010 at 4:59 PM, Nicolas Bigaouette <nbi...@gm...>wrote: > Hi all, > > I'm plotting some data with imshow(). On the screen it looks good, but when > printed (it's part of a paper) it's hard to see because it all looks blue or > black. > > I'm attaching an example. > > What I would like to do it have a colormap which is transparent for lower > values of data and opaque for high values, so the blue on the figure would > appear white/transparent. > > Is it possible? How to achieve this? alpha options seems to accept only a > float for a uniform transparency. > > Thanx! > > N > > Correct, most plotting functions in mpl assume a scalar alpha channel, but the backend of mpl does not have this restriction. The colormap object itself is not restricted to a single value for the alpha channel. I would imagine, although I have not tried this myself, that it would be possible to modify the colormap object's alpha values in the self._lut rgba array. Note that self._lut for a Colormap object is not created right away, only when it needs to make a color from a value. I don't know if that helps at all, but good luck! Ben Root
On Wed, Sep 29, 2010 at 9:58 PM, Jason Grout <jas...@cr...> wrote: >... > I made the FAQ entry code a little more general (and hopefully more > robust) a while ago. I don't know if it takes care of the problem > you're talking about, though. > > I posted it to the matplotlib-devel mailing list here: > > http://www.mail-archive.com/mat...@li.../msg05628.html Thanks, Jason. I tried it out, and it has the same issues.
On Sep 30, 2010, at 11:46 AM, Benjamin Root wrote: > I just had another thought.... have you ever modified your matplotlibrc file? It might be possible that you have turned off holds (which is default). If so, then this would be a bug, because the errorbar function should temporarially turn on the hold in order to complete its task. You are correct, I have modified axes.hold to be False by default. For the record, this is with version 0.99.1.1 but has been the case for at least several versions earlier, and I believe is the same on 1.0. On Sep 30, 2010, at 11:48 AM, Eric Firing wrote: > That is a major bug in errorbar. I suspect no one has brought it to our > attention before because hold=True is the default. The only workaround > is what you have already found: ensure hold is True for the call to > errorbar. > > If there is no reply within a couple of days to the effect that someone > has fixed this bug, then please file a ticket so that we don't forget > about it. http://sourceforge.net/tracker/?group_id=80706&atid=560720 > Ok, I'm glad at least for the confirmation that I'm not crazy. I'll add a ticket in a bit if it isn't fixed before then. I guess the fix is simply to enable holds after the first plot command within errorbar(), then restore the hold state at the end. joey
On 09/30/2010 08:28 AM, Joey Richards wrote: > When I use the errorbar() routine to plot data, unless I set hold=True as a kwarg (or set it globally), the data are plotted without the errorbars. I believe it is because the routine first plots the error bars, then overplots the data points and for some reason the routine is clearing the axis in between these steps. > Joey, That is a major bug in errorbar. I suspect no one has brought it to our attention before because hold=True is the default. The only workaround is what you have already found: ensure hold is True for the call to errorbar. If there is no reply within a couple of days to the effect that someone has fixed this bug, then please file a ticket so that we don't forget about it. http://sourceforge.net/tracker/?group_id=80706&atid=560720 Eric > This is rather annoying for interactive use and does not seem to be the expected behavior. For example, if I run the example code from the errorbar page (my copy pasted below), I get a nice plot of the data with no error bars. This seems to be the effect either from within "ipython -pylab" or from standalone scripts. > > Any advice would be greatly appreciated, thanks. > > joey > > > import numpy as np > import matplotlib.pyplot as plt > > # example data > x = np.arange(0.1, 4, 0.5) > y = np.exp(-x) > > # example variable error bar values > yerr = 0.1 + 0.2*np.sqrt(x) > xerr = 0.1 + yerr > > # First illustrate basic pyplot interface, using defaults where possible. > plt.figure() > plt.errorbar(x, y, xerr=0.2, yerr=0.4) > plt.title("Simplest errorbars, 0.2 in x, 0.4 in y") > > plt.show() > > > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On Thu, Sep 30, 2010 at 1:44 PM, Benjamin Root <ben...@ou...> wrote: > On Thu, Sep 30, 2010 at 1:28 PM, Joey Richards <jo...@ca...> wrote: > >> When I use the errorbar() routine to plot data, unless I set hold=True as >> a kwarg (or set it globally), the data are plotted without the errorbars. I >> believe it is because the routine first plots the error bars, then overplots >> the data points and for some reason the routine is clearing the axis in >> between these steps. >> >> This is rather annoying for interactive use and does not seem to be the >> expected behavior. For example, if I run the example code from the errorbar >> page (my copy pasted below), I get a nice plot of the data with no error >> bars. This seems to be the effect either from within "ipython -pylab" or >> from standalone scripts. >> >> Any advice would be greatly appreciated, thanks. >> >> joey >> >> >> import numpy as np >> import matplotlib.pyplot as plt >> >> # example data >> x = np.arange(0.1, 4, 0.5) >> y = np.exp(-x) >> >> # example variable error bar values >> yerr = 0.1 + 0.2*np.sqrt(x) >> xerr = 0.1 + yerr >> >> # First illustrate basic pyplot interface, using defaults where possible. >> plt.figure() >> plt.errorbar(x, y, xerr=0.2, yerr=0.4) >> plt.title("Simplest errorbars, 0.2 in x, 0.4 in y") >> >> plt.show() >> >> > Joey, > > The code works as expected for me. Which version of matplotlib are you > using (print matplotlib.__version__)? > > Ben Root > > I just had another thought.... have you ever modified your matplotlibrc file? It might be possible that you have turned off holds (which is default). If so, then this would be a bug, because the errorbar function should temporarially turn on the hold in order to complete its task. Ben Root
On Thu, Sep 30, 2010 at 1:28 PM, Joey Richards <jo...@ca...> wrote: > When I use the errorbar() routine to plot data, unless I set hold=True as a > kwarg (or set it globally), the data are plotted without the errorbars. I > believe it is because the routine first plots the error bars, then overplots > the data points and for some reason the routine is clearing the axis in > between these steps. > > This is rather annoying for interactive use and does not seem to be the > expected behavior. For example, if I run the example code from the errorbar > page (my copy pasted below), I get a nice plot of the data with no error > bars. This seems to be the effect either from within "ipython -pylab" or > from standalone scripts. > > Any advice would be greatly appreciated, thanks. > > joey > > > import numpy as np > import matplotlib.pyplot as plt > > # example data > x = np.arange(0.1, 4, 0.5) > y = np.exp(-x) > > # example variable error bar values > yerr = 0.1 + 0.2*np.sqrt(x) > xerr = 0.1 + yerr > > # First illustrate basic pyplot interface, using defaults where possible. > plt.figure() > plt.errorbar(x, y, xerr=0.2, yerr=0.4) > plt.title("Simplest errorbars, 0.2 in x, 0.4 in y") > > plt.show() > > Joey, The code works as expected for me. Which version of matplotlib are you using (print matplotlib.__version__)? Ben Root
When I use the errorbar() routine to plot data, unless I set hold=True as a kwarg (or set it globally), the data are plotted without the errorbars. I believe it is because the routine first plots the error bars, then overplots the data points and for some reason the routine is clearing the axis in between these steps. This is rather annoying for interactive use and does not seem to be the expected behavior. For example, if I run the example code from the errorbar page (my copy pasted below), I get a nice plot of the data with no error bars. This seems to be the effect either from within "ipython -pylab" or from standalone scripts. Any advice would be greatly appreciated, thanks. joey import numpy as np import matplotlib.pyplot as plt # example data x = np.arange(0.1, 4, 0.5) y = np.exp(-x) # example variable error bar values yerr = 0.1 + 0.2*np.sqrt(x) xerr = 0.1 + yerr # First illustrate basic pyplot interface, using defaults where possible. plt.figure() plt.errorbar(x, y, xerr=0.2, yerr=0.4) plt.title("Simplest errorbars, 0.2 in x, 0.4 in y") plt.show()
On Wed, Sep 29, 2010 at 3:43 PM, Skip Montanaro <sk...@po...> wrote: > I have a GTK app which runs its matplotlib stuff in a separate > thread. If I call pylab.show() at the end of building the plot > the first time it displays, then after that I have to destroy > the window before it will think about plotting something else, > and it never does (it pretends to - my log message tell me that > it is). If I call pylab.draw() no window is ever displayed. My > GUI is always active. We do not support use of pylab or pyplot embedded in a GUI. Rather, you should embed matplotlib directly using the API. See the embedding_in_gtk* examples at http://matplotlib.sourceforge.net/examples/user_interfaces/index.html JDH
Benjamin Root <ben.root@...> writes: > Which version of matplotlib are you using? According to matplotlib.__version__ I'm running 1.0.svn. > There have been numerous improvements to interactivity and multiple calls > to show() in version 1.0 and beyond.There might still be some issues with > multiple gui event loops that I think is currently being addressed by the > ipython group. I don't know if it matters, but I'm not using ipython, nor am I operating at a >>> prompt. This is a standalone app written with Gtk and matplotlib. Thx, Skip
On Thu, Sep 30, 2010 at 7:17 AM, sa6113 <s.p...@gm...> wrote: > > Thans for your help. > > I don't have mpl_toolkits.axes_grid1 and mpl_toolkits.axisartist modules. > would you please help me to download them. > which release I need to install? > > > axes_grid1 and axisartist were introduced in version 1.0.0. There is an alternate module that existed before v1.0.0 that is very similar: mpl_toolkits.axes_grid, and that might be in the version that you have right now. What version of matplotlib do you have currently and which OS are you using? Ben Root
On Thu, Sep 30, 2010 at 3:28 AM, Alexander Dietz < ale...@go...> wrote: > Hi, > > On Wed, Sep 29, 2010 at 16:00, John Hunter <jd...@gm...> wrote: > >> On Wed, Sep 29, 2010 at 8:50 AM, Alexander Dietz >> <Ale...@go...> wrote: >> >> > print ax.transData.transform((10.0, 20.0)) >> > [ 576. 432.] >> >> >> Why do you say it's wrong? Note that in mpl, (0,0) is (bottom left), >> not (upper,left). So this is saying that the yellow dot at 10,20 >> (data coords) is 576 pixels up from the bottom and 432 pixels over >> from the left. >> > > This is not correct, either. Since the total width of the image is 800 > pixels and the total height is 600 pixels, I get the following coordinates > of the yellow dot: > > x-coord: = 432 > y-coord = 600-576 = 24 > > but in fact, the position of the yellow dot is still at (720, 60)!. (And > even if you swapped x and y coordinates it will never be correct.). > > > So anyone another idea how to transform a data-point (10,20) to the image > coordinates? > > > Cheers > Alex > > Alex, I don't think it is technically possible. Keep in mind that the coordinate system that is used to display figures is merely a convention used by matplotlib and the GUI system. It is not the same transformation that is used when saving images, and nor should it be because of differences between the resolution of your display and the resolution of your image (typically unknown until save time). In addition to that issue is the figure window itself. In particular, the toolbar is also a part of the same display coordinate system. I would also wonder if there might be some horizontal padding going on that is throwing off the x-coordinates. Ben Root
Context: I am using ipython -pylab for interactive figure drawing. I understand that clf() will erase everything, and cla() will empty the interior of the square plot in the last subfigure. But I can't see how to clear the first subfigure or the colorbar. Any changes to the colorbar -- for example, changing ticks or ticklabels -- create an additional colorbar instead of changing the existing one. Q: How do you change the current axis back to a previous one? e.g., so cla() will clear the first subfigure? or clear a colorbar? Q: Besides erasing the entire figure and starting afresh, how can one remove or change selected parts of the figure? Q: is it possible to modify the orientation of cbar once drawn? following the below code with cbar.orientation ='horizontal' plt.draw() plt.show() leaves it unchanged. I'm hoping that answers to this will help orient me to 'the matplotlib way.' If I've overlooked some documentation on these issues (I have looked!), please do point it out. Thank you for your help! ================ Here is my code: ================== #!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np from time import sleep x = np.arange(0, 10, 0.2) y = np.sin(x) fig = plt.figure() ax1 = fig.add_subplot(211) cax1 = ax1.plot(x, y) ax2 = fig.add_subplot(212) A = np.random.random_integers(0, 10, 100).reshape(10, 10) cax2 = ax2.imshow(A, interpolation="nearest",vmin=-1,vmax=11 ) cbar = fig.colorbar(cax2) #cbar = fig.colorbar(cax2, ticks=[0, 5, 10]) plt.savefig('colorbartest.pdf') ====================================================== --
Thans for your help. I don't have mpl_toolkits.axes_grid1 and mpl_toolkits.axisartist modules. would you please help me to download them. which release I need to install? sa6113 wrote: > > I want to use more than 2 axes in my plot, for example yleft,yright, > butoom or top, is it possible? > any body had done it before? > > I read in matplotlib's document that : " matplotlib is organized around > figures and axes. The figure contains an arbitrary number of axes, which > can be placed anywhere in the figure you want, including over other axes. > You can directly create and manage your own figures and axes." > How? > -- View this message in context: http://old.nabble.com/axes-in-matplotlib-tp29810432p29846502.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On Thu, Sep 23, 2010 at 10:31 AM, C M <cmp...@gm...> wrote: > Until a more permanent solution is figured out, can anyone recommend > any workarounds, even if they are a little clunky? I'm embedding mpl > plots in wxPython and am also finding this issue suboptimal. > > Che > A (partial) workaround is possible using the axes_grid1 toolkit (i.e., you need matplotlib 1.0). Attached is a module I just cooked up (based on my previous attempt @ http://www.mail-archive.com/mat...@li.../msg18129.html), and it seems to work quite well. The usage is simple. ax = plt.axes([0,0,1,1]) ax.set_yticks([0.5]) ax.set_yticklabels(["very long label"]) make_axes_area_auto_adjustable(ax) # This is where axes_grid1 comes in Then, the axes area(including ticklabels and axis label) will be automatically adjusted to fit in the given extent ([0, 0, 1, 1] in the above case). While this is mainly for a single axes plot, you may use it with multi-axes plot (but somewhat trickier to use). A few examples are included in the module. Regards, -JJ
Hi, On Wed, Sep 29, 2010 at 16:00, John Hunter <jd...@gm...> wrote: > On Wed, Sep 29, 2010 at 8:50 AM, Alexander Dietz > <Ale...@go...> wrote: > > > print ax.transData.transform((10.0, 20.0)) > > [ 576. 432.] > > > Why do you say it's wrong? Note that in mpl, (0,0) is (bottom left), > not (upper,left). So this is saying that the yellow dot at 10,20 > (data coords) is 576 pixels up from the bottom and 432 pixels over > from the left. > This is not correct, either. Since the total width of the image is 800 pixels and the total height is 600 pixels, I get the following coordinates of the yellow dot: x-coord: = 432 y-coord = 600-576 = 24 but in fact, the position of the yellow dot is still at (720, 60)!. (And even if you swapped x and y coordinates it will never be correct.). So anyone another idea how to transform a data-point (10,20) to the image coordinates? Cheers Alex > > JDH >
On Wed, Sep 29, 2010 at 11:12 PM, Jonathan Slavin <js...@cf...> wrote: > This is interesting. It seems that the event.x, event.y values are for > the entire figure area rather than limited to the image. Anyone know > how to get the image values instead? Typically, images in matplotlib are associated with "data coordinate". And mouse events have "xdata" and "ydata" attributes. However, if you're using imshow with the "extent" keyword, you need one more step. Below is an example. arr = np.arange(10).reshape((2,5)) x1, x2, y1, y2 = [-1.5, 3.5, 2.5, 4.5] imshow(arr, extent=[x1, x2, y1, y2], origin="lower") from matplotlib.transforms import Bbox, BboxTransform bbox_in = Bbox.from_extents([x1, y1, x2, y2]) bbox_out = Bbox.from_bounds(-0.5, -0.5, arr.shape[1], arr.shape[0]) # transform from data coordinate into image coordinate. tr = BboxTransform(bbox_in, bbox_out) print tr.transform_point((-1, 3)) # pixel (0,0) of arr print tr.transform_point((3, 4)) # pixel (4,1) of arr > > Also, I wonder how one might get the values of the pixels (i.e. image > value) at the pixels that you click on. One more thing -- is there a > way to make the cursor be a full plot window cross -- graphically like: > ------------------ > | | | > | | | > | | | > |--------|---------| > | | | > | | | > ------------------ > It makes it easier to align with the axes sometimes (the IDL astronomy > library has a routine called rdplot that does this). > One option is to use "widgets" http://matplotlib.sourceforge.net/examples/widgets/cursor.html Regards, -JJ > Jon > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
On 9/29/10 12:49 PM, Justin McCann wrote: > Not to pile on the "auto-adjust to make labels fit" bandwagon, but > I've been following the FAQ on adjusting the subplot locations to make > room for too-long tick labels: > > http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels > > and have found that the FAQ code isn't very robust. > > For example, if I interactively change the size of the plotting window > so the ylabels touch the left hand side of the window, stretching it > right again pushes the labels and the subplots too far to the right > (see attached 'auto_subplot_adjust.toofar.png'). > > If I make the window too narrow so the figure itself shrinks too much, > it starts to raise 'ValueError: left cannot be>= right' exceptions, > and then really shrinks the plot even more (see attached > 'auto_subplot_adjust.leftright.png'). > > Any suggestions for making this more robust? I made the FAQ entry code a little more general (and hopefully more robust) a while ago. I don't know if it takes care of the problem you're talking about, though. I posted it to the matplotlib-devel mailing list here: http://www.mail-archive.com/mat...@li.../msg05628.html You're welcome to use it, and if it makes more sense than the FAQ entry, whoever does the FAQ is welcome to include it in the FAQ. Jason -- Jason Grout
On Wed, Sep 29, 2010 at 3:43 PM, Skip Montanaro <sk...@po...> wrote: > I have a GTK app which runs its matplotlib stuff in a separate > thread. If I call pylab.show() at the end of building the plot > the first time it displays, then after that I have to destroy > the window before it will think about plotting something else, > and it never does (it pretends to - my log message tell me that > it is). If I call pylab.draw() no window is ever displayed. My > GUI is always active. > > I would like to pop up a new top-level window for each figure. > How do I do that? My current build-a-plot code looks like this: > > figure = pylab.figure() > ax = figure.add_subplot(111) > ax.yaxis.set_major_formatter(pylab.FormatStrFormatter('%.7f')) > ... build dates and prices lists ... > ax.plot(dates, prices) > formatter = matplotlib.dates.DateFormatter('%H:%M:%S') > ax.xaxis.set_major_formatter(formatter) > figure.autofmt_xdate() > ... what goes here? ... > > Instead of show() or draw() as the last line what should I be > doing? > > Thx, > > Skip Montanaro > > Which version of matplotlib are you using? There have been numerous improvements to interactivity and multiple calls to show() in version 1.0 and beyond. There might still be some issues with multiple gui event loops that I think is currently being addressed by the ipython group. Maybe someone else here might be more knowledgeable about that. I hope that helps! Ben Root
I have a GTK app which runs its matplotlib stuff in a separate thread. If I call pylab.show() at the end of building the plot the first time it displays, then after that I have to destroy the window before it will think about plotting something else, and it never does (it pretends to - my log message tell me that it is). If I call pylab.draw() no window is ever displayed. My GUI is always active. I would like to pop up a new top-level window for each figure. How do I do that? My current build-a-plot code looks like this: figure = pylab.figure() ax = figure.add_subplot(111) ax.yaxis.set_major_formatter(pylab.FormatStrFormatter('%.7f')) ... build dates and prices lists ... ax.plot(dates, prices) formatter = matplotlib.dates.DateFormatter('%H:%M:%S') ax.xaxis.set_major_formatter(formatter) figure.autofmt_xdate() ... what goes here? ... Instead of show() or draw() as the last line what should I be doing? Thx, Skip Montanaro
I finished my strip chart widget thanks to help from Tony S Yu, Benjamin Root and others here. It supports multiple subplots and multiple lines/subplot. Here's a copy if anyone is interested: <http://www.astro.washington.edu/users/rowen/python/StripChartWdg.py> I plan to add it to the RO python package once I have tested it a bit more. Meanwhile, the example code at the end uses a prerelease RO module that I've also uploaded: <http://www.astro.washington.edu/users/rowen/python/RandomWalk.py> It uses the TkAgg back end, but is easily ported (as usual, event timing is the main issue; I wish Python had its own event model that all GUIs could use). I think I finally got the animation API figured out well enough to produce a robust result. Strip charts are intrinsically poor candidates for the animation API because the time axis is constantly shifting, but nonetheless animation does produce a small reduction in CPU usage. Any feedback would be most welcome. Regards, -- Russell
Not to pile on the "auto-adjust to make labels fit" bandwagon, but I've been following the FAQ on adjusting the subplot locations to make room for too-long tick labels: http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels and have found that the FAQ code isn't very robust. For example, if I interactively change the size of the plotting window so the ylabels touch the left hand side of the window, stretching it right again pushes the labels and the subplots too far to the right (see attached 'auto_subplot_adjust.toofar.png'). If I make the window too narrow so the figure itself shrinks too much, it starts to raise 'ValueError: left cannot be >= right' exceptions, and then really shrinks the plot even more (see attached 'auto_subplot_adjust.leftright.png'). Any suggestions for making this more robust? Justin
If you're just looking for the dimensions of the overall figure in pixels, you can easily access them through other means. E.g: import matplotlib.pyplot as plt fig = plt.figure() _, _, width, height = fig.bbox.extents # <- Extent of the figure in pixels fig.savefig('temp.png', dpi=fig.dpi) # <- Be sure to specify the dpi!! Note that you'll have to specify that you want to save the figure at the same DPI it was when you called the extents... The figure will be saved with whatever default DPI is in your .matplotlibrc, which is commonly different than the default screen dpi (80). Hope that helps, -Joe On Wed, Sep 29, 2010 at 9:44 AM, Alexander Dietz < ale...@go...> wrote: > Hi, > > On Wed, Sep 29, 2010 at 16:00, John Hunter <jd...@gm...> wrote: > >> On Wed, Sep 29, 2010 at 8:50 AM, Alexander Dietz >> <Ale...@go...> wrote: >> >> > print ax.transData.transform((10.0, 20.0)) >> > [ 576. 432.] >> >> >> Why do you say it's wrong? Note that in mpl, (0,0) is (bottom left), >> not (upper,left). So this is saying that the yellow dot at 10,20 >> (data coords) is 576 pixels up from the bottom and 432 pixels over >> from the left. >> > > > ok maybe it is. But then I need the size of the entire figure written to a > file. How can I find out the pixel-size of the entire figure, inclusive > every title, axis, labels... > > > Thanks > Alex > > > >> >> JDH >> > > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Hi all, if I plot an normal figure the toolbar contains an button (looks like a checkbox), which can be used to edit the lines and axes parameters. But when I embed such a figure in an Wx application, this specfic button is missing. Is there a way around it? Thanks for your help, Sebi Parts of the Code: import wx import os import numpy as np import wx.grid import filtertools as ft # Matplotlib Figure object from matplotlib.figure import Figure # import the WxAgg FigureCanvas object, that binds Figure to # WxAgg backend --> a wxPanel from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas # import the NavigationToolbar WxAgg widget from matplotlib.backends.backend_wx import NavigationToolbar2Wx .... class MplPanel(wx.Panel): def __init__(self, *args, **kwds): wx.Panel.__init__(self, *args, **kwds) self.__set_properties() self.__do_layout() self.figure = Figure(figsize=(sizex, sizey), dpi=res) self.axes = self.figure.add_subplot(111) self.axes.set_xticks(np.arange(self.xmin_limit, self.xmax_limit, 20)) self.axes.set_yticks(np.arange(self.ymin, self.ymax, 0.1)); self.axes.axis([self.xmin,self.xmax,self.ymin,self.ymax]) self.axes.grid(True) self.axes.set_xlabel('Wavelength [nm]',fontsize=14) self.axes.set_ylabel('Transmission [%] or Intensity [a.u.]',fontsize=14) self.figure.subplots_adjust(left=0.07, bottom=0.09, right=0.97, top=0.94,wspace=0.20, hspace=0.20) self.canvas = FigureCanvas(self, wx.ID_ANY, self.figure) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.EXPAND) self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND) self.toolbar.Show() self.SetSizer(self.sizer) self.Fit() ... -- Dr. Sebastian Rhode Grünwalder Str. 103a 81547 München Tel: +49 89 4703091 Mobil: +49 15122810945 seb...@go...
Hi, On Wed, Sep 29, 2010 at 16:00, John Hunter <jd...@gm...> wrote: > On Wed, Sep 29, 2010 at 8:50 AM, Alexander Dietz > <Ale...@go...> wrote: > > > print ax.transData.transform((10.0, 20.0)) > > [ 576. 432.] > > > Why do you say it's wrong? Note that in mpl, (0,0) is (bottom left), > not (upper,left). So this is saying that the yellow dot at 10,20 > (data coords) is 576 pixels up from the bottom and 432 pixels over > from the left. > ok maybe it is. But then I need the size of the entire figure written to a file. How can I find out the pixel-size of the entire figure, inclusive every title, axis, labels... Thanks Alex > > JDH >
On Wed, Sep 29, 2010 at 4:21 AM, Ruggero <giu...@gm...> wrote: > I'm using matplotlib 0.9, is there a best way to do this: > > > for labeltick in ax.xaxis.get_majorticklabels() + > ax.yaxis.get_majorticklabels(): > labeltick.set_fontsize(15) > > > I can't do: > ax.tick_params(labelsize=15) as here: > > http://matplotlib.sourceforge.net/api/axes_api.html?highlight=ticklabel_format#matplotlib.axes.Axes.tick_params > > is it a new feature? > > Yes, this is a new feature for v1.0.0 because setting parameters for ticks have been so difficult and confusing in the past. The way you have it right now for version 0.9 is the "correct" way to do it for that version. Ben Root