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




Showing results of 219

<< < 1 2 3 4 5 .. 9 > >> (Page 3 of 9)
From: George N. <gn...@go...> - 2007年07月20日 20:00:09
Default flat would be great. The default faceted has always been a pain.
George.
From: Ryan M. <rm...@ou...> - 2007年07月20日 19:04:20
Eric Firing wrote:
> Consistent with matlab, the default shading for pcolor in matplotlib and 
> pylab is 'faceted', which puts black lines around all the 
> quadrilaterals. Some users (e.g., Rob Hetland and myself) never want 
> this; are there users who *do* want to keep this default? I suspect so, 
> in which case the solution will be an rcParams entry, but I would like 
> confirmation of this. Also, if we need the rcParams entry but *almost* 
> all users want the default to be "flat" (no boundary lines), then we can 
> make that the default value of the rcParams entry.
> 
> Please advise.
> 
(Sent to the list this time.)
+1 for default 'flat' (either way)
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Eric F. <ef...@ha...> - 2007年07月20日 18:18:11
Consistent with matlab, the default shading for pcolor in matplotlib and 
pylab is 'faceted', which puts black lines around all the 
quadrilaterals. Some users (e.g., Rob Hetland and myself) never want 
this; are there users who *do* want to keep this default? I suspect so, 
in which case the solution will be an rcParams entry, but I would like 
confirmation of this. Also, if we need the rcParams entry but *almost* 
all users want the default to be "flat" (no boundary lines), then we can 
make that the default value of the rcParams entry.
Please advise.
Thanks.
Eric
From: <jk...@ik...> - 2007年07月20日 14:21:25
Matthew Auger <ma...@ph...>
writes:
> Hi...I'm interested in plotting text elements with the X value in data 
> coordinates and the Y value in axis coordinates
See <http://www.scipy.org/Cookbook/Matplotlib/Transformations>.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Alexander D. <Ale...@as...> - 2007年07月20日 13:32:30
Hi,
How is the syntax for the matplotlib command 'arrow'? There is not very much
to take from the help (see below). An example would be nice.
Thanks
 Alex
In [46]: arrow?
Type: function
Base Class: <type 'function'>
String Form: <function arrow at 0xb77f8a3c>
Namespace: Interactive
File: /usr/lib/python2.4/site-packages/matplotlib/pylab.py
Definition: arrow(*args, **kwargs)
Docstring:
 Draws arrow on specified axis from (x,y) to (x+dx,y+dy).
 Optional kwargs control the arrow properties:
 alpha: float
 animated: [True | False]
 antialiased or aa: [True | False]
 axes: an axes instance
 clip_box: a matplotlib.transform.Bbox instance
 clip_on: [True | False]
 clip_path: an agg.path_storage instance
 edgecolor or ec: any matplotlib color
 facecolor or fc: any matplotlib color
 figure: a matplotlib.figure.Figure instance
 fill: [True | False]
 hatch: unknown
 label: any string
 linewidth or lw: float
 lod: [True | False]
 picker: [None|float|boolean|callable]
 transform: a matplotlib.transform transformation instance
 visible: [True | False]
 zorder: any number
 Addition kwargs: hold = [True|False] overrides default hold state
From: Matthew A. <ma...@ph...> - 2007年07月20日 03:15:05
Hi...I'm interested in plotting text elements with the X value in data 
coordinates and the Y value in axis coordinates (in this way I could plot 
labels at the top of the axes that would respond to zooming/panning in the 
X-direction but would *always* remain at the top of the axes as long as 
the X-coord was still in the axes, for example). Is this possible?
Also, it seems the only differences between axvline and vlines are that 
vlines can take multiple lines as input and vlines uses data coords to set 
the y limits while axvline uses axis coords. It seems simpler to have one 
function that takes an optional argument to choose whether to use data or 
axis coordinates for the y range (and maybe even for the x value...ie 
producing the same functionality that I seek above).
Thanks for any help/suggestions!
Matt
From: fred <fr...@gm...> - 2007年07月19日 21:29:22
Eric Firing a écrit :
>
> I don't understand; it seems to me that all you need is 
> _interpd.keys(), and since this is specific to AxesImage, it should be 
> an attribute of that class, say AxesImage.interpolations. You can't 
> add interpolation methods, and they have no meaning outside AxesImage 
> (or the code it calls). The colormap dictionary is different: much 
> more general and flexible, so it is where it belongs: outside any class.
Well..., can you look at this ?
http://fredantispam.free.fr/a.mpg
I hope you can see what I want.
I agree with you that interpolation functions have no meaning outside,
but I only want to get their names, to let the user choose, as he
can choose the colormap.
The interpolation functions list has to be created before the user has 
loaded any data.
I hope I'm more clear.
Cheers,
-- 
http://scipy.org/FredericPetit
From: Tom H. <to...@gr...> - 2007年07月19日 21:10:58
Hmm, looks like I was just missing a third argument '-' from the
plot_date function.
Thanks, Tom
-------- Forwarded Message --------
From: Tom Haddon <to...@gr...>
To: John Hunter <jd...@gm...>
Cc: mat...@li...
Subject: Re: [Matplotlib-users] Irregular Dates
Date: 2007年7月19日 13:39:58 -0700
On Wed, 2007年07月18日 at 20:02 -0500, John Hunter wrote:
> On 7/18/07, Tom Haddon <to...@gr...> wrote:
> > I think you mean it makes no assumption about the intervals between my
> > dates? If so, I must be missing something. How am I supposed to pass the
> > data to the plot_date function? If I pass it in as integers from epoch I
> > get an error saying "year is out of range". If I pass it in as datetime
> > objects I get an error saying "TypeError: float is required".
> > m +1.415.871.4180
> > www.greenleaftech.net
> 
> Use the function matplotlib.dates.epoch2num to convert your epoch data
> into the mpl date format. That or use "plot" with native python
> datetime obects in the latest mpl release.
John,
Thanks for the help so far. Think I'm making progress. However, I now
have a graph that's solid blue (the default line color, I guess). No
line, just solid blue.
Here's the data:
dates = [732748.962546, 732748.898183, 732748.846273, 732748.793252,
732748.569873, 732748.351782, 732748.296273, 732748.24015,
732748.046238, 732747.990046, 732747.484074, 732747.428762,
732746.858449, 732746.171238, 732745.759757, 732744.970671,
732744.879271, 732744.759259, 732744.344653, 732744.282025,
732744.169954, 732744.101169, 732744.047153, 732743.997037,
732743.412755, 732743.274005, 732743.124907, 732743.074074,
732743.019931, 732742.921481, 732742.870613, 732742.611551,
732742.300451, 732742.249977, 732741.995475, 732741.687882,
732741.425336, 732741.361088, 732741.117581, 732740.613704,
732739.330208, 732738.073218, 732738.013472, 732737.963576,
732737.912951, 732737.587951, 732737.522905, 732737.46213,
732737.405926, 732737.072662, 732736.909317, 732736.861215,
732736.810127, 732736.702442, 732736.411354, 732736.291123]
durations = [66.966666666666669, 68.233333333333334, 64.36666666666666,
67.61666666666666, 72.016666666666666, 71.083333333333329,
65.200000000000003, 72.25, 64.900000000000006, 72.349999999999994,
73.233333333333334, 68.950000000000003, 72.316666666666663,
62.966666666666669, 69.549999999999997, 71.316666666666663,
63.983333333333334, 68.166666666666671, 69.266666666666666,
65.933333333333337, 67.433333333333337, 71.700000000000003,
68.86666666666666, 62.81666666666667, 63.266666666666666,
68.950000000000003, 67.099999999999994, 64.0, 69.233333333333334,
69.783333333333331, 64.033333333333331, 64.316666666666663, 63.75,
63.43333333333333, 63.5, 63.233333333333334, 63.383333333333333,
67.816666666666663, 63.100000000000001, 63.916666666666664,
67.783333333333331, 61.483333333333334, 64.049999999999997,
62.733333333333334, 64.166666666666671, 62.583333333333336,
66.61666666666666, 63.100000000000001, 67.299999999999997,
64.183333333333337, 63.200000000000003, 60.366666666666667, 63.25,
63.200000000000003, 64.38333333333334, 62.5]
And here's the code:
 matplotlib.use('Cairo')
 fig = Figure()
 canvas = FigureCanvas(fig)
 ax = fig.add_subplot(111)
 ax.plot_date(dates, durations)
 ax.set_title('Title')
 ax.grid(True)
 ax.set_xlabel('Date')
 ax.set_ylabel('Duration in Minutes')
 canvas.draw()
 imdata=StringIO()
 fig.savefig(imdata,format='png')
 return HttpResponse(imdata.getvalue(), mimetype='image/png')
Any ideas what I'm missing?
Thanks, Tom
> 
> JDH
-- 
----------------------------------
Tom Haddon
mailto:to...@gr...
m +1.415.871.4180
www.greenleaftech.net
From: Tom H. <to...@gr...> - 2007年07月19日 21:02:21
On Wed, 2007年07月18日 at 20:02 -0500, John Hunter wrote:
> On 7/18/07, Tom Haddon <to...@gr...> wrote:
> > I think you mean it makes no assumption about the intervals between my
> > dates? If so, I must be missing something. How am I supposed to pass the
> > data to the plot_date function? If I pass it in as integers from epoch I
> > get an error saying "year is out of range". If I pass it in as datetime
> > objects I get an error saying "TypeError: float is required".
> > m +1.415.871.4180
> > www.greenleaftech.net
> 
> Use the function matplotlib.dates.epoch2num to convert your epoch data
> into the mpl date format. That or use "plot" with native python
> datetime obects in the latest mpl release.
John,
Thanks for the help so far. Think I'm making progress. However, I now
have a graph that's solid blue (the default line color, I guess). No
line, just solid blue.
Here's the data:
dates = [732748.962546, 732748.898183, 732748.846273, 732748.793252,
732748.569873, 732748.351782, 732748.296273, 732748.24015,
732748.046238, 732747.990046, 732747.484074, 732747.428762,
732746.858449, 732746.171238, 732745.759757, 732744.970671,
732744.879271, 732744.759259, 732744.344653, 732744.282025,
732744.169954, 732744.101169, 732744.047153, 732743.997037,
732743.412755, 732743.274005, 732743.124907, 732743.074074,
732743.019931, 732742.921481, 732742.870613, 732742.611551,
732742.300451, 732742.249977, 732741.995475, 732741.687882,
732741.425336, 732741.361088, 732741.117581, 732740.613704,
732739.330208, 732738.073218, 732738.013472, 732737.963576,
732737.912951, 732737.587951, 732737.522905, 732737.46213,
732737.405926, 732737.072662, 732736.909317, 732736.861215,
732736.810127, 732736.702442, 732736.411354, 732736.291123]
durations = [66.966666666666669, 68.233333333333334, 64.36666666666666,
67.61666666666666, 72.016666666666666, 71.083333333333329,
65.200000000000003, 72.25, 64.900000000000006, 72.349999999999994,
73.233333333333334, 68.950000000000003, 72.316666666666663,
62.966666666666669, 69.549999999999997, 71.316666666666663,
63.983333333333334, 68.166666666666671, 69.266666666666666,
65.933333333333337, 67.433333333333337, 71.700000000000003,
68.86666666666666, 62.81666666666667, 63.266666666666666,
68.950000000000003, 67.099999999999994, 64.0, 69.233333333333334,
69.783333333333331, 64.033333333333331, 64.316666666666663, 63.75,
63.43333333333333, 63.5, 63.233333333333334, 63.383333333333333,
67.816666666666663, 63.100000000000001, 63.916666666666664,
67.783333333333331, 61.483333333333334, 64.049999999999997,
62.733333333333334, 64.166666666666671, 62.583333333333336,
66.61666666666666, 63.100000000000001, 67.299999999999997,
64.183333333333337, 63.200000000000003, 60.366666666666667, 63.25,
63.200000000000003, 64.38333333333334, 62.5]
And here's the code:
 matplotlib.use('Cairo')
 fig = Figure()
 canvas = FigureCanvas(fig)
 ax = fig.add_subplot(111)
 ax.plot_date(dates, durations)
 ax.set_title('Title')
 ax.grid(True)
 ax.set_xlabel('Date')
 ax.set_ylabel('Duration in Minutes')
 canvas.draw()
 imdata=StringIO()
 fig.savefig(imdata,format='png')
 return HttpResponse(imdata.getvalue(), mimetype='image/png')
Any ideas what I'm missing?
Thanks, Tom
> 
> JDH
-- 
----------------------------------
Tom Haddon
mailto:to...@gr...
m +1.415.871.4180
www.greenleaftech.net
From: Eric F. <ef...@ha...> - 2007年07月19日 19:57:27
fred wrote:
> Eric Firing a écrit :
>> Fred,
>>
>> In image.py, the AxesImage.__init__() includes:
>>
>> self._interpd = {
>> 'nearest' : _image.NEAREST,
>> 'bilinear' : _image.BILINEAR,
>> 'bicubic' : _image.BICUBIC,
>> 'spline16' : _image.SPLINE16,
>> 'spline36' : _image.SPLINE36,
>> 'hanning' : _image.HANNING,
>> 'hamming' : _image.HAMMING,
>> 'hermite' : _image.HERMITE,
>> 'kaiser' : _image.KAISER,
>> 'quadric' : _image.QUADRIC,
>> 'catrom' : _image.CATROM,
>> 'gaussian' : _image.GAUSSIAN,
>> 'bessel' : _image.BESSEL,
>> 'mitchell' : _image.MITCHELL,
>> 'sinc' : _image.SINC,
>> 'lanczos' : _image.LANCZOS,
>> 'blackman' : _image.BLACKMAN,
>> }
>>
>> Logically I suspect this should be a class attribute, not an instance 
>> attribute, which would make things easier for you (and is an easy 
>> change to make--I can make it unless someone quickly points out why 
>> this would be a mistake.) Maybe the keys should be a separate class 
>> attribute, with no underscore, since although the values in this 
>> dictionary may be implementation-dependent, the keys should not 
>> be--they are part of the external interface.
>>
>> Let me know if making these changes in svn is worthwhile.
>>
> In fact, I would like something like datad for colormaps.
> I use it like this:
> 
> def __init__(self, **traits):
> HasTraits.__init__(self, **traits)
> 
> dict_colormaps = copy(datad)
> self.cmap = get_cmap(self.default_colormap)
> for cm in dict_colormaps.keys():
> if (cm[-2:] == '_r'):
> dict_colormaps.pop(cm)
> 
> Doing this, I can display in my traits app the list of colormaps.
> 
> I would like to have something similar for available interpolation
> methods.
> 
> I guess that implies to remove intperd from the AxesImage class,
> as datad does not belong to any class, IIUC.
I don't understand; it seems to me that all you need is _interpd.keys(), 
and since this is specific to AxesImage, it should be an attribute of 
that class, say AxesImage.interpolations. You can't add interpolation 
methods, and they have no meaning outside AxesImage (or the code it 
calls). The colormap dictionary is different: much more general and 
flexible, so it is where it belongs: outside any class.
Eric
> 
> Obviously, I can build this list myself, hard-coding it,
> but I would prefer something "cleaner".
> 
> 
> Cheers,
> 
From: fred <fr...@gm...> - 2007年07月19日 19:41:55
Eric Firing a écrit :
> Fred,
>
> In image.py, the AxesImage.__init__() includes:
>
> self._interpd = {
> 'nearest' : _image.NEAREST,
> 'bilinear' : _image.BILINEAR,
> 'bicubic' : _image.BICUBIC,
> 'spline16' : _image.SPLINE16,
> 'spline36' : _image.SPLINE36,
> 'hanning' : _image.HANNING,
> 'hamming' : _image.HAMMING,
> 'hermite' : _image.HERMITE,
> 'kaiser' : _image.KAISER,
> 'quadric' : _image.QUADRIC,
> 'catrom' : _image.CATROM,
> 'gaussian' : _image.GAUSSIAN,
> 'bessel' : _image.BESSEL,
> 'mitchell' : _image.MITCHELL,
> 'sinc' : _image.SINC,
> 'lanczos' : _image.LANCZOS,
> 'blackman' : _image.BLACKMAN,
> }
>
> Logically I suspect this should be a class attribute, not an instance 
> attribute, which would make things easier for you (and is an easy 
> change to make--I can make it unless someone quickly points out why 
> this would be a mistake.) Maybe the keys should be a separate class 
> attribute, with no underscore, since although the values in this 
> dictionary may be implementation-dependent, the keys should not 
> be--they are part of the external interface.
>
> Let me know if making these changes in svn is worthwhile.
>
In fact, I would like something like datad for colormaps.
I use it like this:
 def __init__(self, **traits):
 HasTraits.__init__(self, **traits)
 
 dict_colormaps = copy(datad)
 self.cmap = get_cmap(self.default_colormap)
 for cm in dict_colormaps.keys():
 if (cm[-2:] == '_r'):
 dict_colormaps.pop(cm)
Doing this, I can display in my traits app the list of colormaps.
I would like to have something similar for available interpolation
methods.
I guess that implies to remove intperd from the AxesImage class,
as datad does not belong to any class, IIUC.
 
Obviously, I can build this list myself, hard-coding it,
but I would prefer something "cleaner".
Cheers,
-- 
http://scipy.org/FredericPetit
From: Eric F. <ef...@ha...> - 2007年07月19日 18:48:11
Fred,
In image.py, the AxesImage.__init__() includes:
 self._interpd = {
 'nearest' : _image.NEAREST,
 'bilinear' : _image.BILINEAR,
 'bicubic' : _image.BICUBIC,
 'spline16' : _image.SPLINE16,
 'spline36' : _image.SPLINE36,
 'hanning' : _image.HANNING,
 'hamming' : _image.HAMMING,
 'hermite' : _image.HERMITE,
 'kaiser' : _image.KAISER,
 'quadric' : _image.QUADRIC,
 'catrom' : _image.CATROM,
 'gaussian' : _image.GAUSSIAN,
 'bessel' : _image.BESSEL,
 'mitchell' : _image.MITCHELL,
 'sinc' : _image.SINC,
 'lanczos' : _image.LANCZOS,
 'blackman' : _image.BLACKMAN,
 }
Logically I suspect this should be a class attribute, not an instance 
attribute, which would make things easier for you (and is an easy change 
to make--I can make it unless someone quickly points out why this would 
be a mistake.) Maybe the keys should be a separate class attribute, 
with no underscore, since although the values in this dictionary may be 
implementation-dependent, the keys should not be--they are part of the 
external interface.
Let me know if making these changes in svn is worthwhile.
Eric
fred wrote:
> Eric Firing a écrit :
>> fred wrote:
>>> Hi,
>>>
>>> How can I get the list of the available interpolation functions
>>> used by imshow() ?
>>>
>>> TIA.
>>>
>>> Cheers,
>>>
> Sorry, I was not clear.
> 
> I want to get the list, not to know, in order to set it in a trait 
> object, for instance,
> using something like interpd.keys().
> 
> TIA.
> 
> Cheers,
> 
From: fred <fr...@gm...> - 2007年07月19日 18:24:09
Eric Firing a écrit :
> fred wrote:
>> Hi,
>>
>> How can I get the list of the available interpolation functions
>> used by imshow() ?
>>
>> TIA.
>>
>> Cheers,
>>
Sorry, I was not clear.
I want to get the list, not to know, in order to set it in a trait 
object, for instance,
using something like interpd.keys().
TIA.
Cheers,
-- 
http://scipy.org/FredericPetit
From: Eric F. <ef...@ha...> - 2007年07月19日 17:50:56
fred wrote:
> Hi,
> 
> How can I get the list of the available interpolation functions
> used by imshow() ?
> 
> TIA.
> 
> Cheers,
> 
ipython -pylab
imshow?
or
ipython
import pylab
pylab.imshow?
or
python
import pylab
help(pylab.imshow)
Eric
From: fred <fr...@gm...> - 2007年07月19日 17:01:47
Hi,
How can I get the list of the available interpolation functions
used by imshow() ?
TIA.
Cheers,
-- 
http://scipy.org/FredericPetit
Hi Mike.
After another day of fiddling (including a new build of Python using
--enable-uncode=ucs4) I've decided to return to my barely working
installation and generate plots on a separate machine. I tried removing
/usr/local and it caused more trouble than progress. I've got to get
some results asap so will return to this problem once I can perform all
my calculations on another machine.
Until then, thanks for the tips!
Best regards,
Mark.
Michael Droettboom wrote:
> mark starnes wrote:
>> Hi Mike, thanks for responding.
>>
>> I spent most of last night with this, re-installing Python using SuSE's
>> package manager, re-installing matplotlib the same way. No joy. I
>> tried downloading the matplotlib source and found that when I attempted
>> to install, setup.py claimed I didn't have gtk available as a Python
>> import. Checking this, I found it to be true although the installation
>> directories are present. Re-installing gtk and things that depended on
>> it had no effect - it still wont import.
>>
>> Checking another machine, I found it worked ok with gtk, pylab and
>> anything else I could test. The file versions and directory structures
>> were the same.
>>
>> Following your UCS2 / UCS4 comments and a scroogle search, I found this:
>>
>> http://copia.ogbuji.net/blog/2006-01-09/Confusion_
>>
>> sys.maxunicode is set to 65535 on the non-working installation.
>> sys.unicode is set to 1114111 on the working installation! How did they
>> become different? How can I get them to match?
>> 
> The one that returns 65535 is 16-bit UCS2. That probably was built from
> source, since most Linux distributions ship Python as UCS4.
>> Checking sys.prefix on both installations shows the working machine to
>> be '/usr', the non working, '/usr/local'.
>> 
> That's another good data point. The non-working one was built from
> source, and not from an installed SuSE package.
>> $ whereis python
>> Generates thirteen results on the working installation, one of which
>> refers to a /local/ type entry. The non-working installation shows
>> fifteen entries, five of which contain '/local/.
>> 
> What's most important is what comes first, because that's what will run
> when you simply type 'python'. (And sys.prefix tells you that, too).
> 
> These are all clues without a definitive answer, but I'd put my money
> on: you have a source-built Python sitting around in /usr/local which
> can not access and is incompatible with all of the package-installed
> stuff you have.
>> To be honest, I'm lost. I'd like to remove Python and re-install it,
>> with all the modules I'm now using. Removing it with SuSE's package
>> manager generates all sorts of problems with dependencies. Updating it
>> has no effect. Is there a way to convince the system to start afresh
>> (assuming that's the best approach), maybe removing the local settings?
>> 
> There's probably hundreds of crucial things that depend on Python, which
> is why removing it causes all of the dependency problems.
> 
> I almost feel guilty saying this, but if you don't want to keep anything
> you've built from source (including non-Python stuff), you could
> *backup* and then remove your /usr/local folder. I can't stress the
> backup part enough ;) Then you should (most likely) only be dealing
> with stuff installed from SuSE packages. Uninstalling things built from
> source is usually not directly possible without using a tool like
> checkinstall.
> 
> You may also want to make sure that the PYTHONPATH environment variable
> isn't set to anything. That will affect where Python libraries are
> loaded from, and if you want to be in a "default" situation, it should
> be unset.
> 
> Cheers,
> Mike
>>
>> Michael Droettboom wrote:
>> 
>>> I recently ran into a similar problem myself building stuff from source,
>>> but I'm not sure of the specifics with SuSE and their packages etc.
>>>
>>> Python can be configured in two ways -- with two-byte (UCS2) or
>>> four-byte (UCS4) Unicode characters. Apparently the default for a
>>> source installation of Python is UCS2, but many (most) Linux
>>> distributions build it for UCS4. Python extensions built for one
>>> configuration can not be used with a Python built for the other
>>> configuration.
>>>
>>> When Python extensions are built, if all goes well, they will match the
>>> configuration of the Python interpreter. It looks like somehow you have
>>> a mismatch between matplotlib and your Python interpreter.
>>>
>>> If you installed everything from packages, I would expect them all to
>>> match (unless SuSE's quality control has really gone down as of late
>>> ;). Perhaps something is still around from when you built things from
>>> source. Did you at any point build your own Python?
>>>
>>> On a number of Linux distributions (probably including SuSE, but I don't
>>> know for sure), things installed from source are under the /usr/local
>>> tree. To diagnose this, you could see if anything is getting pulled in
>>> from there (rather than from the packaged stuff, which wouldn't be under
>>> /usr/local). For instance "whereis python", will tell you which python
>>> is being used. When you import a Python module, you can use __file__ to
>>> see where it was imported from. For example:
>>>
>>> 
>>>>>> import pylab
>>>>>> pylab.__file__
>>>>>> 
>>> Hope that at least offers some next steps for tracking this down.
>>>
>>> Cheers,
>>> Mike
>>>
>>> mark starnes wrote:
>>> 
>>>> Hi everyone,
>>>>
>>>> I'm running Suse10.2 and installing packages using Yast (after much
>>>> pain
>>>> trying to install Numpy and Scipy without it!). After installing (and
>>>> re-installing) Matplotlib in this way, I get the error,
>>>>
>>>> ImportError: matplotlib/ft2font.so: undefined symbol:
>>>> PyUnicodeUCS4_GetSize
>>>>
>>>> when I attempt to import pylab.
>>>>
>>>> Can anybody help me fix this? I couldn't find any help on the
>>>> matplotlib site and my .matplotlib directory is empty.
>>>>
>>>> Oh, I'm also a bit new to Linux - please be patient!
>>>>
>>>> Thanks in advance,
>>>>
>>>> Mark.
>>>>
>>>> -------------------------------------------------------------------------
>>>>
>>>> This SF.net email is sponsored by DB2 Express
>>>> Download DB2 Express C - the FREE version of DB2 express and take
>>>> control of your XML. No limits. Just data. Click to get it now.
>>>> http://sourceforge.net/powerbar/db2/
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>> 
>>> 
> 
> 
From: John H. <jd...@gm...> - 2007年07月19日 01:02:15
On 7/18/07, Tom Haddon <to...@gr...> wrote:
> I think you mean it makes no assumption about the intervals between my
> dates? If so, I must be missing something. How am I supposed to pass the
> data to the plot_date function? If I pass it in as integers from epoch I
> get an error saying "year is out of range". If I pass it in as datetime
> objects I get an error saying "TypeError: float is required".
> m +1.415.871.4180
> www.greenleaftech.net
Use the function matplotlib.dates.epoch2num to convert your epoch data
into the mpl date format. That or use "plot" with native python
datetime obects in the latest mpl release.
JDH
From: Tom H. <to...@gr...> - 2007年07月18日 23:49:59
On Wed, 2007年07月18日 at 18:37 -0500, John Hunter wrote:
> On 7/18/07, Tom Haddon <to...@gr...> wrote:
> \> What I mean by this is that I'm not collecting the data at regular time
> > intervals. So I'd like to plot this, and have found that the plot_date
> > function seems to be designed for specific known time intervals. Instead
> 
> Nope, it makes so assumption about the intervals between your dates.
I think you mean it makes no assumption about the intervals between my
dates? If so, I must be missing something. How am I supposed to pass the
data to the plot_date function? If I pass it in as integers from epoch I
get an error saying "year is out of range". If I pass it in as datetime
objects I get an error saying "TypeError: float is required".
Thanks, Tom
> 
> JDH
-- 
----------------------------------
Tom Haddon
mailto:to...@gr...
m +1.415.871.4180
www.greenleaftech.net
From: John H. <jd...@gm...> - 2007年07月18日 23:37:09
On 7/18/07, Tom Haddon <to...@gr...> wrote:
\> What I mean by this is that I'm not collecting the data at regular time
> intervals. So I'd like to plot this, and have found that the plot_date
> function seems to be designed for specific known time intervals. Instead
Nope, it makes so assumption about the intervals between your dates.
JDH
From: Tom H. <to...@gr...> - 2007年07月18日 23:34:14
Hi Folks,
Newbie question here...
I have a question about plotting data with irregular dates. Here's a
sample of my data (completely fabricated):
2007年06月29日 20:22:03, 612
2007年07月18日 09:07:03, 658
2007年07月19日 11:07:05, 600
2007年07月19日 15:12:07, 734
etc., etc., etc..
What I mean by this is that I'm not collecting the data at regular time
intervals. So I'd like to plot this, and have found that the plot_date
function seems to be designed for specific known time intervals. Instead
I am currently converting each timestamp to an integer in seconds since
the epoch, and then plotting that. It works fine, except that I'd then
like to be able to display the correct dates in for the x-axis rather
than integers. I'm not sure how to override the values that are
displayed on the x-axis. Can anyone help out?
Here's my current code (this is within Django - import statements
omitted):
 start_date = datetime.date(2006, 3, 1)
 end_date = datetime.date(2007, 3, 31)
 logs = Item.objects.filter(processing_start__range=(start_date,
end_date))
 dates = [float(time.mktime(p.processing_start.timetuple())) for p in
logs]
 durations = [float(p.duration()) for p in logs]
 matplotlib.use('Cairo')
 fig = Figure()
 canvas = FigureCanvas(fig)
 ax = fig.add_subplot(111)
 ax.plot(dates, durations)
 ax.set_title('Durations from %s to %s' % (start_date, end_date))
 ax.grid(True)
 ax.set_xlabel('Date')
 ax.set_ylabel('Duration in Minutes')
 canvas.draw()
 imdata=StringIO()
 fig.savefig(imdata,format='png')
 return HttpResponse(imdata.getvalue(), mimetype='image/png')
Any help appreciated.
Thanks, Tom
-- 
----------------------------------
Tom Haddon
mailto:to...@gr...
m +1.415.871.4180
www.greenleaftech.net
From: <jk...@ik...> - 2007年07月18日 19:11:11
Lionel Roubeyrie <lro...@li...>
writes:
> I've got a problem with saving plots in pdf format like you can see in the 
> following output. It seems encodings.cp1252 doesn't have a decoding_map 
> method (but a decoding_table one).
> Is it a bug or a problem in my encodings file?
It's a bug, fixed in svn some time ago. Here's the patch if you want to
fix it in your version:
From: Darren D. <dd...@co...> - 2007年07月18日 17:04:55
I just commited Alexander Schmolck's patch to make usetex respect changes to 
rc settings. TexManager used to configure its support for latex at load time, 
and ignored later changes to rc settings. Thank you Alexander for the patch.
Alexander - I am sorry it took so long to commit this patch. I couldn't 
directly apply it, because it conflicted with some changes to support 
unicode. Also, the recent addition of validating changes to rcParams helped 
simplify things somewhat.
Darren
On Friday 18 May 2007 12:02:30 pm Alexander Schmolck wrote:
> > You should also make your rc changes before importing pylab. That might
> > be considered a bug, and would take some work to fix.
>
> I think I've fixed the bug (well, mostly see TODO), as well as a few other
> minor bugs:
>
> - ``__init__.py``
> * defaultParams value tuple[0] ought to be the parsed value, as
> far as I can see, but the fonts are given as comma-seperated string,
> which will result in texmanager treating individual chars as 'fonts'
>
> - ``texmanager.py``
> * 'Computer Modern Sans serif' rather than 'Computer Modern Sans-serif'
> as on wiki; I haven't changed it because I don't know which spelling is
> desired -- I'd personally prefer two, because it's consistent with the most
> common spelling of 'sans-serif' and the spelling elsewhere in MPL *
> condensed `TexManger.__init__` and fixed the undeclare var bug in the
> warning; also added check that rcParams['font.*'] is not a string (see
> above)
> * `TexManger.get_font_config` now checks that font configuration is in
> synch with rcParams and if not re-initialized `self` to recompute it
> * changed ``self._font_config -> self.get_font_config()`` and added it to
> the key generation for TexManger.get_rgba -- so now every change the
> relevant rcParams font entries will now recompute or select the *correct*
> cached value (Note I think for get_rgba ._font_config would suffice, but
> since it looks like it needs to be modified anyway and .get_font_config is
> safer I opted for the latter).
> * added a few consistency checks
>
> This is the first time I've really looked at (and hacked) the MPL code, so
> my solution might have issues, I'm certainly not aware of the big picture.
> However I'm pretty sure that parts of the patch should be useful and that
> I've correctly identified some small bugs.
>
> TODO
> ----
>
> A) the wiki page still needs to be corrected; I'm happy to do it, but it
> would be useful to know:
> 1. what exactly I should change to ``rcParams`` (all ``rc`` calls?)
> 2. how the 'Computer Modern Sans'-'/' 'serif' thing will be resolved
> 3. if this patch is likely to be accepted in some form (because then
> I'll also mention that the need to import pylab afterwards will go away in
> svn/future versions)
>
> B) TexManger.get_rgba needs to deal with font-properties other than size to
> do its job properly (i.e. return the *correct* cached text); that means
> that 2 places in backend_agg.py will also need changs since it uses
> insufficient info to find the right cached text (no properites). How to do
> this involves making design decisions that I think one of the developers
> has to take, so I didn't do anything about it. I got the impression that
> just passing ``prop.font_family`` together with ``size`` might handle most
> cases, but I have no idea how latex-font-properties are really meant to be
> handled.
>
> In addition to the patch, I've appended some file to test and demonstrate
> the new (hopefully better); behavior (just %run) -- the patch currently is
> full of print-DEBUG statements, I've left them in because it makes easier
> to verify what's going on and B) still ought to be fixed; they're easy to
> take remove (grep DEBUG), but if it's an issue I'm happy to supply the
> patch without them.
>
> hope this is useful,
>
> 'as
-- 
Darren S. Dale, Ph.D.
Staff Scientist
Cornell High Energy Synchrotron Source
Cornell University
275 Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853
dd...@co...
office: (607) 255-3819
fax: (607) 255-9001
http://www.chess.cornell.edu
From: Eric F. <ef...@ha...> - 2007年07月18日 16:41:12
Darren Dale wrote:
> On Wednesday 18 July 2007 6:56:18 am Armando Serrano Lombillo wrote:
>> Yes!
>> matplotlib is beautiful. Thanks everybody for your help.
> 
> Here is another way, with numpy arrays:
> 
> data[data==0]=nan
> 
> plot(data)
Support for nan in input arrays in mpl is not uniform, though, so the 
masked array alternative is preferred.
Eric
From: Pierre GM <pgm...@gm...> - 2007年07月18日 15:57:56
On Wednesday 18 July 2007 07:11:04 Darren Dale wrote:
> Here is another way, with numpy arrays:
>
> data[data==0]=nan
My 2c:
That won't work if data is int_, as nan will be treated as 0.
I'm fairly partial to masked arrays...
From: Lionel R. <lro...@li...> - 2007年07月18日 13:30:45
Hi all,
I've got a problem with saving plots in pdf format like you can see in the=
=20
following output. It seems encodings.cp1252 doesn't have a decoding_map=20
method (but a decoding_table one).
Is it a bug or a problem in my encodings file?
thanks
############################
|Diagrammes|[68]>matplotlib.__version__
 Out [68]:'0.90.1'
|Diagrammes|[69]>plot(arange(6))
 Out [69]:[<matplotlib.lines.Line2D instance at 0x8cd0b2c>]
|Diagrammes|[70]>savefig('tutu.pdf')
=2D------------------------------------------------------------------------=
=2D-
<type 'exceptions.AttributeError'> Traceback (most recent call last)
/home/lionel/Diagrammes/<ipython console> in <module>()
/usr/lib/python2.5/site-packages/matplotlib/pylab.py in savefig(*args,=20
**kwargs)
 794 def savefig(*args, **kwargs):
 795 fig =3D gcf()
=2D-> 796 return fig.savefig(*args, **kwargs)
 797 if Figure.savefig.__doc__ is not None:
 798 savefig.__doc__ =3D dedent(Figure.savefig.__doc__)
/usr/lib/python2.5/site-packages/matplotlib/figure.py in savefig(self, *arg=
s,=20
**kwargs)
 757 kwargs[key] =3D rcParams['savefig.%s'%key]
 758
=2D-> 759 self.canvas.print_figure(*args, **kwargs)
 760
 761 def colorbar(self, mappable, cax=3DNone, **kw):
/usr/lib/python2.5/site-packages/matplotlib/backends/backend_agg.py in=20
print_figure(self, filename, dpi, facecolor, edgecolor, orientation,=20
**kwargs)
 495 if printfunc is not None:
 496 try:
=2D-> 497 printfunc(filename, dpi, facecolor, edgecolor,=20
orientation, **kwargs)
 498 except:
 499 # restore the original figure properties
/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in=20
print_figure(self, filename, dpi, facecolor, edgecolor, orientation,=20
**kwargs)
 1393 self.figure.draw(renderer)
 1394 renderer.finalize()
=2D> 1395 file.close()
 1396
 1397 class FigureManagerPdf(FigureManagerBase):
/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in=20
close(self)
 399 # objects
 400 self.endStream()
=2D-> 401 self.writeFonts()
 402 self.writeObject(self.alphaStateObject,
 403 dict([(val[0], val[1])
/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in=20
writeFonts(self)
 454 fontdictObject =3D self._write_afm_font(filename)
 455 else:
=2D-> 456 fontdictObject =3D self.embedTTF(filename)
 457 fonts[Fx] =3D fontdictObject
 458 #print >>sys.stderr, filename
/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in=20
embedTTF(self, filename)
 506 width =3D font.load_char(unicode,=20
flags=3DLOAD_NO_SCALE).horiAdvance
 507 return cvt(width)
=2D-> 508 widths =3D [ get_char_width(charcode) for charcode in=20
range(firstchar, lastchar+1) ]
 509
 510 widthsObject =3D self.reserveObject('font widths')
/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in=20
get_char_width(charcode)
 503 firstchar, lastchar =3D 0, 255
 504 def get_char_width(charcode):
=2D-> 505 unicode =3D cp1252.decoding_map[charcode] or 0
 506 width =3D font.load_char(unicode,=20
flags=3DLOAD_NO_SCALE).horiAdvance
 507 return cvt(width)
<type 'exceptions.AttributeError'>: 'module' object has no=20
attribute 'decoding_map'
################################
=2D-=20
Lionel Roubeyrie - lro...@li...
Charg=C3=A9 d'=C3=A9tudes et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr
2 messages has been excluded from this view by a project administrator.

Showing results of 219

<< < 1 2 3 4 5 .. 9 > >> (Page 3 of 9)
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 によって変換されたページ (->オリジナル) /