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
(3) |
2
(9) |
3
(6) |
4
(2) |
5
(19) |
6
(7) |
7
(3) |
8
(5) |
9
(6) |
10
(13) |
11
(19) |
12
(16) |
13
(9) |
14
(17) |
15
(5) |
16
(12) |
17
(12) |
18
(5) |
19
(16) |
20
(10) |
21
(9) |
22
(3) |
23
(8) |
24
(5) |
25
(13) |
26
(11) |
27
(21) |
28
(9) |
29
(11) |
30
(6) |
31
(5) |
|
|
|
|
Hi all, I've to draw a plot in a very small area (about 1 degree of height/width) with a map image. I've tried with the warpimage method and with the Nasa visible Earth images (http://visibleearth.nasa.gov/view_cat.php?categoryID=1484), but I've some problems: - with the resolution 21600x10800 the image is still too bad - with the resolution 21600x21600 the image is distributed in panels and warpimage method required a whole world image Merging the 6 panels maybe it can works, but I think my laptop can't process a so big image. Any suggestion for cutting the image area before passing it to Basemap? Or another kind of images to use? Thank you very much, -- | Francesco Benincasa
2012年6月20日 Michael Droettboom <md...@st...>: > The postscript output of the Cairo backend supports transparency > emulation, though it hasn't been tested in some time. Eric's suggestion > (to output PDF and then convert to EPS) is also a reasonable one. > > Mike > > On 06/20/2012 10:38 AM, Francesco Montesano wrote: >> Dear list, >> >> it might be that this is not the best place to ask, but I guess that >> there are enough people with experience with colors. >> >> I think plots with nice colors and shaded areas are very nice, but for >> my publication I have to use eps files, that do not support >> transparency. >> The script below produce a figure like the one that I would like to >> make. If I save it as eps all the shaded areas are not transparent and >> the plot look ugly and unreadable. >> >> A way to emulate transparency that I've applied some time ago was to >> get the RGB value of the transparent color (with DigitalColor Meter on >> Mac) and to insert it by hand in fill_between, with a low value for >> the zorder option. The results was fine, but I don't like too much >> this approach, as any change in color or alpha value would require to >> go, get the new color, insert it and redo the figure. >> >> Is anyone aware of a way to obtain automatically a RGB color that on >> screen or printed looks similar to the corresponding RGBA? >> >> Thanks in advance, >> Francesco >> >> ********Sample code********* >> >> "plot with errors done with fill_between. Emulation of alpha in eps" >> >> import itertools as it >> import matplotlib.pyplot as plt >> import numpy as np >> >> col = it.cycle([ 'm', 'r', 'g', 'b', 'c', 'y', 'k', ]) >> ls = it.cycle( [ '-', '--', '-.', ':' ][::-1]) >> >> #figure >> fig = plt.figure() >> ax = fig.add_subplot(111) >> >> x= np.linspace(0.5,5,100) >> for i in range(3): >> c = col.next() >> l = ls.next() >> ax.plot( x, np.sin(x)**i, color=c, ls=l, >> label='$sin^{0}(x)$'.format(i), zorder=10+i ) >> ax.fill_between( x, np.sin(x)**i + 1./x, np.sin(x)**i - 1./x, >> color=c, linestyle=l, alpha=0.5, zorder=i+1) >> >> ax.legend(frameon=False) >> >> plt.savefig("test_alpha.pdf") >> plt.savefig("test_alpha.eps") >> plt.show() >> >> exit() >> ********End sample code********* >> Hi, I was doing again some search on the topic when I realised that I just replied to Eric. This is my reply (Eric sorry for sending this mail twice to you) I remember trying to convert pdf to eps in different ways with usually ugly results and/or very large files. Now I've tried the following commands on test_alpha.pdf (from http://tex.stackexchange.com/questions/20883/how-to-convert-pdf-to-eps): i) pdf2ps -eps test_alpha.pdf test_alpha.conv.eps ii) gs -q -dNOCACHE -dNOPAUSE -dBATCH -dSAFER -sDEVICE=epswrite -sOutputFile=test_alpha.gs.eps test_alpha.pdf the results are: 39K 2012年06月19日 17:37 test_alpha.eps (original eps: no transparency) 23K 2012年06月19日 17:37 test_alpha.pdf (original pdf: transparency) 90M 2012年06月20日 20:20 test_alpha.gs.eps (converted with gs: transparency) 613K 2012年06月20日 20:14 test_alpha.pdf2ps.eps (converted with pdf2ps: transparency [from my understanding it uses gs]) In both the converted cases the texts (tick labels, legend) are badly rendered. The lines and contours of the filled areas look noisier than in the original pdf. It might be that increasing the resolution the situation improves, but the file size increases, which is not an option. Michael, I've tried Cairo (import matplotlib as mpl; mpl.use("Cairo") before importing pyplot), but the eps is not transparent. Cheers, Francesco
On Mon, Jul 16, 2012 at 11:09 AM, Benjamin Jonen <bj...@gm...> wrote: > 2) The coloring and the way the lines curve around looks very nice to > me. I remember that the Excel charts did not have this nice look > before Excel 2007. Can I achieve similar effects with matplotlib? I'm > not really sure what creates this nice look, so this question is of > course a little fuzzy. Maybe you are thinking about the smoothness of the curves. Even you have spaced points, they don't do sharp edges. In my opinion, for scientific research, they shouldn't be concealed in the general case, and this is, I think, the main target of MPL. Nevertheless, if in your case it makes sense and you want them to be smooth, you can do it through SciPy, applying a interpolation scheme. tck=scipy.interpolate(datax, datay) datax_n=np.arange(datax.min(), datax.max(), len(datax)*20) datay_n=sicpy.interpolate(splev(datax_n,tck,der=0) And then you plot datax_n and datay_n. http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html#spline-interpolation-in-1-d-procedural-interpolate-splxxx
Hey everybody, Before I made the change to matplotlib I used to do my charts in MS Excel 2007. I have been using matplotlib for a while now but haven't been able to replicate my graphs in the same beauty (for an example see the attachment). 1) Can I generate additional line styles beyond [ ‘-‘ | ‘–’ | ‘-.’ | ‘:’ | ‘steps’ | ...]? For example the empty line for value 9 in the chart would be very nice to have. 2) The coloring and the way the lines curve around looks very nice to me. I remember that the Excel charts did not have this nice look before Excel 2007. Can I achieve similar effects with matplotlib? I'm not really sure what creates this nice look, so this question is of course a little fuzzy. These questions are not meant as a criticism. I enjoy using matplotlib and I am very grateful this amazing tool has been developed. The latex integration is a clear advantage over excel. If matplotlib becomes equal or better in look to excel charts the incentives for excel users to convert will be even stronger. Thanks for any answers/thoughts, Benjamin
Hello again, I found that the crash is a PySide 1.1.0 bug: https://groups.google.com/forum/?fromgroups#!topic/pyside/dNSzyupTFMU It seems to be fixed in newer versions of PySide. Until I get it packaged on my ubuntu I have to change my code like this: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as _NavigationToolbar from matplotlib.backends.backend_qt4 import cursord from PySide.QtGui import QWidget, QVBoxLayout, QApplication, QCursor class NavigationToolbar(_NavigationToolbar): def set_cursor( self, cursor ): QApplication.restoreOverrideCursor() qcursor = QCursor() qcursor.setShape(cursord[cursor]) QApplication.setOverrideCursor( qcursor ) ----- Mail original ----- De: "julien parc" <jul...@fr...> À: mat...@li... Envoyé: Dimanche 15 Juillet 2012 12:07:33 Objet: [Matplotlib-users] core dumped using NavigationToolbar with PySide Hello, I think I found a bug using NavigationToolbar with Pyside. ******** my system ******** OS: ubuntu 12.04 `uname -a`: Linux parcouss-M720T-M730T 3.2.0-26-generic-pae #41-Ubuntu SMP Thu Jun 14 16:45:14 UTC 2012 i686 i686 i386 GNU/Linux matplotlib version: 1.1.1rc (ubuntu distribution package) PySide version: 1.1.0 (ubuntu distribution package) ******** how to reproduce the bug ******** Here is a simple script to get the core dumped crash: import matplotlib matplotlib.use('Qt4Agg') matplotlib.rcParams['backend.qt4']='PySide' from matplotlib.figure import Figure from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar from PySide.QtGui import QWidget, QVBoxLayout , QApplication import sys class Main(QWidget): def __init__(self): QWidget.__init__(self) self.setLayout(QVBoxLayout()) self.canvas = FigureCanvas(Figure()) self.toolbar = NavigationToolbar(self.canvas, self) self.layout().addWidget(self.toolbar) self.layout().addWidget(self.canvas) if __name__ == '__main__': app = QApplication(sys.argv) m = Main() m.show() app.exec_() It may be relative to a mousemoveent, as it does not crash until I move the mouse on the window. Julien Pages BTW: thanks to the really great matplotlib framework :) ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hello, I think I found a bug using NavigationToolbar with Pyside. ******** my system ******** OS: ubuntu 12.04 `uname -a`: Linux parcouss-M720T-M730T 3.2.0-26-generic-pae #41-Ubuntu SMP Thu Jun 14 16:45:14 UTC 2012 i686 i686 i386 GNU/Linux matplotlib version: 1.1.1rc (ubuntu distribution package) PySide version: 1.1.0 (ubuntu distribution package) ******** how to reproduce the bug ******** Here is a simple script to get the core dumped crash: import matplotlib matplotlib.use('Qt4Agg') matplotlib.rcParams['backend.qt4']='PySide' from matplotlib.figure import Figure from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar from PySide.QtGui import QWidget, QVBoxLayout , QApplication import sys class Main(QWidget): def __init__(self): QWidget.__init__(self) self.setLayout(QVBoxLayout()) self.canvas = FigureCanvas(Figure()) self.toolbar = NavigationToolbar(self.canvas, self) self.layout().addWidget(self.toolbar) self.layout().addWidget(self.canvas) if __name__ == '__main__': app = QApplication(sys.argv) m = Main() m.show() app.exec_() It may be relative to a mousemoveent, as it does not crash until I move the mouse on the window. Julien Pages BTW: thanks to the really great matplotlib framework :)
got it, thanks. -- View this message in context: http://old.nabble.com/axes3d%2C-initial-azimuth-and-elevation-tp34161970p34162843.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On Saturday, July 14, 2012, gsal wrote: > > So, I have > > [code] > > from mpl_toolkits.mplot3d import axes3d > fig = plt.figure(figsize=(10,7)) > ax = fig.gca(projection='3d') > ax.scatter(xs, ys, zs, c='r') > plt.show() > > [/code] > > but when the figure first comes up, it is not to my liking; when I > interactively (with the mouse) move it around to my liking, the lower right > corner of the window displays: "azimuth=20 deg, elevation=35 deg... > > ...how can I achieve my desired azimuth, elevation from the beginning? is > it > possible to set it up? I search the on-line docs and found nothing. > > thanks, > > gsal Yes, it is possible. You can use the view_init() method of your axes object. Ben Root
On Sat, Jul 14, 2012 at 04:09:48PM -0400, Benjamin Root wrote: > On Saturday, July 14, 2012, John Hunter wrote: > > > > > > > On Sat, Jul 14, 2012 at 11:48 AM, John Hunter <jd...@gm...<javascript:_e({}, 'cvml', 'jd...@gm...');> > > > wrote: > > > >> I do not understand why in the following example, if I set > >> patch_alpha=1.0, I do not see the shadow effect. I would expect to see it > >> for the the rightmost four bars, where the original bars do not entirely > >> occlude the shadow, so even if alpha is 1.0, there are parts of the shadow > >> that are not behind the original bars and should still be visible. > >> > >> > >> > > > > I now see that this line explains the behavior > > > > > > https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/patheffects.py#L183 > > > > gc0.set_alpha(1.-self._patch_alpha) > > > > so maybe I should amend my question: is this desirable that the shadow > > alpha is 1-patch_alpha, since an alpha of 1 on the patch does not imply > > that there is no visible shadow? > > > > > > I would argue that the shadow's alpha should equal the patch's alpha. The > more opaque the patch, the less light that should get through. Could there I am inclined to agree here. Should it instead be: gc0.set_alpha(self._patch_alpha)? > have been an alpha blending reason for this? > > Ben Root -- Damon McDougall http://damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom
So, I have [code] from mpl_toolkits.mplot3d import axes3d fig = plt.figure(figsize=(10,7)) ax = fig.gca(projection='3d') ax.scatter(xs, ys, zs, c='r') plt.show() [/code] but when the figure first comes up, it is not to my liking; when I interactively (with the mouse) move it around to my liking, the lower right corner of the window displays: "azimuth=20 deg, elevation=35 deg... ...how can I achieve my desired azimuth, elevation from the beginning? is it possible to set it up? I search the on-line docs and found nothing. thanks, gsal -- View this message in context: http://old.nabble.com/axes3d%2C-initial-azimuth-and-elevation-tp34161970p34161970.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On Saturday, July 14, 2012, John Hunter wrote: > > > On Sat, Jul 14, 2012 at 11:48 AM, John Hunter <jd...@gm...<javascript:_e({}, 'cvml', 'jd...@gm...');> > > wrote: > >> I do not understand why in the following example, if I set >> patch_alpha=1.0, I do not see the shadow effect. I would expect to see it >> for the the rightmost four bars, where the original bars do not entirely >> occlude the shadow, so even if alpha is 1.0, there are parts of the shadow >> that are not behind the original bars and should still be visible. >> >> >> > > I now see that this line explains the behavior > > > https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/patheffects.py#L183 > > gc0.set_alpha(1.-self._patch_alpha) > > so maybe I should amend my question: is this desirable that the shadow > alpha is 1-patch_alpha, since an alpha of 1 on the patch does not imply > that there is no visible shadow? > > I would argue that the shadow's alpha should equal the patch's alpha. The more opaque the patch, the less light that should get through. Could there have been an alpha blending reason for this? Ben Root
On Sat, Jul 14, 2012 at 11:48 AM, John Hunter <jd...@gm...> wrote: > I do not understand why in the following example, if I set > patch_alpha=1.0, I do not see the shadow effect. I would expect to see it > for the the rightmost four bars, where the original bars do not entirely > occlude the shadow, so even if alpha is 1.0, there are parts of the shadow > that are not behind the original bars and should still be visible. > > > I now see that this line explains the behavior https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/patheffects.py#L183 gc0.set_alpha(1.-self._patch_alpha) so maybe I should amend my question: is this desirable that the shadow alpha is 1-patch_alpha, since an alpha of 1 on the patch does not imply that there is no visible shadow?
I do not understand why in the following example, if I set patch_alpha=1.0, I do not see the shadow effect. I would expect to see it for the the rightmost four bars, where the original bars do not entirely occlude the shadow, so even if alpha is 1.0, there are parts of the shadow that are not behind the original bars and should still be visible. import matplotlib.pyplot as plt import matplotlib.patheffects as PathEffects import numpy as np np.random.seed(2358) fig = plt.figure() # sime bar shadows x = np.random.randn(1000) n, bins, patches = plt.hist(x, bins=7) shadow = PathEffects.withSimplePatchShadow(offset_xy=(10,-10), patch_alpha=0.8, shadow_rgbFace=(0.25,0.25,0.25)) for p in patches: p.set_path_effects([shadow]) plt.show()
On 7/14/12 8:27 AM, Stefan Mertl wrote: > What's the reason for the reduction to 0/0? I'm going to create some > interactive maps. For this it would be easier to have the original > projected coordinates as the coordinates of the map axes. > Would it be possible to add a flag to decide if the coordinates should > be reduced or not? > > Regards, > Stefan. Stefan: I had to standardize the plotting methods around a specific convention, and that seemed as good a one as any. I would suggest you override __call__ method to do the transformation for you (as illustrated in the utmtest.py example). -Jeff > > On Fri, 2012年07月13日 at 21:26 -0600, Jeff Whitaker wrote: >> On 7/13/12 8:18 AM, Stefan Mertl wrote: >>> The UTM support is great. Thanks for that. >>> Is there a possibility to display the projected coordinates without the >>> reduction of the x/y coordinates to 0/0 in the left bottom corner? >>> >>> Regards >>> Stefan. >> Stefan: No - that's the only coordinate system Basemap supports. >> >> -Jeff >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >
What's the reason for the reduction to 0/0? I'm going to create some interactive maps. For this it would be easier to have the original projected coordinates as the coordinates of the map axes. Would it be possible to add a flag to decide if the coordinates should be reduced or not? Regards, Stefan. On Fri, 2012年07月13日 at 21:26 -0600, Jeff Whitaker wrote: > On 7/13/12 8:18 AM, Stefan Mertl wrote: > > The UTM support is great. Thanks for that. > > Is there a possibility to display the projected coordinates without the > > reduction of the x/y coordinates to 0/0 in the left bottom corner? > > > > Regards > > Stefan. > > Stefan: No - that's the only coordinate system Basemap supports. > > -Jeff > > > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. Discussions > > will include endpoint security, mobile security and the latest in malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Hi Josh, I am not quite sure what information you need, but I have an application with several wx notebooks, each with pages carrying related but different 2D and 3D plots. I hope this overview covers what you want. In the code below I set up the axes and toolbar in each panel ready to accept plots as required. I use wxFormbuilder to create MyFrame1 and then this code to add graphs and other functionality. The 'tickle' function is called when a notebook is selected for display. import wx from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg from matplotlib.figure import Figure from mpl_toolkits.mplot3d import Axes3D class ProjectFrame(bare_gui.MyFrame1): def __init__( self, parent): bare_gui.MyFrame1.__init__( self, parent) ... self.Create2DGraph(self.CT_graph_1, "Current / %")#CT notebook self.Create2DGraph(self.VT_graph_1, "Voltage/ %")#VT notebook ... self.Show(True) def Create2DGraph(self, panel, xlabel): panel.figure = Figure(None) panel.canvas = FigureCanvas(panel, -1, panel.figure) panel.axes1 = panel.figure.add_subplot(2,1,1) panel.axes2 = panel.figure.add_subplot(2,1,2) panel.axes1.set_xlabel(xlabel) panel.axes1.set_ylabel('Error / %') panel.axes2.set_xlabel(xlabel) panel.axes2.set_ylabel('Phase / crad') panel.sizer = wx.BoxSizer(wx.VERTICAL) panel.sizer.Add(panel.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) panel.SetSizer(panel.sizer) panel.Fit() self.add_2Dtoolbar(panel) def add_2Dtoolbar(self, panel): panel.toolbar = NavigationToolbar2WxAgg(panel.canvas) panel.toolbar.Realize() tw, th = panel.toolbar.GetSizeTuple() fw, fh = panel.canvas.GetSizeTuple() panel.toolbar.SetSize(wx.Size(fw, th)) panel.sizer.Add(panel.toolbar, 0, wx.LEFT | wx.EXPAND) # update the axes menu on the toolbar panel.toolbar.update() def Create3DGraph(self, panel): panel.figure = Figure(None) panel.canvas = FigureCanvas(panel, -1, panel.figure) panel.ax = Axes3D(panel.figure) #these labels should be selected later for specific components panel.ax.set_xlabel('Current / %') panel.ax.set_ylabel('Phase / degree') panel.ax.set_zlabel('Error / %') panel.sizer = wx.BoxSizer(wx.VERTICAL) panel.sizer.Add(panel.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) panel.SetSizer(panel.sizer) panel.Fit() self.add_2Dtoolbar(panel) ________________________________ From: Joshua Koehler [jjk...@gm...] Sent: Friday, 13 July 2012 10:45 p.m. To: mat...@li... Subject: Re: [Matplotlib-users] wxpython matplotlib figure resize Hi Keith, How are you storing the plot in the frame/panel? Josh On Jul 12, 2012, at 11:59 PM, Keith Jones wrote: Hi Josh, Yes I too am using the wx backend. Regards, Keith ________________________________ From: Tony Yu [mailto:ts...@gm...] Sent: Friday, 13 July 2012 3:16 p.m. To: Keith Jones Cc: Joshua Koehler; mat...@li...<mailto:mat...@li...> Subject: Re: [Matplotlib-users] wxpython matplotlib figure resize On Thu, Jul 12, 2012 at 9:27 PM, Keith Jones <K....@ir...<mailto:K....@ir...>> wrote: Hi, I am interested in a better solution to this problem, but I have used this simple method to force the right size. def tickle(self): #gets frame to redraw and resize, not elegant. if self.IsMaximized(): #then needs a kick self.Restore() self.Maximize() else: x,y = self.GetSize() self.SetSize((x-1, y-1)) self.SetSize((x, y)) Regards, Keith ________________________________ From: Joshua Koehler [mailto:jjk...@gm...<mailto:jjk...@gm...>] Sent: Saturday, 7 July 2012 1:51 a.m. To: mat...@li...<mailto:mat...@li...> Subject: [Matplotlib-users] wxpython matplotlib figure resize Hi all, I am currently trying to use matplotlib with wxPython and all is going well except for one annoying issue that I can't figure out. I initialize a wxcanvas object with a figure and then throughout the life of the program I want the canvas' figure to change and display the corresponding plot. I can get the change of figure, but when the program goes to plot, the figure isn't the right size. It changes to the right size only when I manually resize the figure (see attached images). Is there some command that I am missing? This is the update sequence I am using: self.figure = figure self.canvas.figure.clear() self.canvas.figure = self.figure self.canvas.draw() self.color_background() #self.GetParent().Layout() #self.SetSizer(self.main_sizer) #self.Fit() self.SendSizeEvent() As you can tell from the comments (there are more in my code), I have tried a variety of ways to update the figure off the bat. Thanks! Josh This may be similar to a Qt-backend bug, which didn't take the toolbar into account when resizing the figure: https://github.com/matplotlib/matplotlib/pull/756 It doesn't quite fit, though, because Josh's original example shows a figure that's the correct size (but the axes doesn't fill the figure). The toolbar issue tended to squish the axes in the vertical direction (at least in the GUI window), whereas Josh's example is squished in the horizontal direction. Keith: Are you also using the Wx-backend? I don't have Wx installed so I can't provide much help. I've been planning to take a look at a similar issue in the Tk backend, but haven't had time. Best, -Tony ________________________________ This electronic transmission and any documents accompanying this electronic transmission contain confidential information belonging to the sender. This information may be legally privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited.
On 7/13/12 8:18 AM, Stefan Mertl wrote: > The UTM support is great. Thanks for that. > Is there a possibility to display the projected coordinates without the > reduction of the x/y coordinates to 0/0 in the left bottom corner? > > Regards > Stefan. Stefan: No - that's the only coordinate system Basemap supports. -Jeff > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On Fri, Jul 13, 2012 at 7:01 PM, Damon McDougall <dam...@gm...>wrote: > On Wed, Jul 11, 2012 at 08:33:21PM -0400, Tony Yu wrote: > > On Wed, Jul 11, 2012 at 2:28 PM, Benjamin Root <ben...@ou...> wrote: > > > > > > > > > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> > wrote: > > > > > >> > > >> > > >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > > >> dam...@gm...> wrote: > > >>> > > >>> Well, as Ben said, that error fill plot is neato! It doesn't look too > > >>> complicated, either. I'd be more than happy to port it over later > today > > >>> when I get bored of typing up my thesis. It'll probably only take me > > >>> about 30 minutes. > > >>> > > >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this > > >>> evening (British Summer (hah!) Time). > > >>> > > >> > > >> > > >> While it is a nice graph, I am not sure that the use case is common > > >> enough to justify a new plotting method. One can get the same result > with: > > >> > > >> > > >> In [68]: x = np.linspace(0, 2 * np.pi) > > >> > > >> In [69]: y_sin = np.sin(x) > > >> > > >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > >> > > >> In [71]: plot(x, y_sin) > > >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > >> > > >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > > >> facecolor='red', alpha=0.5) > > >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > >> > > >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather > than > > >> adding a new plotting method, perhaps we would be better off with a > helper > > >> method to create the xs and ys for fill_between > > >> > > >> xs, ys = mlab.pad_line(x, y, 0.2) > > >> fill_between(xs, ys) > > >> > > >> JDH > > >> > > > > > > > > > I could definitely agree with a pad_line() function. We might want to > > > revisit the issue of how much visibility the mlab module should get in > the > > > documentation (it currently doesn't get much at all). My whole take on > > > mlab was that it was a left-over from the days of working around > issues in > > > NumPy and SciPy and that it was being slowly phased out. As for other > > > possible locations, cbook feels like it is more for the devs than for > the > > > users, and adding it to pyplot would render the whole purpose of > creating > > > this function as opposed to errorfill moot. > > > > > > As an additional point about such a pad_line function, it should > probably > > > be nice to mirror the errorbar() functionality to allow not only a > constant > > > error, but also a N, Nx1, or 2xN array of +/- error. (note that > errorbar() > > > for the 2xN array case does -row1 and +row2). > > > > > > > Damon: it sounds like you're volunteering to submit a PR to add this > > function ;) > > > > Here's the relevant bit (which should already handle the cases Ben > mentions > > above): > > > > > > > https://github.com/tonysyu/mpltools/blob/master/mpltools/special/errorfill.py#L54 > > > > Great. I've basically done this. I have one suggestion, though. In the > case where len(zerr) == 2, you are setting > > zmin, zmax = zerr > > I think it makes more sense to set > > zmin, zmax = z - zerr[0], z + zerr[1] > > What do you think? > Your suggestion would be consistent with how errorbar() works, I think. Ben Root
On Wed, Jul 11, 2012 at 08:33:21PM -0400, Tony Yu wrote: > On Wed, Jul 11, 2012 at 2:28 PM, Benjamin Root <ben...@ou...> wrote: > > > > > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> wrote: > > > >> > >> > >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > >> dam...@gm...> wrote: > >>> > >>> Well, as Ben said, that error fill plot is neato! It doesn't look too > >>> complicated, either. I'd be more than happy to port it over later today > >>> when I get bored of typing up my thesis. It'll probably only take me > >>> about 30 minutes. > >>> > >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this > >>> evening (British Summer (hah!) Time). > >>> > >> > >> > >> While it is a nice graph, I am not sure that the use case is common > >> enough to justify a new plotting method. One can get the same result with: > >> > >> > >> In [68]: x = np.linspace(0, 2 * np.pi) > >> > >> In [69]: y_sin = np.sin(x) > >> > >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > >> > >> In [71]: plot(x, y_sin) > >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > >> > >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > >> facecolor='red', alpha=0.5) > >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > >> > >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather than > >> adding a new plotting method, perhaps we would be better off with a helper > >> method to create the xs and ys for fill_between > >> > >> xs, ys = mlab.pad_line(x, y, 0.2) > >> fill_between(xs, ys) > >> > >> JDH > >> > > > > > > I could definitely agree with a pad_line() function. We might want to > > revisit the issue of how much visibility the mlab module should get in the > > documentation (it currently doesn't get much at all). My whole take on > > mlab was that it was a left-over from the days of working around issues in > > NumPy and SciPy and that it was being slowly phased out. As for other > > possible locations, cbook feels like it is more for the devs than for the > > users, and adding it to pyplot would render the whole purpose of creating > > this function as opposed to errorfill moot. > > > > As an additional point about such a pad_line function, it should probably > > be nice to mirror the errorbar() functionality to allow not only a constant > > error, but also a N, Nx1, or 2xN array of +/- error. (note that errorbar() > > for the 2xN array case does -row1 and +row2). > > > > Damon: it sounds like you're volunteering to submit a PR to add this > function ;) > > Here's the relevant bit (which should already handle the cases Ben mentions > above): > > > https://github.com/tonysyu/mpltools/blob/master/mpltools/special/errorfill.py#L54 > Great. I've basically done this. I have one suggestion, though. In the case where len(zerr) == 2, you are setting zmin, zmax = zerr I think it makes more sense to set zmin, zmax = z - zerr[0], z + zerr[1] What do you think? > It needs a docstring and a home (pyplot.py?). I kind of think `offset_line` > is more explicit than `pad_line` (both of these are *much* better than my > original `extrema_from_error_input`). > > Cheers, > -Tony > > > > Cheers! > > Ben Root > > > > Best, Damon -- Damon McDougall http://damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom
The UTM support is great. Thanks for that. Is there a possibility to display the projected coordinates without the reduction of the x/y coordinates to 0/0 in the left bottom corner? Regards, Stefan.
On Jul 13, 2012, at 7:57 AM, Benjamin Root <ben...@ou...> wrote: > There was talk of this living in mlab or cbook. Is there a preference? > > > Neither. cbook is really meant more for the devs. Half of it is converter functions that are probably completely unneeded now, while the other half is the callback registry. I disagree that cbook is meant for devs. I initially used cbook as a place to put neat recipes from the python cookbook. It has grown a bit from there. The stuff that is in there like "is_string_like" is generically useful. The converters are used by the rec2* funcs, eg the rec2excel function in the exceltools toolkit. I use these extensively. > Luckily, the module is called "cbook.py", so one could pretend that it isn't "cookbook" but rather "callback book"... > > Meanwhile, mlab's own documentation says: "Numerical python functions written for compatability with MATLAB > commands with the same names." So, unless someone can find out if MATLAB has some sort of equivalent functionality hidden away somewhere, it doesn't belong there either. > Or better, we change the docstring. I think of mlab as a place to put numerical or semi-numerical stuff in support of plotting. > Not sure where to put it. mlab is probably the best place.
On Thu, Jul 12, 2012 at 3:33 PM, Damon McDougall <dam...@gm...>wrote: > On Wed, Jul 11, 2012 at 08:33:21PM -0400, Tony Yu wrote: > > On Wed, Jul 11, 2012 at 2:28 PM, Benjamin Root <ben...@ou...> wrote: > > > > > > > > > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> > wrote: > > > > > >> > > >> > > >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > > >> dam...@gm...> wrote: > > >>> > > >>> Well, as Ben said, that error fill plot is neato! It doesn't look too > > >>> complicated, either. I'd be more than happy to port it over later > today > > >>> when I get bored of typing up my thesis. It'll probably only take me > > >>> about 30 minutes. > > >>> > > >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this > > >>> evening (British Summer (hah!) Time). > > >>> > > >> > > >> > > >> While it is a nice graph, I am not sure that the use case is common > > >> enough to justify a new plotting method. One can get the same result > with: > > >> > > >> > > >> In [68]: x = np.linspace(0, 2 * np.pi) > > >> > > >> In [69]: y_sin = np.sin(x) > > >> > > >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > >> > > >> In [71]: plot(x, y_sin) > > >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > >> > > >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > > >> facecolor='red', alpha=0.5) > > >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > >> > > >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather > than > > >> adding a new plotting method, perhaps we would be better off with a > helper > > >> method to create the xs and ys for fill_between > > >> > > >> xs, ys = mlab.pad_line(x, y, 0.2) > > >> fill_between(xs, ys) > > >> > > >> JDH > > >> > > > > > > > > > I could definitely agree with a pad_line() function. We might want to > > > revisit the issue of how much visibility the mlab module should get in > the > > > documentation (it currently doesn't get much at all). My whole take on > > > mlab was that it was a left-over from the days of working around > issues in > > > NumPy and SciPy and that it was being slowly phased out. As for other > > > possible locations, cbook feels like it is more for the devs than for > the > > > users, and adding it to pyplot would render the whole purpose of > creating > > > this function as opposed to errorfill moot. > > > > > > As an additional point about such a pad_line function, it should > probably > > > be nice to mirror the errorbar() functionality to allow not only a > constant > > > error, but also a N, Nx1, or 2xN array of +/- error. (note that > errorbar() > > > for the 2xN array case does -row1 and +row2). > > > > > > > Damon: it sounds like you're volunteering to submit a PR to add this > > function ;) > > > > Here's the relevant bit (which should already handle the cases Ben > mentions > > above): > > > > > > > https://github.com/tonysyu/mpltools/blob/master/mpltools/special/errorfill.py#L54 > > > > It needs a docstring and a home (pyplot.py?). I kind of think > `offset_line` > > is more explicit than `pad_line` (both of these are *much* better than my > > original `extrema_from_error_input`). > > > > There was talk of this living in mlab or cbook. Is there a preference? > > Neither. cbook is really meant more for the devs. Half of it is converter functions that are probably completely unneeded now, while the other half is the callback registry. Luckily, the module is called "cbook.py", so one could pretend that it isn't "cookbook" but rather "callback book"... Meanwhile, mlab's own documentation says: "Numerical python functions written for compatability with MATLAB commands with the same names." So, unless someone can find out if MATLAB has some sort of equivalent functionality hidden away somewhere, it doesn't belong there either. Not sure where to put it. Cheers! Ben Root
Hi Keith, How are you storing the plot in the frame/panel? Josh On Jul 12, 2012, at 11:59 PM, Keith Jones wrote: > Hi Josh, > Yes I too am using the wx backend. > > Regards, > Keith > > From: Tony Yu [mailto:ts...@gm...] > Sent: Friday, 13 July 2012 3:16 p.m. > To: Keith Jones > Cc: Joshua Koehler; mat...@li... > Subject: Re: [Matplotlib-users] wxpython matplotlib figure resize > > > On Thu, Jul 12, 2012 at 9:27 PM, Keith Jones <K....@ir...> wrote: > Hi, > I am interested in a better solution to this problem, but I have used this simple method to force the right size. > > def tickle(self): > #gets frame to redraw and resize, not elegant. > if self.IsMaximized(): #then needs a kick > self.Restore() > self.Maximize() > else: > x,y = self.GetSize() > self.SetSize((x-1, y-1)) > self.SetSize((x, y)) > > Regards, > Keith > > From: Joshua Koehler [mailto:jjk...@gm...] > Sent: Saturday, 7 July 2012 1:51 a.m. > To: mat...@li... > Subject: [Matplotlib-users] wxpython matplotlib figure resize > > Hi all, > > I am currently trying to use matplotlib with wxPython and all is going well except for one annoying issue that I can't figure out. > > I initialize a wxcanvas object with a figure and then throughout the life of the program I want the canvas' figure to change and display the corresponding plot. I can get the change of figure, but when the program goes to plot, the figure isn't the right size. It changes to the right size only when I manually resize the figure (see attached images). Is there some command that I am missing? This is the update sequence I am using: > > self.figure = figure > > self.canvas.figure.clear() > self.canvas.figure = self.figure > self.canvas.draw() > self.color_background() > > #self.GetParent().Layout() > #self.SetSizer(self.main_sizer) > #self.Fit() > self.SendSizeEvent() > > As you can tell from the comments (there are more in my code), I have tried a variety of ways to update the figure off the bat. > > Thanks! > > Josh > > > This may be similar to a Qt-backend bug, which didn't take the toolbar into account when resizing the figure: > https://github.com/matplotlib/matplotlib/pull/756 > It doesn't quite fit, though, because Josh's original example shows a figure that's the correct size (but the axes doesn't fill the figure). The toolbar issue tended to squish the axes in the vertical direction (at least in the GUI window), whereas Josh's example is squished in the horizontal direction. > > Keith: Are you also using the Wx-backend? I don't have Wx installed so I can't provide much help. I've been planning to take a look at a similar issue in the Tk backend, but haven't had time. > > Best, > -Tony > > > > > This electronic transmission and any documents accompanying this electronic transmission contain confidential information belonging to the sender. This information may be legally privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited.
Thanks for the explanation! Let's discuss further on that issue page. Michiel de Hoon <mjl...@ya...> writes: > Hi Eric, Jouni, > > Thanks for your replies. I opened an issue here: > > https://github.com/matplotlib/matplotlib/issues/992 > > and wrote an outline of how the PDF backend can be simplified by > making use of gc.restore to keep track of the graphics context. In > essence the PDF backend would then follow the same logic as the Cairo > and Mac OS X backends, so it may be good to compare to these > (especially the Cairo backend, since it's written in pure Python and > easy to understand). > > Best, > -Michiel. -- Jouni K. Seppänen http://www.iki.fi/jks