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

Showing results of 419

<< < 1 .. 13 14 15 16 17 > >> (Page 15 of 17)
From: Ryan M. <rm...@gm...> - 2009年10月05日 02:18:35
On Sun, Oct 4, 2009 at 4:21 PM, Robert Kern <rob...@gm...> wrote:
> On 2009年10月04日 15:27 PM, Christopher Barker wrote:
>> Václav Šmilauer wrote:
>>
>>> about a year ago I developed for my own purposes a routine for averaging
>>> irregularly-sampled data using gaussian average.
>>
>> is this similar to Kernel Density estimation?
>>
>> http://www.scipy.org/doc/api_docs/SciPy.stats.kde.gaussian_kde.html
>
> No. It is probably closer to radial basis function interpolation (in fact, it
> almost certainly is a form of RBFs):
>
> http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html#id1
Except in radial basis function interpolation, you solve for the
weights that give the original values at the original data points.
Here, it's just a inverse-distance weighted average, where the weights
are chosen using an exp(-x^2/A) relation. There's a huge difference
between the two when you're dealing with data with noise.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Eric F. <ef...@ha...> - 2009年10月04日 23:51:18
Václav Šmilauer wrote:
> Hi,
> 
> about a year ago I developed for my own purposes a routine for averaging
> irregularly-sampled data using gaussian average. I would like to
> contribute it to matplotlib, after a clean-up, if there is interest.
This sounds like a nice thing to have, but I am wondering whether it 
should go into scipy instead of mpl. On the other hand, I do see the 
rationale for simply putting it in mpl so it can be used for contouring 
etc. without adding an external dependency.
> 
> First it stores all data points in a (regular) grid. One can ask for
> value at arbitrary point within the grid range: based on stDev
> parameter, all data points within some distance (user-settable) are
> weighted using the normal distribution function and then the average is
> returned. Storing data in grid avoids searching all data points every
> time, only those within certain grid-range will be used.
> 
Good idea.
> It would be relatively easy to extend to another distribution types
> (lines 120-130), such as elliptic-normal distribution, with different
> stDev in each direction.
This sounds a lot like "optimal interpolation". Comments? Certainly, 
in many fields it is essential to be able to specify different std for x 
and y.
> 
> The code is here:
> http://bazaar.launchpad.net/~yade-dev/yade/trunk/annotate/head%
> 3A/lib/smoothing/WeightedAverage2d.hpp
> 
> I should be able to convert it to accept numpy arrays, wrap using Python
> API instead of boost::python and write some documentation. Let me know
> if matplotlib-devel list would be more appropriate for this discussion.
matplotlib-users is fine for checking for interest; it may make sense to 
move more technical discussion to -devel. But I will ignore that for now.
Is wrapping with cython a reasonable option? I don't think we have any 
cython in mpl at present, but it seems to me like the way to go for many 
things, especially new things. It is readable, flexible, and promises 
to make the eventual transition to Python 3.1 painless for the 
components that use it. I realize it is C-oriented, not C++ oriented, 
but my understanding is that the wrapping of C++ is still reasonable in 
many cases. (I have not tried it.)
Eric
> 
> Cheers, Vaclav
> 
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jason S. <jas...@gm...> - 2009年10月04日 22:33:01
I'm drawing a figure for inclusion into a LaTeX document, and I'm
having trouble getting matplotlib to export a .pdf that 'tightly'
encapsulates the drawing that is generated - I get a lot of whitespace
at the bottom, in particular.
After some experimentation, I've found that the culprit is an Arc that
I am drawing near the bottom of the page. The angle range is something
like pi/4 to 3*pi/4, so the actual line is located well above the
center of the circle defining the arc, but it appears that the arc is
reporting a bounding box that is the same as would be reported for a
circle.
Perhaps this isn't a bug and this behavior is useful to some, but I'd
really like to be able to get the resulting image fit tightly around
the drawn lines and not invisible bounding boxes.
Can anyone help me out? Is there some way I can force matplotlib to
'clip' the output?
Thanks,
Jason
P.S. I'm using matplotlib v. 0.98.5.2 on Python 2.6 running on x86_64 Linux
From: Eric F. <ef...@ha...> - 2009年10月04日 22:26:43
Dr. Phillip M. Feldman wrote:
> The attached script creates a colormap containing five colors. At the end of
> the script, I print the value of cmap.N, and it is 256 rather than 5.
> 
> http://www.nabble.com/file/p25740788/bugdemo.py bugdemo.py 
No, it is not a bug. You never told LinearSegmentedColormap that you 
wanted a map with other than 256 colors, which is the default. If you 
want a colormap with 3 colors, use a ListedColormap. In fact, as I 
wrote before, this, together with a BoundaryNorm, is the best way to 
handle the mapping of discrete colors.
Eric
From: Robert K. <rob...@gm...> - 2009年10月04日 21:25:20
On 2009年10月04日 15:27 PM, Christopher Barker wrote:
> Václav Šmilauer wrote:
>
>> about a year ago I developed for my own purposes a routine for averaging
>> irregularly-sampled data using gaussian average.
>
> is this similar to Kernel Density estimation?
>
> http://www.scipy.org/doc/api_docs/SciPy.stats.kde.gaussian_kde.html
No. It is probably closer to radial basis function interpolation (in fact, it 
almost certainly is a form of RBFs):
http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html#id1
-- 
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
 -- Umberto Eco
From: Christopher B. <Chr...@no...> - 2009年10月04日 20:27:42
Václav Šmilauer wrote:
> about a year ago I developed for my own purposes a routine for averaging
> irregularly-sampled data using gaussian average.
is this similar to Kernel Density estimation?
http://www.scipy.org/doc/api_docs/SciPy.stats.kde.gaussian_kde.html
In any case, it sounds more like an appropriate contribution to scipy 
than MPL.
> First it stores all data points in a (regular) grid.
What if your data points are not on a regular grid? Wouldn't this be a 
way to interpolate onto such a grid?
> Storing data in grid avoids searching all data points every
> time, only those within certain grid-range will be used.
another option would be to store the points in some sort of spatial 
index, like an r-tree.
> I should be able to convert it to accept numpy arrays,
key.
> wrap using Python
> API instead of boost::python
I'd consider Cython for that.
sounds like a useful module,
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Dr. P. M. F. <pfe...@ve...> - 2009年10月04日 18:37:03
The attached script creates a colormap containing five colors. At the end of
the script, I print the value of cmap.N, and it is 256 rather than 5.
http://www.nabble.com/file/p25740788/bugdemo.py bugdemo.py 
-- 
View this message in context: http://www.nabble.com/possible-bug-in-LinearSegmentedColormap-tp25740788p25740788.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Gökhan S. <gok...@gm...> - 2009年10月04日 16:34:42
Hello,
Are there any opinions how to make this legend picking work after a zoom or
pan event? There is no way to bring the cursor into its beginning shape and
therefore non of the clicking works as expected.
On Sun, Oct 4, 2009 at 9:37 AM, Peter Butterworth <bu...@gm...> wrote:
> Hi,
>
> I am a bit surprised that a line that isn't visible remains pickable
> by default :
>
> # toggle line visibility:
> vis = not line.get_visible()
> line.set_visible(vis)
> # by default a line would remain pickable even if not visible :
> if vis : line.set_picker(5)
> else : line.set_picker(None)
>
> I've attached my line + legend picker example, in case it is of any
> use to anybody.
>
>
> On Mon, Sep 28, 2009 at 3:43 AM, John Hunter <jd...@gm...> wrote:
> > On Sun, Sep 27, 2009 at 3:45 PM, Peter Butterworth <bu...@gm...>
> wrote:
> >> On Sun, Sep 27, 2009 at 9:31 PM, Jae-Joon Lee <lee...@gm...>
> wrote:
> >>>> Some feedback: If plotting a line2D as discrete points rather than a
> >>>> continuous line, you must use numpoints=2 for the legend picking to
> actually
> >>>> occur on the points. The alpha blending doesn't work on the legend
> symbols
> >>>> however.
> >>>>
> >>>
> >>> I tried numpoints=1,2,3 but all worked for me. Can someone else confirm
> this?
> >>
> >> I'm using windows and mpl 0.99.0:
> >
> > Most of the enhancements to support legend picking happened after 99.0
> > -- you probably need to be on svn trunk (I don't think 99.1 would work
> > either). The example is working fine for me on svn HEAD (regardless
> > of ncol) with one exception: if I use a marker instead of a line, the
> > alpha is not respected (the line markers are simply turned off).
> > Apparently we need to fix Line2D to respect the alpha setting for
> > markers in this use case.
> >
> > JDH
> >
> >>
> >>
> >>
> >>> The alpha for legend symbols does not work since, inside legend, the
> >>> lines and symbols are drawn by different artists.
> >>>
> >>> Try something like below.
> >>>
> >>>
> >>> legline.set_alpha(1.0)
> >>> try:
> >>> legline._legmarker.set_alpha(1.0)
> >>> except AttributeError:
> >>> pass
> >>>
> >>>
> >>>
> >>>> Is there any other way, I can show in the legend whether the points of
> the
> >>>> series are visible or not ?
> >>>>
> >>>> I thought of changing the labels, but failed to get them to redraw.
> >>>>
> >>>
> >>> Legend.get_texts() method returns the list of Text instances.
> >>>
> >>>
> http://matplotlib.sourceforge.net/api/artist_api.html?highlight=legend#matplotlib.legend.Legend.get_texts
> >>>
> >>> You may modify the returned Text instances.
> >>>
> >>> -JJ
> >>>
> >>
> >> works great.
> >>
> >>
> >>
> >>>
> >>>> # plots:
> >>>> ax.plot(t, y1, 'ro', picker=5, label='lab1')
> >>>> ax.plot(t, y2, 'bo', picker=5, label='lab2')
> >>>>
> >>>> # legend
> >>>> leg = ax.legend(loc='upper left', numpoints=2, fancybox=True,
> shadow=True)
> >>>> lines, labels = ax.get_legend_handles_labels()
> >>>>
> >>>> # Enable picking on the legend lines
> >>>> leglines=leg.get_lines()
> >>>> for legline in leglines: legline.set_picker(5)
> >>
> >>
> ------------------------------------------------------------------------------
> >> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> >> is the only developer event you need to attend this year. Jumpstart your
> >> developing skills, take BlackBerry mobile applications to market and
> stay
> >> ahead of the curve. Join us from November 9&#45;12, 2009. Register
> now&#33;
> >> http://p.sf.net/sfu/devconf
> >> _______________________________________________
> >> Matplotlib-users mailing list
> >> Mat...@li...
> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >>
> >
>
>
>
> --
> thanks,
> peter butterworth
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
-- 
Gökhan
From: Václav Š. <eu...@ar...> - 2009年10月04日 15:11:39
Hi,
about a year ago I developed for my own purposes a routine for averaging
irregularly-sampled data using gaussian average. I would like to
contribute it to matplotlib, after a clean-up, if there is interest.
First it stores all data points in a (regular) grid. One can ask for
value at arbitrary point within the grid range: based on stDev
parameter, all data points within some distance (user-settable) are
weighted using the normal distribution function and then the average is
returned. Storing data in grid avoids searching all data points every
time, only those within certain grid-range will be used.
It would be relatively easy to extend to another distribution types
(lines 120-130), such as elliptic-normal distribution, with different
stDev in each direction.
The code is here:
http://bazaar.launchpad.net/~yade-dev/yade/trunk/annotate/head%
3A/lib/smoothing/WeightedAverage2d.hpp
I should be able to convert it to accept numpy arrays, wrap using Python
API instead of boost::python and write some documentation. Let me know
if matplotlib-devel list would be more appropriate for this discussion.
Cheers, Vaclav
From: Peter B. <bu...@gm...> - 2009年10月04日 14:37:59
Attachments: legend_picking2.py
Hi,
I am a bit surprised that a line that isn't visible remains pickable
by default :
 # toggle line visibility:
 vis = not line.get_visible()
 line.set_visible(vis)
 # by default a line would remain pickable even if not visible :
 if vis : line.set_picker(5)
 else : line.set_picker(None)
I've attached my line + legend picker example, in case it is of any
use to anybody.
On Mon, Sep 28, 2009 at 3:43 AM, John Hunter <jd...@gm...> wrote:
> On Sun, Sep 27, 2009 at 3:45 PM, Peter Butterworth <bu...@gm...> wrote:
>> On Sun, Sep 27, 2009 at 9:31 PM, Jae-Joon Lee <lee...@gm...> wrote:
>>>> Some feedback: If plotting a line2D as discrete points rather than a
>>>> continuous line, you must use numpoints=2 for the legend picking to actually
>>>> occur on the points. The alpha blending doesn't work on the legend symbols
>>>> however.
>>>>
>>>
>>> I tried numpoints=1,2,3 but all worked for me. Can someone else confirm this?
>>
>> I'm using windows and mpl 0.99.0:
>
> Most of the enhancements to support legend picking happened after 99.0
> -- you probably need to be on svn trunk (I don't think 99.1 would work
> either). The example is working fine for me on svn HEAD (regardless
> of ncol) with one exception: if I use a marker instead of a line, the
> alpha is not respected (the line markers are simply turned off).
> Apparently we need to fix Line2D to respect the alpha setting for
> markers in this use case.
>
> JDH
>
>>
>>
>>
>>> The alpha for legend symbols does not work since, inside legend, the
>>> lines and symbols are drawn by different artists.
>>>
>>> Try something like below.
>>>
>>>
>>> legline.set_alpha(1.0)
>>> try:
>>> legline._legmarker.set_alpha(1.0)
>>> except AttributeError:
>>> pass
>>>
>>>
>>>
>>>> Is there any other way, I can show in the legend whether the points of the
>>>> series are visible or not ?
>>>>
>>>> I thought of changing the labels, but failed to get them to redraw.
>>>>
>>>
>>> Legend.get_texts() method returns the list of Text instances.
>>>
>>> http://matplotlib.sourceforge.net/api/artist_api.html?highlight=legend#matplotlib.legend.Legend.get_texts
>>>
>>> You may modify the returned Text instances.
>>>
>>> -JJ
>>>
>>
>> works great.
>>
>>
>>
>>>
>>>> # plots:
>>>> ax.plot(t, y1, 'ro', picker=5, label='lab1')
>>>> ax.plot(t, y2, 'bo', picker=5, label='lab2')
>>>>
>>>> # legend
>>>> leg = ax.legend(loc='upper left', numpoints=2, fancybox=True, shadow=True)
>>>> lines, labels = ax.get_legend_handles_labels()
>>>>
>>>> # Enable picking on the legend lines
>>>> leglines=leg.get_lines()
>>>> for legline in leglines: legline.set_picker(5)
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
>> http://p.sf.net/sfu/devconf
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
-- 
thanks,
peter butterworth
From: Gewton J. <gj...@gm...> - 2009年10月04日 11:32:45
Ok, but there's a class called map color, I think it goes that way. But I
didn't find a way to create map colors with hexadecimal values, only with r,
g, b dicts from 0 to 1.0. I didn't get it.
I also didn't find how to apply this map colors to a pie patch.
On Sat, Oct 3, 2009 at 10:28 PM, Jae-Joon Lee <lee...@gm...> wrote:
> Unfortunately, there is no simple way, as MPL does not support gradient
> yet.
> There is a hard way though, that you create a gradient image by
> yourself and clip it with the appropriate path.
> I guess, the easiest way for a normal user is to export the figure as
> the SVG format and put some gradient using inkscape, or similar tools.
>
> Regards,
>
> -JJ
>
>
> On Wed, Sep 30, 2009 at 12:21 PM, Gewton Jhames <gj...@gm...> wrote:
> > Hello everyone,
> > I wish a simple sample of creating a pie graph filled with a gradient
> from
> > blue(#98D0D8) to a lighter blue(#BAE5EB).
> > Here's the code (I got from the samples):
> >
> > from pylab import *
> >
> >
> >
> > # make a square figure and axes
> > figure(1, figsize=(6,6))
> >
> >
> > ax = axes([0.1, 0.1, 0.8, 0.8])
> >
> >
> >
> > labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
> >
> >
> > fracs = [15,30,45, 10]
> >
> >
> >
> > explode=(0, 0.05, 0, 0)
> >
> >
> > pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%',
> shadow=True)
> >
> >
> > title('Raining Hogs and Dogs', bbox={'facecolor':'0.8', 'pad':5})
> >
> >
> >
> > show()
> >
> > Thanks.
> >
> >
> ------------------------------------------------------------------------------
> > Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> > is the only developer event you need to attend this year. Jumpstart your
> > developing skills, take BlackBerry mobile applications to market and stay
> > ahead of the curve. Join us from November 9&#45;12, 2009. Register
> now&#33;
> > http://p.sf.net/sfu/devconf
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> >
>
From: Jae-Joon L. <lee...@gm...> - 2009年10月04日 01:40:20
Please take a look at the backend_gtk.py if you're going to customize
the toolbar.
fig.canvas.toolbar is derived from gtk.Toolbar. So, you can customize
it as you do for any gtk.Toolbar.
I guess something like below is similar to DeleteToolByPos in wx. I
just grabbed it by doing dir on the toolbar, so there might be a
better way.
fig.canvas.toolbar.remove(fig.canvas.toolbar.get_nth_item(1))
Regards,
-JJ
On Sat, Oct 3, 2009 at 10:53 AM, redrum <jva...@ho...> wrote:
>
> Hi there,
>
> I'm currently trying to have my own navigation toolbar by deleting some
> unuseful buttons.
>
> Solutions given as follows is working for wxpython but not for pygtk since
> DeleteToolByPos cannot be found :
>
> http://www.nabble.com/Navigation-toolbar-w-o-subplot-configuration-button-td18747977.html
>
> Has anyone ever tried to edit navigation toolbar with a pygtk-based
> algorithm and could share his experience ?
>
> Regards,
> --
> View this message in context: http://www.nabble.com/Navigation-toolbar-edit-for-pygtk-based-algorithm-tp25729532p25729532.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2009年10月04日 01:28:33
Unfortunately, there is no simple way, as MPL does not support gradient yet.
There is a hard way though, that you create a gradient image by
yourself and clip it with the appropriate path.
I guess, the easiest way for a normal user is to export the figure as
the SVG format and put some gradient using inkscape, or similar tools.
Regards,
-JJ
On Wed, Sep 30, 2009 at 12:21 PM, Gewton Jhames <gj...@gm...> wrote:
> Hello everyone,
> I wish a simple sample of creating a pie graph filled with a gradient from
> blue(#98D0D8) to a lighter blue(#BAE5EB).
> Here's the code (I got from the samples):
>
> from pylab import *
>
>
>
> # make a square figure and axes
> figure(1, figsize=(6,6))
>
>
> ax = axes([0.1, 0.1, 0.8, 0.8])
>
>
>
> labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
>
>
> fracs = [15,30,45, 10]
>
>
>
> explode=(0, 0.05, 0, 0)
>
>
> pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True)
>
>
> title('Raining Hogs and Dogs', bbox={'facecolor':'0.8', 'pad':5})
>
>
>
> show()
>
> Thanks.
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
As one of who never used Sage, I don't think I'll be any help here.
Anyhow, can you tell us what kind of backed is used by default in the
two environment? I mean the type of the canvas that is initially
created.
It seems to be some dpi issue, but MPL supposed to handle this correctly.
I guess it also works fine if the figure is initially created with the
matching dpi as the savefig (72),?
Regards,
-JJ
On Thu, Oct 1, 2009 at 12:26 PM, <jas...@cr...> wrote:
> Hi everyone,
>
> We're having a problem in Sage where if we specify the dpi of a figure, the
> bottom of the figure is cut off, but only the first time we save it. If we
> save the figure again, with the same arguments, the resulting image looks
> fine. I'm puzzled whether this is a Sage problem or a problem with
> interfacing with matplotlib, since it only happens when we are launch Sage
> (as opposed to just launching the ipython that Sage uses).
>
> More details:
>
> Running the following code in the Sage notebook or from the Sage command
> line gives a figure in which the bottom is cut off and the file is 12K
> instead of 13K. While firefox displays an image in which the bottom is cut
> off, eog (the gnome image viewer) doesn't even display the image, so I think
> the image might be corrupted. When I open the image with Konqueror, it
> seems like the cut off part of the image (about the lower quarter of the
> image) is completely transparent. I've attached the cut off image.
>
> import matplotlib.pyplot as plt
> import numpy
> plt.figure()
> plt.plot(numpy.arange(0,1.1,0.01))
> plt.savefig('foo.png',dpi=72)
>
>
> However, if we immediately save the figure again:
>
> plt.savefig('foo.png',dpi=72)
>
> the resulting image looks fine (i.e., the bottom is not cut off, the file is
> 13K, and eog displays it).
>
>
> If we run the same code again using "sage -ipython" (which just launches
> Sage's ipython, without any Sage initialization), the same code:
>
> import matplotlib.pyplot as plt
> import numpy
> plt.figure()
> plt.plot(numpy.arange(0,1.1,0.01))
> plt.savefig('foo.png',dpi=72)
> works just fine (i.e., the file is correct and complete).
>
> I'm puzzled since we are just using matplotlib commands, not any Sage
> commands. If we remove the "dpi=72" argument from savefig, everything works
> perfectly in all cases. My guess is that there is some sort of
> configuration option that Sage is setting when it starts up, but that is
> overridden or something after the first time matplotlib saves a figure. But
> I have no clue what sort of thing to look for. Does anyone have an idea of
> what could be causing this issue?
>
> Thanks,
>
> Jason
>
> --
> Jason Grout
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jae-Joon L. <lee...@gm...> - 2009年10月04日 00:50:30
http://matplotlib.sourceforge.net/examples/pylab_examples/barchart_demo.html
While the example uses "text", "annotate" is more useful for
fine-tuning the location of texts.
-JJ
On Fri, Oct 2, 2009 at 8:26 AM, marcog <ma...@ga...> wrote:
>
> Hi there
>
> I am plotting a bar graph and would like to label the bars (rectangles) with
> their quantities. If a bar represents 12 items I want a "12" on the top-end
> of the bar, preferable on the edge of the bar and not off the chart as with
> a table.
>
> Is this possible?
>
> Thanks
> Marco
> --
> View this message in context: http://www.nabble.com/Labelling-Rectangles-tp25714962p25714962.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2009年10月04日 00:45:41
What you need to do is to share a normalizer among different surface
plots (this is not just for surface plot, but for all (as far as I
know) color representation that uses colormaps). Note that "norm" can
also be a keyword argument.
Regards,
-JJ
Z1 = 5*np.sin(R)
s1 = ax.plot_surface(X, Y, Z1, rstride=1, cstride=1, cmap=cm.jet)
mynorm = s1.norm
Z2 = np.cos(R)
s2 = ax.plot_surface(X, Y, Z2, rstride=1, cstride=1, cmap=cm.jet)
s2.set_norm(mynorm)
mynorm.vmax = max(Z1.max(), Z2.max())
mynorm.vmin = min(Z1.min(), Z2.min())
On Fri, Oct 2, 2009 at 5:44 PM, Sammo <sam...@gm...> wrote:
> How do I draw two 3D surface plots where the surface patch colors have
> consistent meaning?
>
> Hope this makes sense ...
>
> Currently, I'm just doing two plot_surface commands, each of which has
> cmap=cm.jet. The two surfaces have different shapes and sizes and have
> different highest/lowest points. It seems that the colormap is automatically
> normalised to the highest/lowest values for each surface independently (e.g.
> the highest point on both surfaces is red, even though they are different
> values). Instead, I want the same color to represent the same value on both
> surfaces.
>
> Any ideas will be appreciated. Perhaps there's a way to force the colormap
> to be normalised to a specified range of values?
>
> from mpl_toolkits.mplot3d import Axes3D
> from matplotlib import cm
> import matplotlib.pyplot as plt
> import numpy as np
> fig = plt.figure()
> ax = Axes3D(fig)
> X = np.arange(-5, 5, 0.25)
> Y = np.arange(-5, 5, 0.25)
> X, Y = np.meshgrid(X, Y)
> R = np.sqrt(X**2 + Y**2)
>
> Z = 5*np.sin(R)
> ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet)
>
> Z = np.cos(R)
> ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet)
>
> plt.show()
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Christoph G. <cg...@uc...> - 2009年10月03日 19:12:16
Try changing the line
from matplotlib.toolkits.basemap import Basemap
to
from mpl_toolkits.basemap import Basemap
- Christoph
From: Ross A. <rpa...@gm...> - 2009年10月03日 16:58:10
Hi all,
Here's what I get:
 File "F:\demo.py", line 34, in <module>
 from matplotlib.toolkits.basemap import Basemap
ImportError: No module named toolkits.basemap
I'm on a brand new python 2.6 install on windows. I then installed numpy 1.3
for 2.6, matplotlib .99.1 for 2.6, then basemap .99.4 for 2.6, all from
their binary executable forms. Then I ran
http://en.literateprograms.org/Drawing_on_map_projections_%28Python%29 and
got the above error.
Searching for this error I've found possible problems with dependencies,
which were to be fixed by .99, and problems with .egg installations missing
vital components, but I installed everything from .exes. Ideas? FYI I'm new
to python.
Thanks
From: Gökhan S. <gok...@gm...> - 2009年10月03日 16:00:34
You are welcome. My response to your 2nd question is still unknown, also I
have another question. Anyone knows how to achieve that?
Thanks.
2- I would like to have a grid not only for 10^2, 10^3, 10^4, 10^5 ... but
> also for the minor axis ticks. is it possible ?
>
You can use plt.yticks() to get new ticks as well as grids. Do you know how
to make ticklabels like 5x10^2 etc...? This I couldn't figure yet.
On Wed, Sep 16, 2009 at 2:25 PM, Gökhan Sever <gok...@gm...> wrote:
>
>
> On Tue, Sep 15, 2009 at 1:24 AM, redrum <jva...@ho...> wrote:
>
>>
>> Hi,
>>
>> I have a few questions about the loglog plot :
>>
>> 1- Is there a way to a have axis format with real numbers rather than
>> numbers with exponent ?
>>
>>
> import matplotlib.pyplot as plt
> ax1 = plt.gca()
> ax1.yaxis.set_major_formatter(ticker.FormatStrFormatter("%.2f"))
>
> You can check formatting options from
> http://docs.python.org/library/stdtypes.html#string-formatting-operations
>
>
>
>
>> 2- I would like to have a grid not only for 10^2, 10^3, 10^4, 10^5 ... but
>> also for the minor axis ticks. is it possible ?
>>
>
> You can use plt.yticks() to get new ticks as well as grids. Do you know how
> to make ticklabels like 5x10^2 etc...? This I couldn't figure yet.
>
>
>
>> 3- I use loglog to plot parallel lines. How can I have the function label
>> directly displaid next to the plotted straight lines ?
>>
>> Thanks for your tips.
>>
>
> plt.text and some fine-tuning?
>
> --
> Gökhan
>
-- 
Gökhan
From: redrum <jva...@ho...> - 2009年10月03日 14:54:49
Thanks Gökhan. It helped.
-- 
View this message in context: http://www.nabble.com/loglog-plot-tp25448633p25729540.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: redrum <jva...@ho...> - 2009年10月03日 14:53:44
Hi there,
I'm currently trying to have my own navigation toolbar by deleting some
unuseful buttons.
Solutions given as follows is working for wxpython but not for pygtk since
DeleteToolByPos cannot be found :
http://www.nabble.com/Navigation-toolbar-w-o-subplot-configuration-button-td18747977.html
Has anyone ever tried to edit navigation toolbar with a pygtk-based
algorithm and could share his experience ?
Regards,
-- 
View this message in context: http://www.nabble.com/Navigation-toolbar-edit-for-pygtk-based-algorithm-tp25729532p25729532.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Michiel de H. <mjl...@ya...> - 2009年10月03日 12:57:37
Dear Buz,
You could try with the MacOSX native backend:
>>> import matplotlib
>>> matplotlib.use("MacOSX")
>>> from pylab import *
>>> text(0.2,0.2,"some text",fontname='Times-Roman')
>>> text(0.2,0.7,"some other text",fontname='Helvetica')
I'm not sure if the MacOSX native backend is included in fink's distribution, though.
--Michiel.
--- On Fri, 10/2/09, Buz Barstow <bu...@ma...> wrote:
> From: Buz Barstow <bu...@ma...>
> Subject: [Matplotlib-users] Getting Matplotlib to Recognize OSX Fonts
> To: "matplotlib-users" <mat...@li...>
> Date: Friday, October 2, 2009, 1:59 PM
> Dear All,
> 
> I'm trying to get matplotlib to use some of my MacOSX fonts
> (Helvetica 
> and Times) so that I can produce plots with these two
> fonts.
> 
> I'm using matplotlib installed with fink on MacOSX 10.5.8,
> and using 
> XQuartz 2.4.0.
> 
> Has anyone tried to do this, and can they point me to a
> procedure to 
> make matplotlib find these fonts?
> 
> Thanks! and all the best,
> 
> --Buz
> 
> 
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer
> Conference in SF, CA
> is the only developer event you need to attend this year.
> Jumpstart your
> developing skills, take BlackBerry mobile applications to
> market and stay 
> ahead of the curve. Join us from November 9-12, 2009.
> Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
 
From: Marco C. <ma...@gm...> - 2009年10月03日 10:07:05
Il giorno 30 set 09, alle ore 17.01, Jouni K. Seppänen ha scritto:
> If you do
>
> matplotlib.rcParams['text.latex.preamble'] = [r'\usepackage 
> {lucidabr}']
>
> does it start working?
	I eventually managed to get it work; thanks for your help !
	For the record:
'text.latex.preamble': [r'\usepackage[T1]{fontenc}', r'\usepackage 
{lucidabr}']
Ciao
~m
> From: Christopher Barrington-Leigh 
> [mailto:cpb...@gm...] 
> Sent: Sunday, September 27, 2009 21:58
> 
> Hello. My problem is as follows:
> (ipython --pylab)
> 
> from pylab import *
> pp=plot([0,0],[1,1])
> text(xlim()[0],1,' Need padding ',horizontalalignment='left')
> text(xlim()[1],1,' Need padding ',horizontalalignment='right')
> 
> 
> The second case does not do what I want, which is to pad the 
> text on the right. Text strings are stripped on the right, 
> but no on the left. How can I elegantly create a character of space?
Sorry to be chiming in somewhat late in the discussion, but below is a method
for padding that uses transforms instead of characters. It's based on a bit
of code in the cla() method of the Axes class. The helper functions
facilitate padding relative to data or axes coordinates, and the padding is
expressed in physical length units. (I picked inches just because the figure
dimensions are managed in inches.)
------------
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
def padded_data_transform(axes, xPadInches, yPadInches):
 return axes.transData + transforms.ScaledTranslation(xPadInches, 
 yPadInches, axes.figure.dpi_scale_trans)
def padded_axes_transform(axes, xPadInches, yPadInches):
 return axes.transAxes + transforms.ScaledTranslation(xPadInches, 
 yPadInches, axes.figure.dpi_scale_trans)
plt.plot([0], [1], '+')
ax = plt.gca()
plt.text(0, 1, '12 pt right of (0, 1)', 
 horizontalalignment='left', verticalalignment='center', 
 transform=padded_data_transform(ax, 12 / 72.0, 0))
plt.text(0, 1, '12 pt left of (0, 1)', 
 horizontalalignment='right', verticalalignment='center', 
 transform=padded_data_transform(ax, -12 / 72.0, 0))
plt.text(0, 0, '0.5 in right of lower left', 
 horizontalalignment='left', verticalalignment='bottom', 
 transform=padded_axes_transform(ax, 0.5, 0))
plt.text(1, 1, '0.5 in left of upper right', 
 horizontalalignment='right', verticalalignment='top', 
 transform=padded_axes_transform(ax, -0.5, 0))
------------
From: shamster <eri...@gm...> - 2009年10月02日 23:21:14
My current plot takes data to construct a 2d histogram. In gnuplot i would
accomplish this by using splot, dgrid3d, and pulling in a 'matrix' data
file. The code below has produced nearly what I need. However, the axes
limits are set based on the indices of the incoming data (i.e. the number of
rows or columns in my data matrix) instead of something meaningful. For
example, my x-axis is set from 0 to 2000, but I'd like it to span from -1 to
+1 because my x-data is a cosine function...
I would imagine that some type of axis-scaling function would take a
function to scale the labels... something akin to:
scale_axis(lambda x: x*.001-1.0, ax)
would do the trick of scaling my (0, 2000) data to the (-1.0, 1.0) extents.
Is there any such functionality to actually scale the values of the axis
tick-labels?
<code snippet>
 1 import sys
 2 from scipy import *
 3 import scipy.io.array_import
 4 
 5 # plotting libs
 6 import matplotlib.pyplot as plt
 7 from pylab import *
 8 
 9 
 10 
 11 file = scipy.io.array_import.read_array(sys.argv[1])
 12 data = []
 13 
 14 for i in range(len(file[0])):
 15 data.append(file[:,i])
 16 
 17 # create a figure
 18 fig = figure(1)
 19 
 20 cmBase = cm.jet # choose a colormap to use for the plot
 21 
 22 # This processes the data and adds the colored 2D histogram to the
figure
 23 im = imshow(data, interpolation='bilinear')
 24 # A little magic to create a colorbar - legend for the plot
 25 plt.colorbar(im)
 26 
 27 # Turn on the X-Y grid
 28 grid(True)
 29 
 30 # Pass go - collect 200ドル
 31 draw()
 32 show()
</code snippet>
-- 
View this message in context: http://www.nabble.com/Scaling-the-axis-values-from-list-indices-to-meaningful-values-tp25724127p25724127.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
10 messages has been excluded from this view by a project administrator.

Showing results of 419

<< < 1 .. 13 14 15 16 17 > >> (Page 15 of 17)
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 によって変換されたページ (->オリジナル) /