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
(27) |
2
(15) |
3
(2) |
4
(4) |
5
(5) |
6
(9) |
7
(15) |
8
(24) |
9
(19) |
10
(7) |
11
(13) |
12
(26) |
13
(27) |
14
(17) |
15
(14) |
16
(12) |
17
(9) |
18
(12) |
19
(17) |
20
(19) |
21
(5) |
22
(5) |
23
(7) |
24
(4) |
25
(1) |
26
(9) |
27
(20) |
28
(5) |
29
(10) |
30
(12) |
31
(6) |
> Right. It should be technically feasible to just simply tell figimage to > use a different transformation object, but this might have implications > elsewhere. I am very hazy in this part of mpl. > Hmm, I've simplified the figimage to just this line: fig.figimage(im,100,100,origin="upper", transform=None) And it puts the image 100 up and 100 px out from the lower right corner. I then tried setting the transform from None to all the various possible transforms listed on this page: http://matplotlib.sourceforge.net/users/transforms_tutorial.html as well as their inverted() forms. None of them allowed the image to be updated with data coordinates when the plot was resized. It really seems that figimage is a property of the figure only and not the canvas, so whatever the axes do is irrelevant to its placement. But I really don't know for sure. So far, this isn't going to work this way. Thanks, Che
Hello Found the example below and looks ideal for what I want with 2 exceptions. I want the x axis to have a time period of say 12 months and y axis no's of USD values. So, the data is like.. Jan 2011 100034 Feb2011 345321 Mar 2011 785434 Apr 2011 523753 May 2011 346723 etc etc the code I found is and as a newbie tried and failed to convert . Help appreciated import numpy as npy from pylab import figure, show from matplotlib.widgets import SpanSelector fig = figure(figsize=(8,6)) ax = fig.add_subplot(211, axisbg='#FFFFCC') x = npy.arange(0.0, 5.0, 0.01) y = npy.sin(2*npy.pi*x) + 0.5*npy.random.randn(len(x)) ax.plot(x, y, '-') ax.set_ylim(-2,2) ax.set_title('Press left mouse button and drag to test') ax2 = fig.add_subplot(212, axisbg='#FFFFCC') line2, = ax2.plot(x, y, '-') def onselect(xmin, xmax): indmin, indmax = npy.searchsorted(x, (xmin, xmax)) indmax = min(len(x)-1, indmax) thisx = x[indmin:indmax] thisy = y[indmin:indmax] line2.set_data(thisx, thisy) ax2.set_xlim(thisx[0], thisx[-1]) ax2.set_ylim(thisy.min(), thisy.max()) fig.canvas.draw() # set useblit True on gtkagg for enhanced performance span = SpanSelector(ax, onselect, 'horizontal', useblit=True, rectprops=dict(alpha=0.5, facecolor='red') ) show() -- View this message in context: http://old.nabble.com/Converting-example-from-Gallery-to-suite-X-Y-axis-tp33431805p33431805.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Aloha Eric, > This appears to be very much a dueling event loop problem. My guess is > that the solution will have to be something that keeps the event loops > well separated, probably in separate processes. All interaction with > your Client event loop would be in one process, and the callback would > get your data and put it somewhere (e.g. in a numpy npz file). Then the > trick is to have the matplotlib process in a polling loop using a timer > (done crudely with plt.pause(0.1); there is probably a better way) > checking to see if that "somewhere" has been updated, and if so, > updating its plot. I feel I see the light at the end of the tunnel. The npz file is even not necessary, I just need to pass the star id to a separate plotting process, to be compared to some stored previous value, in order to refresh the plot. I have to think about it for a couple of days... Thanks for the suggestion, Cheers, JB
On 03/02/2012 01:16 AM, Jean-Baptiste Marquette wrote: > > Hi Ben, > >> You have several possible sources of problems here. I would first make >> sure that basic matplotlib scripts work using the Qt4Agg backend on >> your computer. Test out some regular scripts from the examples section >> of the documentation. If they work as expected, then it is probably >> more likely that there is a problem with one of the other libraries. > > Good point. Tests successful. > >> Another possible source of trouble may lie with the calls to "sleep". >> Because the display libraries are not on a separate process, the sleep >> could also prevent the figures from being completely rendered. >> >> Personally, I wouldn't even bother with the interactive mode. Keep it >> off, and just put the cleanup code after "plt.show()", which is a >> blocking call. There is no need to implement your own event loop. > > The challenge is to display hundreds of stellar light curves by > sequently selecting rows in a table through the SAMP mechanism. Thus it > would be fine not to have to kill the plot window after each display, > but to have it automatically refreshed after each row selection (I'm a > lazy guy...). > I just commented the plt.ion() line, this yields a segmentation fault, > here is the crash report. This appears to be very much a dueling event loop problem. My guess is that the solution will have to be something that keeps the event loops well separated, probably in separate processes. All interaction with your Client event loop would be in one process, and the callback would get your data and put it somewhere (e.g. in a numpy npz file). Then the trick is to have the matplotlib process in a polling loop using a timer (done crudely with plt.pause(0.1); there is probably a better way) checking to see if that "somewhere" has been updated, and if so, updating its plot. Eric > > Cheers > JB >
On Fri, Mar 2, 2012 at 4:57 AM, Guillaume Gay <gui...@mi... > wrote: > Hi list, > > I am trying to implement some GUI tools in matplotlib - more precisely a > line profile tool and a contrast setter which I hope will be integrated to > the skimage kit [see https://github.com/glyg/**scikits-image/blob/master/* > *skimage/io/_plugins/**matplotlib_plugin.py<https://github.com/glyg/scikits-image/blob/master/skimage/io/_plugins/matplotlib_plugin.py>]. > > > Now here is my question: > Is it possible to grab the content of a figure and 'displace' it in a > subplot of the same figure, to give room for a knew plot - even if the > original content is complex (i.e. an image + a colorbar + an histogram, for > example). > > I am not sure I'm clear here, so I can try to rephrase if needed. > > I am not sure if you are trying to move objects from one axes to another or merely reposition an existing axes to make room for a new one. Both are possible, but the latter is easy. Each axes has [left, bottom, width, height] rectangle in (0,1) figure coordinates that you can adjust at any time. See for example the subplots_adjust tool on the navigation toolbar next to the save icon http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.set_position If you are working with subplots, also see the change_geometry method http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.SubplotBase.change_geometry colorbars are a little tricky, because there you are needing to reposition *two* axes, one for the image, and one for the colorbar itself. You can do this manually, but you probably want to look at JJ's gridspec and axes_grid tools for laying out groups of axes: http://matplotlib.sourceforge.net/users/gridspec.html http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/index.html#toolkit-axesgrid-index JDH
Hi Jeff, thank you for your answer. It was very helpful to me. Have a nice weekend! -Jan -- View this message in context: http://old.nabble.com/Setting-the-bin-content-of-a-histogram-tp33412466p33428602.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi, you should be able to do so. In the past, I had written a small GUI that had the ability to copy Line2D, images and text elements from an axe to any other axes (even on different figure). This was integrated into GUI used to change the line properties. It is a bit old and dirty but you can find it there: http://mpl-properties.googlecode.com/svn/trunk/mpl_properties.py look for the "do_copy" function. Antoine On Fri, 2012年03月02日 at 11:57 +0100, Guillaume Gay wrote: > Hi list, > > I am trying to implement some GUI tools in matplotlib - more precisely a > line profile tool and a contrast setter which I hope will be integrated > to the skimage kit [see > https://github.com/glyg/scikits-image/blob/master/skimage/io/_plugins/matplotlib_plugin.py]. > > > Now here is my question: > Is it possible to grab the content of a figure and 'displace' it in a > subplot of the same figure, to give room for a knew plot - even if the > original content is complex (i.e. an image + a colorbar + an histogram, > for example). > > I am not sure I'm clear here, so I can try to rephrase if needed. > > Thanks > > Guillaume > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hi Ben, > You have several possible sources of problems here. I would first make sure that basic matplotlib scripts work using the Qt4Agg backend on your computer. Test out some regular scripts from the examples section of the documentation. If they work as expected, then it is probably more likely that there is a problem with one of the other libraries. Good point. Tests successful. > Another possible source of trouble may lie with the calls to "sleep". Because the display libraries are not on a separate process, the sleep could also prevent the figures from being completely rendered. > > Personally, I wouldn't even bother with the interactive mode. Keep it off, and just put the cleanup code after "plt.show()", which is a blocking call. There is no need to implement your own event loop. The challenge is to display hundreds of stellar light curves by sequently selecting rows in a table through the SAMP mechanism. Thus it would be fine not to have to kill the plot window after each display, but to have it automatically refreshed after each row selection (I'm a lazy guy...). I just commented the plt.ion() line, this yields a segmentation fault, here is the crash report. Cheers JB
Hi list, I am trying to implement some GUI tools in matplotlib - more precisely a line profile tool and a contrast setter which I hope will be integrated to the skimage kit [see https://github.com/glyg/scikits-image/blob/master/skimage/io/_plugins/matplotlib_plugin.py]. Now here is my question: Is it possible to grab the content of a figure and 'displace' it in a subplot of the same figure, to give room for a knew plot - even if the original content is complex (i.e. an image + a colorbar + an histogram, for example). I am not sure I'm clear here, so I can try to rephrase if needed. Thanks Guillaume
Whoops, make that: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import matplotlib.lines as lines import numpy as np m = Basemap(llcrnrlon=-11.5,llcrnrlat=51.0,urcrnrlon=-4.5,urcrnrlat=56.0, resolution='i',projection='cass',lon_0=-4.36,lat_0=54.7) lats = [53.5519317,53.8758499, 54.2894659, 55.2333142, 54.9846137,54.7064869, 51.5296651, 51.5536226, 51.7653115, 52.1625237, 52.5809163, 52.9393892] lons = [-9.9413447, -9.9621948, -8.9583439, -7.6770179, -8.3771698, -8.7406732, -8.9529546, -9.7907148, -10.1531573, -10.4099873, -9.8456417, -9.4344939] x, y = m(lons, lats) # forgot this line m.plot(x, y, 'D-', markersize=10, linewidth=2, color='k', markerfacecolor='b') m.drawcoastlines() plt.show() On Thu, Mar 1, 2012 at 6:43 PM, Paul Hobson <pmh...@gm...> wrote: > David, > > The loop is you have is unnecessary. You can plot the markers and the > lines at the same time like so: > from mpl_toolkits.basemap import Basemap > import matplotlib.pyplot as plt > import matplotlib.lines as lines > import numpy as np > > m = Basemap(llcrnrlon=-11.5,llcrnrlat=51.0,urcrnrlon=-4.5,urcrnrlat=56.0, > resolution='i',projection='cass',lon_0=-4.36,lat_0=54.7) > > lats = [53.5519317,53.8758499, 54.2894659, 55.2333142, > 54.9846137,54.7064869, 51.5296651, 51.5536226, 51.7653115, 52.1625237, > 52.5809163, 52.9393892] > > lons = [-9.9413447, -9.9621948, -8.9583439, -7.6770179, -8.3771698, > -8.7406732, -8.9529546, -9.7907148, -10.1531573, -10.4099873, > -9.8456417, -9.4344939] > > m.plot(x, y, 'D-', markersize=10, linewidth=2, color='k', markerfacecolor='b') > m.drawcoastlines() > plt.show() > > Hope that helps, > -paul > > On Wed, Feb 29, 2012 at 4:27 AM, David Craig <dcd...@gm...> wrote: >> Hi, >> I'm trying to produce a map with 12 locations marked on it and straight >> lines plotted between each point and all other points on the map. I have >> the map with the locations ok but am having trouble getting the lines. >> My code is below anyone know how to do this?? >> Thanks >> D >> >> from mpl_toolkits.basemap import Basemap >> import matplotlib.pyplot as plt >> import matplotlib.lines as lines >> import numpy as np >> >> m = Basemap(llcrnrlon=-11.5,llcrnrlat=51.0,urcrnrlon=-4.5,urcrnrlat=56.0, >> resolution='i',projection='cass',lon_0=-4.36,lat_0=54.7) >> >> lats = [53.5519317,53.8758499, 54.2894659, 55.2333142, >> 54.9846137,54.7064869, 51.5296651, 51.5536226, 51.7653115, 52.1625237, >> 52.5809163, 52.9393892] >> >> lons = [-9.9413447, -9.9621948, -8.9583439, -7.6770179, -8.3771698, >> -8.7406732, -8.9529546, -9.7907148, -10.1531573, -10.4099873, >> -9.8456417, -9.4344939] >> >> x, y = m(lons, lats) >> for i in range(len(lons)): >> for j in range(len(lons)): >> if i == j: continue >> m.plot([x[i],y[i]],[x[j],y[j]],'k') >> >> m.plot(x, y, 'bD', markersize=10) >> m.drawcoastlines() >> #m.drawmapboundary() >> #plt.savefig('/media/A677-86E0/dot_size'+str(i)+'.png') >> plt.show() >> >> >> ------------------------------------------------------------------------------ >> Virtualization & Cloud Management Using Capacity Planning >> Cloud computing makes use of virtualization - but cloud computing >> also focuses on allowing computing to be delivered as a service. >> http://www.accelacomm.com/jaw/sfnl/114/51521223/ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
David, The loop is you have is unnecessary. You can plot the markers and the lines at the same time like so: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import matplotlib.lines as lines import numpy as np m = Basemap(llcrnrlon=-11.5,llcrnrlat=51.0,urcrnrlon=-4.5,urcrnrlat=56.0, resolution='i',projection='cass',lon_0=-4.36,lat_0=54.7) lats = [53.5519317,53.8758499, 54.2894659, 55.2333142, 54.9846137,54.7064869, 51.5296651, 51.5536226, 51.7653115, 52.1625237, 52.5809163, 52.9393892] lons = [-9.9413447, -9.9621948, -8.9583439, -7.6770179, -8.3771698, -8.7406732, -8.9529546, -9.7907148, -10.1531573, -10.4099873, -9.8456417, -9.4344939] m.plot(x, y, 'D-', markersize=10, linewidth=2, color='k', markerfacecolor='b') m.drawcoastlines() plt.show() Hope that helps, -paul On Wed, Feb 29, 2012 at 4:27 AM, David Craig <dcd...@gm...> wrote: > Hi, > I'm trying to produce a map with 12 locations marked on it and straight > lines plotted between each point and all other points on the map. I have > the map with the locations ok but am having trouble getting the lines. > My code is below anyone know how to do this?? > Thanks > D > > from mpl_toolkits.basemap import Basemap > import matplotlib.pyplot as plt > import matplotlib.lines as lines > import numpy as np > > m = Basemap(llcrnrlon=-11.5,llcrnrlat=51.0,urcrnrlon=-4.5,urcrnrlat=56.0, > resolution='i',projection='cass',lon_0=-4.36,lat_0=54.7) > > lats = [53.5519317,53.8758499, 54.2894659, 55.2333142, > 54.9846137,54.7064869, 51.5296651, 51.5536226, 51.7653115, 52.1625237, > 52.5809163, 52.9393892] > > lons = [-9.9413447, -9.9621948, -8.9583439, -7.6770179, -8.3771698, > -8.7406732, -8.9529546, -9.7907148, -10.1531573, -10.4099873, > -9.8456417, -9.4344939] > > x, y = m(lons, lats) > for i in range(len(lons)): > for j in range(len(lons)): > if i == j: continue > m.plot([x[i],y[i]],[x[j],y[j]],'k') > > m.plot(x, y, 'bD', markersize=10) > m.drawcoastlines() > #m.drawmapboundary() > #plt.savefig('/media/A677-86E0/dot_size'+str(i)+'.png') > plt.show() > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Dear Andrea, All On 1 March 2012 22:31, Andrea Gavana <and...@gm...> wrote: > I thought the OP's original question was something like the Matlab > "plot editor" (or whatever is its name), which allows you to edit line > colours, styles, gridlines styles, this kind of stuff on a "live" plot > (mind you, it's been 6 years since I used Matlab for the last time and > I may have forgotten what the "plot editor" does). > > Anyway, if I am not completely off-track, this is something I had been > looking for as well in matplotlib a while back (3, 4 years ago), but > at that time I was told it would have been complicated to implement it > for all the "live" backend (I can't recall the exact reason). > > I would say that, at least for the backends based on wxPython, this > kind of modify-the-live-plot-via-GUI-interaction should be relatively > straightforward, at least for the GUI part and for the basics (line > styles, colours, markers and so on). However I am not sure what are > the implications on the core matplotlib code. > > But if I have misunderstood, I apologize for the noise :-) . For the wx backend to matplotlib, wxmplot (http://github.com/newville/wxmplot, http://newville.github.com/wxmplot/) does provide some of the basic editing features for simple 2d line plots such as changing colour, style, markers, text labels and so on via a GUI form, much as you describe. For image displays, it allows changing the colour table, smoothing, and rotating and so on. It is definitely not as complete as all of matplotlib, and I'm sure it could be improved. Still, it can serve many simple plotting needs where one wants to give the end-user the ability to customize the plots, and wx/matplotlib developers needing might find it useful. --Matt Newville
+1 On Fri, Mar 2, 2012 at 10:46 AM, Fernando Perez <fpe...@gm...>wrote: > On Thu, Mar 1, 2012 at 4:16 PM, Mic <mic...@gm...> wrote: > > Would be greate if it would be possible to record talks and slides and > make > > them public for whome are not leaving near by. > > The hack night will be 'open space' so not videotaped, but the main > workshop will be, thanks to the awesome folks at Marakana who pitched > in to do the hard work. > > We'll provide links to the videos once they get uploaded. > > Cheers, > > f >
python, numpy through enthought - Python 2.7.2 |EPD 7.1-1 (32-bit)| (default, Jul 3 2011, 15:13:59) [MSC v.1500 32 bit (Intel)] on win32 imports at the top of the script: import numpy as N import matplotlib.pyplot as plt from numpy import ma as MA from mpl_toolkits.basemap import Basemap import os On Thu, Mar 1, 2012 at 4:42 PM, Benjamin Root <ben...@ou...> wrote: > > > On Wednesday, February 29, 2012, questions anon wrote: > >> I have had some progress reading in the data but am unsure how to create >> lats and lons from the info I have (see above). >> the error I am receiving is: >> >> Traceback (most recent call last): >> File "d:\plotrainfall.py", line 40, in <module> >> CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet) >> File "C:\Python27\lib\site-packages\mpl_toolkits\basemap\__init__.py", >> line 3072, in contourf >> np.logical_or(outsidemask,np.logical_or(ma.getmaskarray(data),xymask)) >> AttributeError: logical_or >> >> >> from the below code: >> >> >> onefile=r"E:/test_in/r19000117.txt" >> >> f=N.genfromtxt(onefile, skip_header=6, dtype=float, names=True) >> print f >> >> >> map = Basemap(projection='merc',llcrnrlat=-45,urcrnrlat=-9, >> llcrnrlon=111.975,urcrnrlon=156.525,lat_ts=0,resolution='i') >> map.drawcoastlines() >> map.drawstates() >> xi=N.linspace(111.975, 156.275, 886) >> yi=N.linspace(-44.525, -9.975, 691) >> x,y=map(*N.meshgrid(xi,yi)) >> plt.title('rainfall') >> CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet) >> l,b,w,h =0.1,0.1,0.8,0.8 >> cax = plt.axes([l+w+0.025, b, 0.025, h]) >> plt.colorbar(CS,cax=cax, drawedges=True) >> plt.savefig((os.path.join(OutputFolder, 'rainfall.png'))) >> plt.show() >> plt.close() >> >> >> > How did you install numpy? Which version are you using? What are your > imports at the top of this script? > > Ben Root >
On Thu, Mar 1, 2012 at 4:16 PM, Mic <mic...@gm...> wrote: > Would be greate if it would be possible to record talks and slides and make > them public for whome are not leaving near by. The hack night will be 'open space' so not videotaped, but the main workshop will be, thanks to the awesome folks at Marakana who pitched in to do the hard work. We'll provide links to the videos once they get uploaded. Cheers, f
Would be greate if it would be possible to record talks and slides and make them public for whome are not leaving near by. Thank you in advance. On Fri, Mar 2, 2012 at 12:06 AM, John Hunter <jd...@gm...> wrote: > I'll be attending the pydata hack night in Santa Clara tomorrow night. > We'll be hacking on matplotlib, ipython, pandas, numpy and more. If you > are interested in stopping by, there is space for 200, many more than the > number of attendees at pydata. The event info is here: > > http://python-data-hack-night.eventbrite.com/ > > Here is the description from the event: > > The Python Data Workshop just got bigger! We are thrilled to announce > that Ground Floor Silicon Valley is generously opening up their coworking > space and hosting a Friday night Python Data Hack Night for all attendees > of the Workshop and any others who want to geek out on Python, data > analysis, and scientific computing! Spend a fun evening eating, drinking, > coding, and talking shop with the instructors and participants of the > Workshop. This includes the authors of Numpy, Scipy, IPython, Matplotlib, > PyTables, Pandas, and many other great Python packages. > > Ground Floor has room for up to 200 folks, so if you are on the wait list > for the full Workshop, this is your chance to participate in the workshop! > We are making tickets available to all those who registered for the Python > Data Workshop (attendees and wait list), before publicizing the event more > widely, so sign up now! > > The event runs from 6pm until Midnight. > We are looking for sponsors to cover food and drinks, but we do expect to > have those there. > For sponsorship details, contact lyn...@ge... > > Ground Floor SV > 2030 Duane Avenue > Santa Clara, CA 95054 > > Friday, March 2, 2012 from 6:00 PM to 11:55 PM (PT) > > > JDH > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
On Thursday, March 1, 2012, Jerzy Karczmarczuk < jer...@un...> wrote: > Andrea Gavana : >> Anyway, if I am not completely off-track, this is something I had been >> looking for as well in matplotlib a while back (3, 4 years ago), but >> at that time I was told it would have been complicated to implement it >> for all the "live" backend (I can't recall the exact reason). >> >> I would say that, at least for the backends based on wxPython, this >> kind of modify-the-live-plot-via-GUI-interaction should be relatively >> straightforward, at least for the GUI part and for the basics (line >> styles, colours, markers and so on). > There is one non-trivial difference between Matplotlib and Matlab. > Matplotlib is "just" a library, and not an integrated package with its > own event processing loop, multithreading, etc. When you plot() > something under Matlab or Scilab, you generate some objecs (gcf, gca) > and other stuff, accessible from outside. Your program turns normally, > your console works. So, you may launch a procedure which analyses all > the plotted data and change the "patches", "lines", "collections", etc., > using the matplotlib jargon. > > In matplotlib, upon show(), you relinquish the control. The interaction > becomes clumsy, the animation becomes clumsy, since matplotlib doesn't > give you the full access to the event loop. > OF COURSE you may do it, but it will require some work. > One possibility is to use an interface which by design works (I > presume...) in a separate, non-blocking thread. I mean: IPython. If you > launch IPython --pylab, then you may, e.g. construct: > > x=linspace(0.0,25.0,300); y=sin(x) > plot(x,y) > > and the figure is created without show(). > Then, write: > > a=gca(); p=a.lines[0] > > and nothing more difficult than: > > p.set_lw(3); p.set_color('red'); draw() > > You have edited your line. No need to change the code of matplotlib. > > Good luck. > > Jerzy Karczmarczuk > > Just to be clear, you are speaking of the difference between interactive and non-interactive modes, which is entirely switchable in matplotlib. However, widgets can be used in either mode. mpl can do what matlab can do, and more -- in theory. We simply do not have all the widgets and tools made. Ipython uses mpl with interactive mode turned on. All artists are available for editing at any time *until* the figure is destroyed (in either mode). It just happens that the execution moves past show() in non-interactive mode only when the figures are destroyed. As for any clumsiness for animations, it is because the feature is still new and Ryan May and I would greatly welcome additional viewpoints in the design discussions. Ben Root
Federico, You were so close! Try this: fig = plt.figure() ax = fig.add_subplot(111) ax.plot(range(100), range(100)) #If comment the following line everything is fine ax.set_xscale('log') xaxis = ax.get_xaxis() xaxis.grid(False, which='minor') xaxis.grid(False, which='major') plt.show() Hope that helps, -paul On Wed, Feb 29, 2012 at 4:09 PM, Federico Ariza <ari...@gm...> wrote: > Hi > > If I set the scale to log and set the grid to minor > then, it is impossible to deactivate the grid > It does not happen with major or without the logscale > > The code to reproduce the problem > > > import matplotlib.pyplot as plt > > fig = plt.figure() > ax = fig.add_subplot(111) > ax.plot(range(100), range(100)) > > #If comment the following line everything is fine > ax.set_xscale('log') > > xaxis = ax.get_xaxis() > xaxis.grid(which = 'Minor') > xaxis.grid(False) > plt.show() > > > Thanks > Federico > -- > Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > > -- Antonio Alducin -- > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Andrea Gavana : > Anyway, if I am not completely off-track, this is something I had been > looking for as well in matplotlib a while back (3, 4 years ago), but > at that time I was told it would have been complicated to implement it > for all the "live" backend (I can't recall the exact reason). > > I would say that, at least for the backends based on wxPython, this > kind of modify-the-live-plot-via-GUI-interaction should be relatively > straightforward, at least for the GUI part and for the basics (line > styles, colours, markers and so on). There is one non-trivial difference between Matplotlib and Matlab. Matplotlib is "just" a library, and not an integrated package with its own event processing loop, multithreading, etc. When you plot() something under Matlab or Scilab, you generate some objecs (gcf, gca) and other stuff, accessible from outside. Your program turns normally, your console works. So, you may launch a procedure which analyses all the plotted data and change the "patches", "lines", "collections", etc., using the matplotlib jargon. In matplotlib, upon show(), you relinquish the control. The interaction becomes clumsy, the animation becomes clumsy, since matplotlib doesn't give you the full access to the event loop. OF COURSE you may do it, but it will require some work. One possibility is to use an interface which by design works (I presume...) in a separate, non-blocking thread. I mean: IPython. If you launch IPython --pylab, then you may, e.g. construct: x=linspace(0.0,25.0,300); y=sin(x) plot(x,y) and the figure is created without show(). Then, write: a=gca(); p=a.lines[0] and nothing more difficult than: p.set_lw(3); p.set_color('red'); draw() You have edited your line. No need to change the code of matplotlib. Good luck. Jerzy Karczmarczuk
On Thu, Mar 1, 2012 at 3:31 PM, Andrea Gavana <and...@gm...>wrote: > On 1 March 2012 21:37, Benjamin Root wrote: > > > > > > On Wed, Feb 29, 2012 at 4:02 PM, Federico Ariza < > ari...@gm...> > > wrote: > >> > >> Dear all > >> > >> I am a long time matplotlib user (under linux) but new to the list > >> (second post). > >> > >> On of the things that bothers me the most is the inability of the > standard > >> backend to change simple things (line color, labels, etc...). > >> > > > > There was a feature a couple of us were hacking on a while back that > would > > allow for live switching between color and black&white modes. Is this > sort > > of stuff what you are speaking of? The changes were too invasive to be > > included, but it was an interesting experiment. > > I thought the OP's original question was something like the Matlab > "plot editor" (or whatever is its name), which allows you to edit line > colours, styles, gridlines styles, this kind of stuff on a "live" plot > (mind you, it's been 6 years since I used Matlab for the last time and > I may have forgotten what the "plot editor" does). > > Anyway, if I am not completely off-track, this is something I had been > looking for as well in matplotlib a while back (3, 4 years ago), but > at that time I was told it would have been complicated to implement it > for all the "live" backend (I can't recall the exact reason). > > Actually, it isn't that complicated, if you restrict yourself to a subset of mpl. I can't imagine being able to modify "any and all" aspects of a figure, such as transforms or filters, but certainly could modify various artists, for the most part. Also, this shouldn't be a "backend" in the same sense that GTKAgg is a backend. Merely a very advanced collection of widgets. Also, in many sense, this actually already has been done. It is called "Inkscape". Just save your figures as svg and edit them in Inkscape. (I know, it is a cop-out.) > I would say that, at least for the backends based on wxPython, this > kind of modify-the-live-plot-via-GUI-interaction should be relatively > straightforward, at least for the GUI part and for the basics (line > styles, colours, markers and so on). However I am not sure what are > the implications on the core matplotlib code. > Just about everything displayed is an "Artist" and therefore there is a uniform, standard interface for all of them. Widgets could still intelligently interact with subclassed Artists as well. There is nothing preventing that from happening. Ben Root
In article <row...@ne...>, "Russell E. Owen" <ro...@uw...> wrote: > In article > <CACM7dVw_Lde1QDS4vRvi-zTit8gqFYgYuyRLakOqBy0AVii7oA-JsoAwUIsXosN+BqQ9rBEUg@pu > blic.gmane.org>, > William Jennings <wil...@gm...> > wrote: > > > Hello mat plot lib users! > > I feel quite embarrassed that I've gone through 2 days of trying to get to > > get numpy, scipy and matplotlib all to work nice with each other. I've > > scraped through forums, stackoverflow and all the links that can bide me > > some type of logic. Yet, alas I still fail wildly with this set of errors: > > > > *my current status is: just did a fresh install of my lion os and haven't > > installed Xcode yet. I'm a little lost and have found only macports, > > homebrew guides online only to be a slower failure. I really need to use > > this software but I'm finding it difficult keeping straight what order and > > what I need to install. > > I recommend: > - Install python.org 64-bit Python 2.7 (the one labelled as being for > MacOS X 10.6 and later) > - Install numpy, scipy and matplotlib Mac binary with "macosx10.6" in > their names. These are available from the web sites maintained by those > projects. > > Or if you want better backward compatibility (e.g. if you plan to > distribute applications) then instead you should use the 32-bit > python.org python (marked as for MacOS X 10.3 and later) and the numpy, > scipy and matplotlib Mac binary installers with "macosx10.3" in their > names. This sort of thing comes up often enough that I've posted a web page on the topic, including reasons you might want to choose 32-bit or 64-bit: <http://www.astro.washington.edu/users/rowen/MacBinaryPythonPackageInstal lers.html> -- Russell
On 1 March 2012 21:37, Benjamin Root wrote: > > > On Wed, Feb 29, 2012 at 4:02 PM, Federico Ariza <ari...@gm...> > wrote: >> >> Dear all >> >> I am a long time matplotlib user (under linux) but new to the list >> (second post). >> >> On of the things that bothers me the most is the inability of the standard >> backend to change simple things (line color, labels, etc...). >> > > There was a feature a couple of us were hacking on a while back that would > allow for live switching between color and black&white modes. Is this sort > of stuff what you are speaking of? The changes were too invasive to be > included, but it was an interesting experiment. I thought the OP's original question was something like the Matlab "plot editor" (or whatever is its name), which allows you to edit line colours, styles, gridlines styles, this kind of stuff on a "live" plot (mind you, it's been 6 years since I used Matlab for the last time and I may have forgotten what the "plot editor" does). Anyway, if I am not completely off-track, this is something I had been looking for as well in matplotlib a while back (3, 4 years ago), but at that time I was told it would have been complicated to implement it for all the "live" backend (I can't recall the exact reason). I would say that, at least for the backends based on wxPython, this kind of modify-the-live-plot-via-GUI-interaction should be relatively straightforward, at least for the GUI part and for the basics (line styles, colours, markers and so on). However I am not sure what are the implications on the core matplotlib code. But if I have misunderstood, I apologize for the noise :-) . Andrea. "Imagination Is The Only Weapon In The War Against Reality." http://xoomer.alice.it/infinity77/ >>> import PyQt4.QtGui Traceback (most recent call last): File "<interactive input>", line 1, in <module> ImportError: No module named PyQt4.QtGui >>> >>> import pygtk Traceback (most recent call last): File "<interactive input>", line 1, in <module> ImportError: No module named pygtk >>> >>> import wx >>> >>>
Got it. Thanks again. Pawel On 03/01/2012 04:11 PM, Benjamin Root wrote: > > > On Thu, Mar 1, 2012 at 3:03 PM, Pawel <pa...@gm... > <mailto:pa...@gm...>> wrote: > > Thanks Ben. Your solution for setting different fontsizes worked > like a charm! > > > Glad it worked. > > For the other question, what I meant by padding was the distance > of the tick label from the axis. This is what I set with the > following command: > > matplotplib.pyplot.rc(('xtick.major','ytick.major'), pad=10) > > so that the pad of the label from the axis is set to 10. Now what > if I want to set the pad of just one of the xtick lables to a > different value? > > > Ah. You could change the x/y position of the Text object. However, a > trick that would be significantly easier and maybe "good enough" would > be to simply include a '\n' character at the beginning of that label's > string. > > Ben Root >
On Thu, Mar 1, 2012 at 3:03 PM, Pawel <pa...@gm...> wrote: > ** > Thanks Ben. Your solution for setting different fontsizes worked like a > charm! > > Glad it worked. > For the other question, what I meant by padding was the distance of the > tick label from the axis. This is what I set with the following command: > > matplotplib.pyplot.rc(('xtick.major','ytick.major'), pad=10) > > so that the pad of the label from the axis is set to 10. Now what if I > want to set the pad of just one of the xtick lables to a different value? > > Ah. You could change the x/y position of the Text object. However, a trick that would be significantly easier and maybe "good enough" would be to simply include a '\n' character at the beginning of that label's string. Ben Root
Thanks Ben. Your solution for setting different fontsizes worked like a charm! For the other question, what I meant by padding was the distance of the tick label from the axis. This is what I set with the following command: matplotplib.pyplot.rc(('xtick.major','ytick.major'), pad=10) so that the pad of the label from the axis is set to 10. Now what if I want to set the pad of just one of the xtick lables to a different value? Thanks, Pawel On 03/01/2012 01:17 PM, Benjamin Root wrote: > > > On Thu, Mar 1, 2012 at 11:33 AM, Pawel <pa...@gm... > <mailto:pa...@gm...>> wrote: > > Hi all, > > Is it possible to set the size of only some tick labels? I have text > tick labels (residue names). I'd like to reduce the font size of just > two of the labels to make them fit better, but keep the size of the > remaining labels the same. > > > It isn't _impossible_, but mpl certainly won't make it easy for you. > After creating your graph and tick labels, you would have to get back > the tick labels as a list of Text objects using "get_xticklabels()". > Then, you modify the font size of the appropriate element in that > list. Perhaps something like this: > > xticks = ax.get_xticklabels() > xticks[3].set_fontsize(xticks[3].get_fontsize() * 0.9) > > Note: Completely untested. > > And in a similar vein, is it possible to change the padding of > just some > tick labels? Again, I'd like to increase the padding of just two > of the > labels but keep the remaining the same. > > > By "padding" are you referring to the spacing between the tick > labels? That would have to be done by changing the tick locations > themselves. By default, the ticks are equally spaced over the > specified domain, and the labels for those ticks are placed so that > the center lines up with the tick mark. Try using "get_xticks()" and > "set_yticks()" and see what happens. > > I hope that helps! > Ben Root >