SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
(13)
2
(12)
3
(3)
4
(13)
5
(13)
6
(2)
7
(5)
8
(17)
9
(9)
10
(10)
11
(16)
12
(8)
13
(10)
14
(1)
15
(5)
16
(5)
17
(7)
18
(13)
19
(9)
20
21
22
(2)
23
(3)
24
(5)
25
(5)
26
(14)
27
(1)
28
(2)
29
(18)
30
(5)
31
(22)



Showing 8 results of 8

From: Giorgio F. G. <gi...@gi...> - 2007年10月12日 21:28:50
Do you know if there is a reason why I cannot succeed in generating a
pick_event using wxmpl?
I know I could use EVT_POINT but I need the picker event to return the event.ind
thanks!
From: Evan M. <eva...@gm...> - 2007年10月12日 18:06:37
Hi, I am trying to install matplotlib 0.90.1. I have python 2.5 on a fresh
Mandriva 2007.1 installation. I have installed numpy and scipy - I think
these are ok, they both import and the tests were largely successful. I
believe I have all the background packages installed -
 - matplotlib core: zlib, zlib-devel, libpng, libpng-devel, freetype,
 freetype-devel, freetype-utils
 - gtk/gtkagg backend: gtk2-devel, gtk+-devel, pygtk2, glib-devel,
 pygtk2-devel, gnome-libs-devel, pygtk2-libglade
 - tk backend: tcl, tk, tkinter
 - wx/wxagg backends - the wxpython rpms from
wxpython<http://wxpython.org%3c/a>
apart from freetype-utils which I have not been able to find.
With mpl I get the following, having set the path like this:
In [2]: sys.path
Out[2]:
['',
 '/usr/bin',
 '/home/emason',
 '/usr/lib/python2.5/site-packages/numpy/lib',
 '/usr/lib/python2.5/site-packages/scipy/lib',
 '/usr/lib/python25.zip',
 '/usr/lib/python2.5',
 '/usr/lib/python2.5/plat-linux2',
 '/usr/lib/python2.5/lib-tk',
 '/usr/lib/python2.5/lib-dynload',
 '/usr/lib/python2.5/site-packages',
 '/usr/lib/python2.5/site-packages/Numeric',
 '/usr/lib/python2.5/site-packages/PIL',
 '/usr/lib/python2.5/site-packages/gtk-2.0',
 '/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode',
 '/usr/lib/python2.5/site-packages/IPython/Extensions',
 '/home/emason/.ipython']
[for PYTHONPATH in .bashrc I defined the paths to numpy/lib and scipy/lib; I
don't know if this is necessary, in any event it made no difference with
these not defined]
When I then try to build I get:
[root@msasa matplotlib-0.90.1]# python setup.py build
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-i686-2.5
/matplotlib/mpl-data
running build_ext
building 'matplotlib._nc_transforms' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fomit-frame-pointer -march=i586
-mtune=generic -fasynchronous-unwind-tables -g -fPIC -Isrc -I.
-I/usr/local/include -I/usr/include -I. -I/usr/include/python2.5 -c
src/_nc_transforms.cpp -o build/temp.linux-i686-2.5/src/_nc_transforms.o
-DNUMERIC=1 -DVERBOSE
src/_nc_transforms.cpp:13:40: error: Numeric/arrayobject.h: No such file or
directory
src/_nc_transforms.cpp: In member function 'Py::Object
Bbox::update_numerix_xy(const Py::Tuple&)':
src/_nc_transforms.cpp:517: error: 'PyArrayObject' was not declared in this
scope
src/_nc_transforms.cpp:517: error: 'xyin' was not declared in this scope
src/_nc_transforms.cpp:517: error: expected primary-expression before ')'
token
src/_nc_transforms.cpp:517: error: expected `;' before 'PyArray_FromObject'
src/_nc_transforms.cpp: In member function 'Py::Object
Bbox::update_numerix(const Py::Tuple&)':
src/_nc_transforms.cpp:586: error: 'PyArrayObject' was not declared in this
scope
[snip]
src/_nc_transforms.cpp:1275: error: 'retmask' was not declared in this scope
src/_nc_transforms.cpp:1278: error: expected primary-expression before ')'
token
src/_nc_transforms.cpp:1278: error: expected `;' before 'PyArray_FromDims'
src/_nc_transforms.cpp: In function 'void init_nc_transforms()':
src/_nc_transforms.cpp:2428: error: 'import_array' was not declared in this
scope
error: command 'gcc' failed with exit status 1
[root@msasa matplotlib-0.90.1]#
It seems to trip up when expecting a file 'arrayobject.h' in the /Numeric
directory; indeed that file is not there, though Numeric is on the path.
Numeric came as part of the Mandriva install.
I'd be grateful for any help with this, thanks in advance, Evan
From: Jeff W. <js...@fa...> - 2007年10月12日 13:35:07
Pascoe, S (Stephen) wrote:
> Thanks Jeff,
>
> Unfortunately another issue is with plotting the axes tick labels. This
> output is for a public service where the users expect to see eastings
> and northings displayed from the official UK national grid origin. I
> can use standard matplotlib axes to produce eastings/northings but with
> your solution the origin would be shown as in the wrong place.
>
> I can envisage solving this by creating a tick Formatter object that
> offsets the axes. Maybe that is my solution but I was hoping for a
> simpler way.
>
> Cheers,
> Stephen.
> 
Stephen: Using a TickFormatter is probably the best solution. -Jeff
P.S. Could you send me an example when you're done - perhaps to include 
in the examples directory?
> ---
> Stephen Pascoe +44 (0)1235 445980
> British Atmospheric Data Centre
> Rutherford Appleton Laboratory
>
> -----Original Message-----
> From: Jeff Whitaker [mailto:js...@fa...] 
> Sent: 12 October 2007 13:11
> To: Pascoe, S (Stephen)
> Cc: mat...@li...
> Subject: Re: [Matplotlib-users] Basemap with origin within the plot
>
> Pascoe, S (Stephen) wrote:
> 
>> I am trying to prepare a plot on the UK national grid. This is a
>> 
> transverse mercator projection centred on the UK with a false origin
> offset from the projection origin (lat_0, lon_0).
> 
>> The Basemap coordinate system origin (0 Easting and Northing) always
>> 
> seems to be set in the lower-left corner of the plot. The plot I need
> includes data either side of the origin so I need the origin within the
> plot area.
> 
>> Is there a general way of setting the origin somewhere other than the
>> 
> lower-left corner?
> 
>> I can either get basemap to plot the correct data region, in which
>> 
> case the origin is in the wrong place or I can fool Basemap by adjusting
> the axes bounds later. However, if I do this some of the coastline
> isn't plotted because Basemap decides it isn't on the map.
> 
>> Cheers,
>> Stephen.
>>
>>
>> 
>> 
> Stephen: There's no way to change the coordinate system Basemap uses. 
> To get you data to plot in the correct place, just add an offset
>
> xoffset, yoffset = map(lon_0, lat_0)
>
> to the UK national grid coordinates of the data you are plotting.
>
> HTH,
>
> -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...> - 2007年10月12日 12:11:22
Pascoe, S (Stephen) wrote:
> I am trying to prepare a plot on the UK national grid. This is a transverse mercator projection centred on the UK with a false origin offset from the projection origin (lat_0, lon_0).
>
> The Basemap coordinate system origin (0 Easting and Northing) always seems to be set in the lower-left corner of the plot. The plot I need includes data either side of the origin so I need the origin within the plot area.
>
> Is there a general way of setting the origin somewhere other than the lower-left corner?
>
> I can either get basemap to plot the correct data region, in which case the origin is in the wrong place or I can fool Basemap by adjusting the axes bounds later. However, if I do this some of the coastline isn't plotted because Basemap decides it isn't on the map.
>
> Cheers,
> Stephen.
>
>
> 
Stephen: There's no way to change the coordinate system Basemap uses. 
To get you data to plot in the correct place, just add an offset
xoffset, yoffset = map(lon_0, lat_0)
to the UK national grid coordinates of the data you are plotting.
HTH,
-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: James J. <Jam...@ce...> - 2007年10月12日 09:41:26
Hi,
I have some time series data of server CPU usage (user, system, WIO, 
free, etc) and would like to plot this as a stacked bar chart, with 
dates / times on the x axis (as per plot_date for x, y series data).
Is this possible?
Cheers,
James.
From: Adam M. <ram...@gm...> - 2007年10月12日 02:01:42
On 10/10/2007, Pascoe, S (Stephen) <S.P...@rl...> wrote:
> Is there a general way of setting the origin somewhere other than the lower-left corner?
I've just had to deal with a similar problem, you need to use the
basemap.shiftgrid() method to shift the co-ordinate grid accordingly.
Cheers
Adam
From: Stephen G. <ste...@op...> - 2007年10月12日 01:41:48
Attachments: testNegValue.py
Hi Joshua,
> As you can see from the attached graph, there is a break the in graph 
> somewhere around 7 AM or so. This is the data I am graphing for that red 
> line:
>
> "2007-10-09 00:00:00",0.015
> "2007-10-09 01:00:00",0.015
> "2007-10-09 02:00:00",0.014
> "2007-10-09 03:00:00",0.012
> "2007-10-09 04:00:00",0.008
> "2007-10-09 05:00:00",0.002
> "2007-10-09 06:00:00",-0.006
> 
<snip>
> If I change the -0.006 at 6:00AM to 0.006, it graphs with no break in the 
> line. 
Can not comment on Matplotlib, ... but what method are you using the
process your input?
RegEx or other ?, can it handle negative input?
The attached script has missing data points where the data point in None
Don't know if that helps
Steve
From: Charles S. <cs...@st...> - 2007年10月12日 00:32:16
John,
I would prefer to be able to use the power and flexibility of datestr2num
and the underlying dateutil.parser, rather than writing my own parser.
However, looking further at dateutil.parser.parse, it takes an argument
tzinfos, which allows timezone names other than the local timezone and
UTC/GMT/Z to be understood within parse. I haven't worked out the full range
of functionality for the tzinfos argument, but a simple example would be:
> tzlibrary = {'EST':-5*60*60,'EDT':-4*60*60,'EST':-6*60*60,
> 'CDT':-5*60*60,'PST':-8*60*60,'PDT':-7*60*60}
> matplotlib.dates.date2num(dateutil.parser.parse('jan 1, 2007 12:00
> PST',tzinfos=tzlibrary))
732677.83333333337
> matplotlib.dates.date2num(dateutil.parser.parse('jan 1, 2007 12:00
> PDT',tzinfos=tzlibrary))
732677.79166666663
> matplotlib.dates.date2num(dateutil.parser.parse('jan 1, 2007 12:00
> EDT',tzinfos=tzlibrary))
732677.66666666663 
Actually, I can just duplicate datestr2num, but pass a tzinfos dictionary as
well, e.g.:
def datestr2num(d,tzinfos=None):
 """
 Convert a date string to a datenum using dateutil.parser.parse
 d can be a single string or a sequence of strings
 """
 if is_string_like(d):
 dt = dateutil.parser.parse(d,tzinfos=tzinfos)
 return date2num(dt)
 else:
 return date2num([dateutil.parser.parse(s,tzinfos=tzinfos) for s in
d])
explicitly passing a tzinfos of None does not cause any problems for
dateutil.parser.parse.
thanks,
Charles
John Hunter-4 wrote:
> 
> On 10/11/07, Charles Seaton <cs...@st...> wrote:
> 
>> Any suggestions on how to get either matplotlib.dates.datestr2num or
>> dateutil.parser.parse to properly handle timezone information in the
>> datestring would be greatly appreciated.
> 
> Not sure how to answer this question vis-a-vid dateutil.parser, but
> you may want to consider creating your own datestr -> datetime
> converter using time.strptime and then allowing mpl to convert to
> numbers using date2num. I think you can use the %Z format code for
> timezones.
> 
> JDH
> 
> 
-- 
View this message in context: http://www.nabble.com/datestr2num%2C-dateutil.parse-and-timezone-problems-tf4609462.html#a13167297
Sent from the matplotlib - users mailing list archive at Nabble.com.

Showing 8 results of 8

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /