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
(7) |
|
2
(5) |
3
(18) |
4
(9) |
5
(13) |
6
(14) |
7
(8) |
8
(7) |
|
9
(6) |
10
(6) |
11
(24) |
12
(14) |
13
(9) |
14
(21) |
15
(6) |
|
16
(1) |
17
(20) |
18
(42) |
19
(16) |
20
(21) |
21
(41) |
22
(13) |
|
23
(11) |
24
(15) |
25
(32) |
26
(27) |
27
(29) |
28
(10) |
29
(3) |
|
30
(1) |
31
(5) |
|
|
|
|
|
|
From: Matthias M. <Mat...@gm...> - 2008-03-17 16:39:21
|
Hello Chris,
you can try xlabel of an empty string:
xlabel(' ')
regards
Matthias
On Monday 17 March 2008 17:11, Chris Withers wrote:
> Hi All,
>
> I'm using plot_date to plot some dates, but this sets an xlabel, and I
> don't want the plot to have an xlabel.
>
> How do I remove it?
>
> I tried:
>
> xlabel(None)
>
> ...but that just set the xlabel to 'None'...
>
> cheers,
>
> Chris
|
|
From: Chris W. <ch...@si...> - 2008-03-17 16:13:21
|
Hi Matthias,
Matthias Michler wrote:
> I'm not sure if there was an example in matplotlib, but the following works
> for me:
> ---------------------------------------------------------------------
> from pylab import *
> figure()
> subplot(111)
> subplots_adjust(right=0.7)
> plot(arange(10), label='linear')
> plot(arange(10)**2, label='quadratic')
> legend(loc=(1.1,0.5))
> show()
> ------------------------------------------------------------------------
Thanks for this. This is exactly what I was after except that the legend
now appears about 25% off the right hand of the screen or whatever I
save the figure to.
How can I have the legend as placed above but with the whole of it showing?
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
|
|
From: Chris W. <ch...@si...> - 2008-03-17 16:11:17
|
Hi All,
I'm using plot_date to plot some dates, but this sets an xlabel, and I
don't want the plot to have an xlabel.
How do I remove it?
I tried:
xlabel(None)
...but that just set the xlabel to 'None'...
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
|
|
From: Rich F. <wha...@fs...> - 2008-03-17 14:12:30
|
Rich Fought wrote:
> I'm plotting some grid data using pcolor, and trying to get canvas pixel
> locations of data points using the
>
> ax.transData.xy_tup()
>
> method. I am saving these figures to PNG files using the default Agg
> backend. When I open these images up in Gimp and check the pixel
> locations, the X pixel locations are accurate, but the Y pixel locations
> I am getting from matplotlib seem to be exaggerated the further away
> from Y=0 I go. Am I using this method incorrectly? Could this be an
> artifact of the rendering to PNG?
>
I determined what is causing the exaggerated y-pixel values. I was using
axes().set_aspect('equal')
on the figure and this apparently does not get taken into account when using
ax.transData.xy_tup()
I tried setting the aspect in the original fig.add_subplot, but got the
same incorrect results.
ax = fig.add_subplot(111, aspect='equal')
Leaving the aspect alone gives correct pixel results.
Is this a bug, or expected behavior?
Rich
|
|
From: Einar M. E. <ein...@gm...> - 2008-03-17 12:08:03
|
Hi all, I'm trying to find ways to make the file-size of my PNG images smaller. When I generate my 660*440px image I get a big 168kb file. (8bit RGB color model, has an alpha channel (need that) but no interlacing scheme) Here it is: http://metphys.org/eme/T05.png I'm using the savefig method of-course. To see how much I could compress it I used pngcrush (the best tool according to the interwebs) and got it down to 128kb. But thats still way to large for my intended use. (plotting results from an operational weather model, see. www.belgingur.is We are currently using IDL.) From what I've read about PNG files, which is supposed to be rather compact image format, it seems to me that the most effective way is to have an indexed color table. So to cut it short: Is there any way to save a PNG file with an indexed color table? Or do you see any other way to shrink the files? Best regards. Einar M. Einarsson www.belgingur.is |
|
From: Matthias M. <Mat...@gm...> - 2008-03-17 12:00:23
|
Hello Chris, I'm not sure if there was an example in matplotlib, but the following works for me: --------------------------------------------------------------------- from pylab import * figure() subplot(111) subplots_adjust(right=0.7) plot(arange(10), label='linear') plot(arange(10)**2, label='quadratic') legend(loc=(1.1,0.5)) show() ------------------------------------------------------------------------ I hope this is useful to you. best regards Matthias On Monday 17 March 2008 12:42, Chris Withers wrote: > Hi All, > > How would I go about placing the legend outside the plot area? > > All the parameters to legend seem to place the legend somewhere within > the plot and I'd like to place it outside the plot, either above, below > or, most commonly, to the right, in the same way as the Excel legend > positions allow. > > cheers, > > Chris |
|
From: Chris W. <ch...@si...> - 2008-03-17 11:43:48
|
Hi All,
I'm wondering what work people have done with matplotlib in
multi-threaded environments such as your average python web framework.
Is matplotlib threadsafe?
How have people gone about safely using it in a multi-threaded environment?
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
|
|
From: Chris W. <ch...@si...> - 2008-03-17 11:42:38
|
Hi All,
How would I go about placing the legend outside the plot area?
All the parameters to legend seem to place the legend somewhere within
the plot and I'd like to place it outside the plot, either above, below
or, most commonly, to the right, in the same way as the Excel legend
positions allow.
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
|
|
From: Chris W. <ch...@si...> - 2008-03-17 10:36:37
|
Eric Firing wrote:
> Chris,
>
> Use masked arrays. See masked_demo.py in the mpl examples subdirectory.
Hi Eric,
I took a look at that, but it uses:
import matplotlib.numerix.npyma as ma
...and matplotlib.numerix isn't listed in the API reference. Where are
the docs for this?
Specifically, what I have is an array like so:
['','','',1.1,2.2]
I want to mask the strings out so I don't get ValueErrors raised when I
call plot functions with that array.
How should I do that?
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
|
|
From: Tim M. <tim...@d2...> - 2008-03-16 00:34:48
|
Thanks Darren, Here's a copy of what IDLE is printing to the screen (i'm using idle because I'm lazy & don't like typing filepaths in full ; ) - a lot of my python stuff is about avoiding doing exactly this for csound repeatedly... ) There's nothing specific re the Tk window crash that i can see Many other .py matplotlib examples I have tried work - just (so far) not the >>> plot([1,2,3]) command, nor Anim.py that i have taken from the distributed examples zip. In the case of Anim.py, the window launches & displays the animation sucessfully - however any attempt at window interaction results in hang & crash. My hunch is the problem is Tk(?), not Matplotlib. I have to admit, the font choice seems like an unusual / unexpected one (see below) Anyway, thanks for taking a look, & please advice if anything you see below is illuminating on any issue at all. >>> from pylab import * loaded rc file C:\Python25\lib\site-packages\matplotlib\mpl-data\matplotlibrc matplotlib version 0.91.2 verbose.level debug interactive is True units is False platform is win32 loaded modules: ['pylab', '_bisect', 'xml.sax.urlparse', 'distutils', 'tkFileDialog', 'random', 'datetime', 'idlelib.macosxSupport', 'matplotlib.tempfile', 'distutils.sysconfig', 'encodings.encodings', 'pytz.cStringIO', 'xml', 'struct', 'tempfile', 'xml.sax.urllib', 'pytz.tzinfo', 'idlelib.cPickle', 'matplotlib.__future__', 'imp', 'collections', 'idlelib.MultiCall', 'pytz.os', 'zipimport', 'string', 'SocketServer', 'repr', 'idlelib.string', 'idlelib.bdb', 'pytz.datetime', 'itertools', 'distutils.re', 'idlelib.SocketServer', 'ConfigParser', 'bisect', 'signal', 'idlelib.IOBinding', 'xml.sax.types', 'threading', 'tkMessageBox', 'idlelib.warnings', 'xml.sax.xmlreader', 'matplotlib.pytz', 'idlelib.struct', 'idlelib.cStringIO', 'idlelib.linecache', 'locale', 'idlelib.threading', 'idlelib.TreeWidget', 'idlelib.rpc', 'idlelib.re', 'encodings', 'idlelib.RemoteDebugger', 'idlelib.tempfile', 'shutil', 'dateutil', 'idlelib.codecs', '_tkinter', 'bdb', 'matplotlib.warnings', 'matplotlib.string', 'pytz.pytz', 'urllib', 'matplotlib.sys', 're', 'idlelib.RemoteObjectBrowser', 'ntpath', 'idlelib.imp', 'idlelib.locale', 'idlelib.thread', 'math', 'idlelib.Debugger', 'Tkinter', 'idlelib.traceback', 'idlelib.marshal', 'UserDict', 'distutils.os', 'matplotlib', 'Queue', 'idlelib.StackViewer', 'codecs', 'idlelib.copy_reg', 'md5', '_locale', 'idlelib.AutoComplete', 'matplotlib.sre_constants', 'socket', 'thread', 'idlelib.time', 'traceback', 'weakref', 'idlelib.socket', 'idlelib.CallTipWindow', 'os', 'marshal', 'pytz.tzfile', '__future__', 'nturl2path', 'idlelib.AutoCompleteWindow', 'idlelib.tkFileDialog', 'cStringIO', '_sre', 'xml.sax.sys', '__builtin__', 'matplotlib.copy', 'matplotlib.re', 'operator', 'distutils.string', 'select', 'idlelib.os', 'idlelib.ZoomHeight', 'matplotlib.datetime', 'idlelib.ConfigParser', 'errno', '_socket', 'binascii', 'sre_constants', 'matplotlib.md5', 'types', 'pytz.sys', 'xml.sax.handler', 'idlelib.__builtin__', 'idlelib.tkMessageBox', 'xml.sax.os', 'cPickle', 'matplotlib.xml', 'idlelib.HyperParser', 'encodings.cp1252', 'pytz', 'matplotlib.pyparsing', 'idlelib.repr', 'copy', 'idlelib.Queue', '_struct', '_types', 'matplotlib.dateutil', 'hashlib', 'keyword', 'idlelib.keyword', 'xml.sax.saxutils', 'idlelib.__main__', 'idlelib.sys', 'encodings.aliases', 'matplotlib.fontconfig_pattern', 'exceptions', 'sre_parse', 'pytz.bisect', 'distutils.distutils', 'FixTk', 'copy_reg', 'sre_compile', 'xml.sax', '_hashlib', '_random', 'pytz.struct', 'site', 'SimpleDialog', '__main__', 'idlelib.types', 'matplotlib.weakref', 'urlparse', 'tkCommonDialog', 'matplotlib.os', 'strop', 'encodings.codecs', 'gettext', '_codecs', 'matplotlib.rcsetup', 'nt', 'pytz.sets', 'xml.sax._exceptions', 'idlelib.PyParse', 'xml.sax.codecs', 'stat', '_ssl', 'warnings', 'encodings.types', 'sets', 'sys', 'idlelib.Tkinter', 'idlelib.CallTips', 'idlelib.configHandler', 'idlelib.WindowList', 'idlelib.SimpleDialog', 'os.path', 'idlelib.ScrolledList', 'pytz.gettext', 'distutils.sys', 'matplotlib.distutils', '_weakref', 'idlelib.ObjectBrowser', 'idlelib', 'Tkconstants', 'distutils.errors', 'matplotlib.matplotlib', 'linecache', 'matplotlib.shutil', 'time', 'idlelib.select', 'idlelib.run'] numerix numpy 1.0.3.1 $HOME=C:\Documents and Settings\Tim CONFIGDIR=C:\Documents and Settings\Tim\.matplotlib Using fontManager instance from C:\Documents and Settings\Tim\.matplotlib\fontManager.cache matplotlib data path C:\Python25\lib\site-packages\matplotlib\mpl-data backend TkAgg version 8.4 >>> plot([1,2,3]) findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning c:\program files\celemony\melodyne.3.0\vstplugins\uhe_data\podolski\fonts\vera.ttf [<matplotlib.lines.Line2D instance at 0x018383A0>] ....cue blank TK window with infinite hourglass.... ----- ******************* www.phasetransitions.net hermetic music * python * csound * possibly mindless ranting various werk in perpetual delusions of progress.... -- View this message in context: http://www.nabble.com/Newbie---plot%28-1%2C2%2C3-%29-issues---Csound-tp16065553p16074266.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Darren D. <dar...@co...> - 2008-03-15 11:34:03
|
On Saturday 15 March 2008 4:06:39 am Tim Mortimer wrote: > Hi Folks, > > I've been using Python about 9 months or so, inspired mainly by the desire > to work more effectively with Csound. Python has been a revelation to my > creativity & music making ambitions, & probably the most satisfying & > consuming creative diversion i have ever made. > > Ive today installed Numpy & Matplotlib (on XP), & set TKagg as my backend > in the matplotlibrc file. > > When i try & run the plot([1,2,3]) example (im working from the matplotlib > user guide pdf document, which generally looks very nice, much like > matplotlib itself dare i say..) a TK window opens, but nothing appears in > it, the hourglass continues ad infinitum, & the process eventually hangs. > > This also happened when i ran IDLE from the command line (something i'd > never done before) with the -n flag... > > Idle's window tells me that an output plot object was sucessfully created > however... > > So, err, what could the problem be? Would you set "verbose.level : debug" in your matplotlibrc, try again, and post the output? |
|
From: Tim M. <tim...@d2...> - 2008-03-15 08:06:43
|
Hi Folks, I've been using Python about 9 months or so, inspired mainly by the desire to work more effectively with Csound. Python has been a revelation to my creativity & music making ambitions, & probably the most satisfying & consuming creative diversion i have ever made. Ive today installed Numpy & Matplotlib (on XP), & set TKagg as my backend in the matplotlibrc file. When i try & run the plot([1,2,3]) example (im working from the matplotlib user guide pdf document, which generally looks very nice, much like matplotlib itself dare i say..) a TK window opens, but nothing appears in it, the hourglass continues ad infinitum, & the process eventually hangs. This also happened when i ran IDLE from the command line (something i'd never done before) with the -n flag... Idle's window tells me that an output plot object was sucessfully created however... So, err, what could the problem be? I'm using standard windows binary installers for everything, Python 2.5, Numpy 1.0.3.1, Matplotlib 0.91.2. Everything imports ok. On a less immediate note, i would like to address people to this post i made earlier today on the Tkinter list http://www.nabble.com/drawing-multiple-functions-on-the-canvas-td16064458.html for some advice &/or assistance. Whilst i can see Matplotlib as being useful to my DSP & musicmaking world in a number of adhoc ways, i'm primarily interested in trying to find shortcuts & methods to defining "arbitrary" functions with the mouse(/wacom) input, recording the x/y(/z) data into an array, & refreshing / displaying that data to the screen. There seems to be plenty around to help me scribble on a canvas, but not in a way that allows me to keep unique, "function" like, myfunc[x] = y lists & display them to screen. I've been aware for awhile now that Matplotlib may offer me some elegant & more than adequate solutions to displaying mathematically defined functions, but can it help me design by hand & output overlays of arbitrary xy patterns & relationships at all? All i would need to do is then output my input created XY arrays / lists to .txt file, & bring the data into my existing Python / Csound environment for immediate & easy use. So if anyone has any advice on the simplest, lowlevel way i might go about attempting this (with or without Matplotlib) that'd be ace. But essentially i am talking about displaying & refreshing plots after all, right? so hopefully this is a good place to start. Spoilt for choice, swamped by info, uncertain how best to proceed. many thanks Tim ----- ******************* www.phasetransitions.net hermetic music * python * csound * possibly mindless ranting various werk in perpetual delusions of progress.... -- View this message in context: http://www.nabble.com/Newbie---plot%28-1%2C2%2C3-%29-issues---Csound-tp16065553p16065553.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jeff W. <js...@fa...> - 2008-03-15 01:41:41
|
Zane Selvans wrote: > Well, the translation/rotation on a sphere is just a kind of wish-list > thing... but it would be awfully nice. It seems like someone must > have done that, for re-drawing continental outlines as they drift > across the surface of the earth over time or something. > > What I do need, for instance, is to be able to build up a polyline > object given a starting (lat,lon), an azimuth, and a distance to go. > Like: > > start at (lat0,lon0) > go 10km at a heading (calculated based on my location and time) > what is my new (lat,lon)? > Calculate a new heading (based on my new location and time) > go another 10km along that heading. > etc. > etc. > > saving each of the (lat,lon) points that I stop at, every X km along > the way. > > It needs to work even if I go near a pole, or across the "wrap-around" > point in Longitude. > > Then I need to be able to take that lineament (list of lat,lon points) > and compare its shape to the great circle which best fits its overall > trajectory, e.g. distance to the best-fit great circle from the > lineament as a function of distance along the lineament. > > I want to be able to generate statistically similar synthetic > lineaments, based on a mapped lineament, like, lineaments that have a > similar power spectrum (compared to their best fit great circle), but > a different overall shape, or orientation. > > And I need to be able to calculate the points at which different > lineaments intersect, and the ordering of the intersections along > lineaments... I.e. the lineament object needs to be able to answer the > question, given a set of other lineament obejcts, "who do I intersect > with, and in what order, and how far along me is each of those > intersections?" > > It's only at the very end that I need to be able to take one of these > polylines and send it to the map for visualization. Mostly I need to > be able to analyze it. > > Thanks for any suggestions on packages to look at. > > I should dig deeper into Basemap to see what all it does. > > Zane Zane: Check out the pyproj module included in basemap, specifically pyproj.Geod (http://pyproj.googlecode.com/svn/trunk/README.html). It can accessed by doing from mpl_toolkits.basemap import pyproj (in svn) from matplotlib.toolkits.basemap import pyproj (in the released version) -Jeff > > Jeff Whitaker wrote: >> Zane Selvans wrote: >>> Hello all, >>> >>> I need to do analysis of vector data (linear features, polylines) on >>> the surface of a sphere. Many of the lines span a significant >>> portion of the circumferance of the the body in question (Jupiter's >>> moon Europa), and I want to be able to do the display of the data >>> and analysis within Matplotlib. >>> >>> Rather than writing my own (probably lame) module for manipulating >>> and generating linear features stored as lists of (lat,lon) points, >>> I'd prefer to build on someone else's work. >>> >>> After a little searching around, it seems like most open GIS >>> packages (e.g. OGL, GDAL) seem to work exclusively within a >>> projected planar space. Am I missing something? Is there anyone >>> else out there that does this kind of thing? What solutions do >>> people have that work well with Matplotlib and the Basemap toolkit? >>> >>> Ideally, I'd like to have the ability to perform transformations on >>> the polylines, rotating and translating them on the surface of the >>> sphere (without having to do the spherical trig myself), and I have >>> to be able to have features cross the "date line" and wrap-around >>> intelligently, calculate great-circle distances (and forward/back >>> azimuths), best-fit great circles, etc. >>> >>> Thanks for any recommendations you might have, >>> Zane >>> >> >> Zane: Basemap can calculate great-circle distances (with >> forward/back azimuths). I'm not to clear on the types of >> transformations you need, but Basemap basically just does the forward >> and inverse transformations from map projection to geographic >> (lat/lon) coordinates. My guess is that it won't do the type of >> rotation and translation that you want to do. >> >> -Jeff >> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Zane S. <za...@id...> - 2008-03-15 01:21:22
|
Well, the translation/rotation on a sphere is just a kind of wish-list thing... but it would be awfully nice. It seems like someone must have done that, for re-drawing continental outlines as they drift across the surface of the earth over time or something. What I do need, for instance, is to be able to build up a polyline object given a starting (lat,lon), an azimuth, and a distance to go. Like: start at (lat0,lon0) go 10km at a heading (calculated based on my location and time) what is my new (lat,lon)? Calculate a new heading (based on my new location and time) go another 10km along that heading. etc. etc. saving each of the (lat,lon) points that I stop at, every X km along the way. It needs to work even if I go near a pole, or across the "wrap-around" point in Longitude. Then I need to be able to take that lineament (list of lat,lon points) and compare its shape to the great circle which best fits its overall trajectory, e.g. distance to the best-fit great circle from the lineament as a function of distance along the lineament. I want to be able to generate statistically similar synthetic lineaments, based on a mapped lineament, like, lineaments that have a similar power spectrum (compared to their best fit great circle), but a different overall shape, or orientation. And I need to be able to calculate the points at which different lineaments intersect, and the ordering of the intersections along lineaments... I.e. the lineament object needs to be able to answer the question, given a set of other lineament obejcts, "who do I intersect with, and in what order, and how far along me is each of those intersections?" It's only at the very end that I need to be able to take one of these polylines and send it to the map for visualization. Mostly I need to be able to analyze it. Thanks for any suggestions on packages to look at. I should dig deeper into Basemap to see what all it does. Zane Jeff Whitaker wrote: > Zane Selvans wrote: >> Hello all, >> >> I need to do analysis of vector data (linear features, polylines) on >> the surface of a sphere. Many of the lines span a significant portion >> of the circumferance of the the body in question (Jupiter's moon >> Europa), and I want to be able to do the display of the data and >> analysis within Matplotlib. >> >> Rather than writing my own (probably lame) module for manipulating and >> generating linear features stored as lists of (lat,lon) points, I'd >> prefer to build on someone else's work. >> >> After a little searching around, it seems like most open GIS packages >> (e.g. OGL, GDAL) seem to work exclusively within a projected planar >> space. Am I missing something? Is there anyone else out there that >> does this kind of thing? What solutions do people have that work well >> with Matplotlib and the Basemap toolkit? >> >> Ideally, I'd like to have the ability to perform transformations on >> the polylines, rotating and translating them on the surface of the >> sphere (without having to do the spherical trig myself), and I have to >> be able to have features cross the "date line" and wrap-around >> intelligently, calculate great-circle distances (and forward/back >> azimuths), best-fit great circles, etc. >> >> Thanks for any recommendations you might have, >> Zane >> > > Zane: Basemap can calculate great-circle distances (with forward/back > azimuths). I'm not to clear on the types of transformations you need, > but Basemap basically just does the forward and inverse transformations > from map projection to geographic (lat/lon) coordinates. My guess is > that it won't do the type of rotation and translation that you want to do. > > -Jeff > -- Zane Selvans Amateur Human za...@id... 303/815-6866 PGP Key: 55E0815F |
|
From: Jeff W. <js...@fa...> - 2008-03-15 01:04:22
|
Zane Selvans wrote: > Hello all, > > I need to do analysis of vector data (linear features, polylines) on > the surface of a sphere. Many of the lines span a significant portion > of the circumferance of the the body in question (Jupiter's moon > Europa), and I want to be able to do the display of the data and > analysis within Matplotlib. > > Rather than writing my own (probably lame) module for manipulating and > generating linear features stored as lists of (lat,lon) points, I'd > prefer to build on someone else's work. > > After a little searching around, it seems like most open GIS packages > (e.g. OGL, GDAL) seem to work exclusively within a projected planar > space. Am I missing something? Is there anyone else out there that > does this kind of thing? What solutions do people have that work well > with Matplotlib and the Basemap toolkit? > > Ideally, I'd like to have the ability to perform transformations on > the polylines, rotating and translating them on the surface of the > sphere (without having to do the spherical trig myself), and I have to > be able to have features cross the "date line" and wrap-around > intelligently, calculate great-circle distances (and forward/back > azimuths), best-fit great circles, etc. > > Thanks for any recommendations you might have, > Zane > Zane: Basemap can calculate great-circle distances (with forward/back azimuths). I'm not to clear on the types of transformations you need, but Basemap basically just does the forward and inverse transformations from map projection to geographic (lat/lon) coordinates. My guess is that it won't do the type of rotation and translation that you want to do. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Jeff W. <js...@fa...> - 2008-03-15 01:00:26
|
Michael Bauer wrote: > I'd like to make pcolor images using non-'cyl' projections, but I want > the pcolor pixels to be trapezoidal rather than rectangular. Is this > possible? > > Mike > > Example script" > > # example data > lonin = numpy.arange(0.,360.,2.5) > latin = numpy.arange(-90.,92.5,2.5) > field = numpy.ones([len(latin),len(lonin)]) + > 10.0*numpy.random.random([len(latin),len(lonin)]) > > # adapt for plot > #field,lons = addcyclic(field,lonin) > #field,lons = shiftgrid(180.,field,lons,start=False) > # offset for pcolor > field = 0.5*(field[:-1,:-1]+field[1:,1:]) > > fig = figure() > canvas = FigureCanvas(fig) > the_map = Basemap(resolution='c',projection='lcc',llcrnrlon=-75., > llcrnrlat=15.,urcrnrlon=40.,urcrnrlat=60.,lat_1=50., > lon_0=-45.) > > # convert to projected coordinates > dx = 2.*pi*the_map.rmajor/len(lons) > nx = int((the_map.xmax-the_map.xmin)/dx)+1 > ny = int((the_map.ymax-the_map.ymin)/dx)+1 > z,x,y = > the_map.transform_scalar(field,lons,lats,nx,ny,returnxy=True,order=0) > > # creates seemingly correct image in term of grid placement, but with > rectangular pixels > the_image = the_map.pcolor(x,y,z,shading='flat') > > Mike: There's no need to do the interpolation to map projection coordinates. Just pass pcolor the vertices of the lat/lon grid in map projection coordinates, i.e. x,y = the_map(lons, lats) the_image = the_map.pcolor(x,y,field) The resulting pixels will not be square, but will have the shape of lat/lon boxes in projected coordinates. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Zane S. <za...@id...> - 2008-03-14 23:48:10
|
Hello all, I need to do analysis of vector data (linear features, polylines) on the surface of a sphere. Many of the lines span a significant portion of the circumferance of the the body in question (Jupiter's moon Europa), and I want to be able to do the display of the data and analysis within Matplotlib. Rather than writing my own (probably lame) module for manipulating and generating linear features stored as lists of (lat,lon) points, I'd prefer to build on someone else's work. After a little searching around, it seems like most open GIS packages (e.g. OGL, GDAL) seem to work exclusively within a projected planar space. Am I missing something? Is there anyone else out there that does this kind of thing? What solutions do people have that work well with Matplotlib and the Basemap toolkit? Ideally, I'd like to have the ability to perform transformations on the polylines, rotating and translating them on the surface of the sphere (without having to do the spherical trig myself), and I have to be able to have features cross the "date line" and wrap-around intelligently, calculate great-circle distances (and forward/back azimuths), best-fit great circles, etc. Thanks for any recommendations you might have, Zane -- Zane Selvans Amateur Human za...@id... 303/815-6866 PGP Key: 55E0815F |
|
From: Perry G. <pe...@st...> - 2008-03-14 19:38:19
|
Note that numdisplay can display numpy arrays directly to ds9 without saving to a file. (http://stsdas.stsci.edu/numdisplay). Perry On Mar 14, 2008, at 12:44 PM, Chiara Caronna wrote: > Hi, > I tried ds9 and It looks like this is what I would like to do > (though I couldn't try funtools, but what you describe is good). DO > you think it is possible to make something like this with matplotlib? > Thanks a lot for your help, > Chiara > > > Date: Wed, 12 Mar 2008 02:55:55 -0400 > > From: lee...@gm... > > To: chi...@ho... > > Subject: Re: [Matplotlib-users] Polygon masking possible? > > CC: mat...@li... > > > > Hi, > > > > I often do this with ds9 and funtools. > > ds9 is an astronomy-oriented image viewer (http://hea- > www.harvard.edu/RD/ds9/) > > but you can also use it with numpy array. > > Within ds9, you can define regions (ellipse, polynomial, etc) easily > > with a mouse. > > After you define a region (and save it as a file), you can > convert it > > to a mask image > > with funtools (funtools is a name of an astronomy-oriented image > > utility pacakge). > > funtools only support fits file (image format in astronomy) so this > > can be a bit tricky, but if you're > > interested i'll send my python wrapper code for it. > > > > So, take a look at ds9 and see it fits your need. > > To view numpy array in ds9, > > *. From python, save the array as a file (tofile method, better use > > "arr" as an extension) > > * in ds9, file-> open others -> open array. You need to select > > array dimension, type and endianness of the array. > > > > Regards, > > > > -JJ > > > > > > > > > > > > On Sat, Mar 8, 2008 at 11:17 AM, Chiara Caronna > > <chi...@ho...> wrote: > > > > > > Hello, > > > I am also interested in masking polygons and defining the > polygon by > > > 'clicking' on the image... but I do not know anything about > GUI.... does > > > anyone can help? Is there already something implemented? > > > Thanks! > > > Chiara > > > > > > > Date: Wed, 23 Jan 2008 13:50:15 +1300 > > > > From: am...@gm... > > > > To: mat...@li... > > > > Subject: Re: [Matplotlib-users] Polygon masking possible? > > > > > > > > > > > > > > Hi Søren, > > > > > > > > I've put this back on the list in case it's useful to anyone > else, or > > > > if there are better suggestions or improvements around. Hope > you don't > > > > mind. > > > > > > > > On 22/01/2008, Søren Nielsen <sor...@gm...> > wrote: > > > > > Yeah i'd like to see your code if I can.. > > > > > > > > import numpy as n > > > > > > > > def get_poly_pts(x, y, shape): > > > > """Creates convex polygon mask from list of corners. > > > > > > > > Parameters > > > > ---------- > > > > x : array_like > > > > x co-ordinates of corners > > > > y : array_like > > > > y co-ordinates of corners, in order corresponding to x > > > > shape : array_like > > > > dimension sizes of result > > > > > > > > Returns > > > > ------- > > > > build : ndarray > > > > 2-D array of shape shape with values True inside polygon > > > > > > > > Notes > > > > ----- > > > > Code is constrained to convex polygons by "inside" > > > > assessment criterion. > > > > > > > > """ > > > > x = n.asarray(x) > > > > y = n.asarray(y) > > > > shape = n.asarray(shape) > > > > npts = x.size # should probably assert x.size == y.size > > > > inds = n.indices( shape ) > > > > xs = inds[0] > > > > ys = inds[1] > > > > xav = n.round(x.mean()).astype(int) > > > > yav = n.round(y.mean()).astype(int) > > > > for i in xrange(npts): # iterate over pairs of co-ordinates > > > > j = (i + 1) % npts > > > > m = (y[j] - y[i])/(x[j] - x[i]) > > > > c = (x[j] * y[i] - x[i] * y[j])/(x[j] - x[i]) > > > > thisone = ( ys > m * xs + c ) > > > > if thisone[xav, yav] == False: > > > > thisone = ~thisone > > > > if i == 0: > > > > build = thisone > > > > else: > > > > build &= thisone > > > > return build > > > > > > > > (released under BSD licence) > > > > > > > > > I just needed the push over the edge to know how to draw on > the canvas, > > > > > mapping clicks etc. since i'm still fairly new to > matplotlib, so I think > > > > > your code will be helpfull. > > > > > > > > I hope so. As you can see this code doesn't do any of the > drawing or > > > > click collecting, but the cookbook page should be able to > guide you > > > > there. Ask again on the list if you have any further > questions and > > > > we'll see if we can help. > > > > > > > > Also, the code assumes that the average co-ordinate is inside > the > > > > shape - that's true for convex polygons, but not necessarily for > > > > arbitrary ones. I use if after taking a convex hull of a > greater list > > > > of points (using the delaunay module in scipy (now in scikits, I > > > > hear)), which ensures convexity. You just need to be aware of > that > > > > limitation. > > > > > > > > Cheers, > > > > > > > > A. > > > > -- > > > > AJC McMorland, PhD candidate > > > > Physiology, University of Auckland > > > > > > > > > ---------------------------------------------------------------------- > --- > > > > This SF.net email is sponsored by: Microsoft > > > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > > _______________________________________________ > > > > Matplotlib-users mailing list > > > > Mat...@li... > > > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > ________________________________ > > > Express yourself instantly with MSN Messenger! MSN Messenger > > > > ---------------------------------------------------------------------- > --- > > > This SF.net email is sponsored by: Microsoft > > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > _______________________________________________ > > > Matplotlib-users mailing list > > > Mat...@li... > > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > > > Express yourself instantly with MSN Messenger! MSN Messenger > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Bob C. <she...@ho...> - 2008-03-14 19:16:56
|
Hello,
I have a problem when I try to refresh a plot I create.
The code is shown below:
What I want to do is that when the user initiates a key press the plot is updated. (If you minimise and maximise then it is done, the problem is the repainting of the window. I have tried searching on the web but cant find out how to do it (as well as trying lots of things with show() but alas no luck so far).
Any help much appreciated.
Thanks
import wximport osimport matplotlib
# either WX or WXAgg can be used here.# matplotlib.use('WX')# from matplotlib.backends.backend_wxagg import FigureCanvasWx as FigCanvas
matplotlib.use('WXAgg')from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas
from matplotlib.figure import Figureimport matplotlib.numerix as numpy
class PlotFrame(wx.Frame):
start_msg = """ Press Any Key to Initiate Plot - well thats the plan... """ def __init__(self): wx.Frame.__init__(self, None, -1, "Test Plotting") self.fig = Figure((5.0,3.0), 100) self.canvas= FigCanvas(self, -1, self.fig) self.axes = self.fig.add_axes([0.15,0.15,0.75,0.75])
sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW) sizer.Add(wx.StaticText(self,-1, self.start_msg), 0, wx.ALIGN_LEFT|wx.TOP)
self.canvas.Bind(wx.EVT_KEY_DOWN, self.onKeyEvent)
self.SetSizer(sizer) self.Fit() self.Build_Menus()
def Build_Menus(self): """ build menus """ MENU_EXIT = wx.NewId() MENU_SAVE = wx.NewId()
menuBar = wx.MenuBar()
f0 = wx.Menu() f0.Append(MENU_EXIT, "E&xit", "Exit") menuBar.Append(f0, "&File");
self.SetMenuBar(menuBar)
self.Bind(wx.EVT_MENU, self.onExit , id=MENU_EXIT) def onKeyEvent(self,event=None): """ capture , act upon keystroke events""" print "I plot here" self.Plot_Data() print "but how do i get it to be drawn?" self.Show()
def onExit(self,event=None): self.Destroy()
def Plot_Data(self): t = numpy.arange(0.0,5.0,0.01) s = numpy.sin(2.0*numpy.pi*t) c = numpy.cos(0.4*numpy.pi*t) self.axes.plot(t,s) self.axes.plot(t,c)
if __name__ == '__main__': app = wx.PySimpleApp() fig = PlotFrame() fig.Show(True) app.MainLoop()
_________________________________________________________________
Free games, great prizes - get gaming at Gamesbox.
http://www.searchgamesbox.com |
|
From: José Gómez-D. <jgo...@gm...> - 2008-03-14 18:03:24
|
On Friday 14 March 2008 16:44:54 Chiara Caronna wrote: > I tried ds9 and It looks like this is what I would like to do (though I > couldn't try funtools, but what you describe is good). DO you think it is > possible to make something like this with matplotlib? Thanks a lot for your The initiating thread (from January) had some suggestions. In particular, some code that does this from Rob Hetland: <http://www.nabble.com/Re%3A-Cross-hair-and-polygon-drawing-tools.-p14919733.html> Hope that helps, Jose |
|
From: Kenneth M. <xke...@gm...> - 2008-03-14 17:47:15
|
All,
I've seen the examples for embedding matplot lib in Tk and the
Tk animation example. However I've not yet been successful with
creating an example where i can both animate data and stay in control
of Tk. (The animation in tk example seems to lock the mainloop.) Does
anyone have any advice or a quick example of a Tk app with an animated
graph that doesn't lock the user out of Tk control?
Regards,
Kenneth Miller
|
|
From: Eric F. <ef...@ha...> - 2008-03-14 17:45:38
|
Chris, Use masked arrays. See masked_demo.py in the mpl examples subdirectory. Eric Chris Withers wrote: > Hi All, > > Say I have data that looks like: > > date x y z > 2008-01-01 10 > 2008-01-02 21 11 > 2008-01-02 32 15 5 > > How can I plot it such that all three lines are plotted by that it's > apparent two of them are missing some data? > (I know I could just sub in zeros for the missing values, but I'd like > the point not to be there, not just down the bottom of the graph...) > > cheers, > > Chris > |
|
From: Christiaan P. <cep...@go...> - 2008-03-14 17:24:55
|
:-) Hi there, Just stick to the original plan. We know you've got some fixed measurement points, it really doesn't matter how far apart or irregular they are. You use these points to interpolate all the values in between for the specific 'time unit' you want to represent. Look at http://www.scipy.org/Cookbook/Interpolation for an example of using b-splines. Interpolation will give you a pretty good 'guesstemate' of what the usage would have been at that point had you gone and actually measured it. Of course if you don't want to interpolate, you can simply normalize your measurements to your time unit. Let's assume time unit of 1 day... Between 2007-09-13 and 2008-01-02, 3000 units were used - 3000/111 days = 27.02 units per day Between 2008-01-02 and 2008-02-08, 1000 units were used - 1000/37 days = 27.02 units per day Between 2008-02-08 and 2008-02-12, 100 units were used - 100/4 days = 25 units per day This obviously has the same disadvantage as linear interpolation in that gradual changes over unmeasured periods will be shown as constant. Hope we're getting closer to something you can use... Have a nice day. cputter On 14/03/2008, Chris Withers <ch...@si...> wrote: > > (meant this to go to the list too) > > > Christiaan Putter wrote: > > I'm having trouble understanding what it is you exactly want. > > > That's likely my fault ;-) > > > > You said you want to indicate that 'the monthly usage between September > 1st > > and January 1st > > was, on average, the same as that between January 1st and February 1st.' > > > Yes, but "monthly" is a red herring here, the time periods are however > long it's been since myself or the utility company checked the meter ;-) > > > > The measurement your taking is not in fact the utility usage for one > month, > > but rather the sum of all usage over all prior months. > > > Not really, and this was definitely me being unclear... > We're talking about utility meters here, so you go and look at them and > they show how many units of whatever it is (water, electicity, etc) they > have delivered. > > So, that's how you get the time series (with more variation, to show > reality, and avoid red herrings like "month"): > > 2007/09/13 - 5000 > 2008/01/02 - 8000 > 2008/02/08 - 9000 > 2008/02/12 - 9100 > > So, the differences tell us: > > Between 2007-09-13 and 2008-01-02, 3000 units were used > Between 2007-01-02 and 2008-02-08, 1000 units were used > Between 2007-02-08 and 2008-02-12, 100 units were used > > So I guess it's this data that I'm looking to visualise in such a way > that it's apprarent how much of the utility is being per unit time. > > NB: The measurements aren't regular, since they often come from when a > person turns up and reads the meter, which isn't at all regular ;-) > > Does that make more sense? Any ideas? > > > cheers, > > Chris > > -- > Simplistix - Content Management, Zope & Python Consulting > - http://www.simplistix.co.uk > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Chris W. <ch...@si...> - 2008-03-14 17:13:23
|
Hi All,
Say I have data that looks like:
date x y z
2008-01-01 10
2008-01-02 21 11
2008-01-02 32 15 5
How can I plot it such that all three lines are plotted by that it's
apparent two of them are missing some data?
(I know I could just sub in zeros for the missing values, but I'd like
the point not to be there, not just down the bottom of the graph...)
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
|
|
From: Chris W. <ch...@si...> - 2008-03-14 17:00:31
|
(meant this to go to the list too)
Christiaan Putter wrote:
> I'm having trouble understanding what it is you exactly want.
That's likely my fault ;-)
> You said you want to indicate that 'the monthly usage between September 1st
> and January 1st
> was, on average, the same as that between January 1st and February 1st.'
Yes, but "monthly" is a red herring here, the time periods are however
long it's been since myself or the utility company checked the meter ;-)
> The measurement your taking is not in fact the utility usage for one month,
> but rather the sum of all usage over all prior months.
Not really, and this was definitely me being unclear...
We're talking about utility meters here, so you go and look at them and
they show how many units of whatever it is (water, electicity, etc) they
have delivered.
So, that's how you get the time series (with more variation, to show
reality, and avoid red herrings like "month"):
2007/09/13 - 5000
2008/01/02 - 8000
2008/02/08 - 9000
2008/02/12 - 9100
So, the differences tell us:
Between 2007-09-13 and 2008-01-02, 3000 units were used
Between 2007-01-02 and 2008-02-08, 1000 units were used
Between 2007-02-08 and 2008-02-12, 100 units were used
So I guess it's this data that I'm looking to visualise in such a way
that it's apprarent how much of the utility is being per unit time.
NB: The measurements aren't regular, since they often come from when a
person turns up and reads the meter, which isn't at all regular ;-)
Does that make more sense? Any ideas?
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
|