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


Showing 21 results of 21

From: Andre Walker-L. <wal...@gm...> - 2010年09月08日 18:57:40
It may not be an MPL issue, but rather Snow Leopard.
I have a friend who had font troubles, but it was because Mac OSX 10.6 (Snow
Leopard) changed the way fonts are handled. He had a file in his home
directory (which he created on 10.5) which had some font specifications,
which he had to alter/remove to fix his trouble.
I can't remember any more details, but thought I would share in case this
helps.
Andre
On Wed, Sep 8, 2010 at 8:56 AM, Jeremy Conlin <jlc...@gm...> wrote:
> I have trouble getting any symbols or any super/sub scripts to work
> since I upgraded to 1.0 a few months ago. I always get a message
> saying that some font isn't found. This occurs whenever I try to put
> symbols, superscripts, or subscripts in a label, or when I use a log
> scale (because then it MPL has to use superscripts). I have tried
> changing my matplotlibrc file but haven't found any combination of
> settings that help.
>
> To illustrate the problem, I have included three files, one python
> file and the other the error as captured from the output as well as my
> matplotlibrc file. The python file is trivial:
>
> # -------------------------------------------------
> import matplotlib.pyplot as pyplot
>
> pyplot.plot([1,2,3], label='$\alpha > \beta$')
>
> pyplot.legend()
> pyplot.show()
> # -------------------------------------------------
>
> Can someone please help me figure out what is wrong? I'm on a Mac
> running 10.6, python 2.6, matplotlib 1.0, and I have TeX installed.
>
> Thanks,
> Jeremy
>
>
> ------------------------------------------------------------------------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Tony S Yu <ts...@gm...> - 2010年09月08日 18:45:49
On Sep 8, 2010, at 2:10 PM, Jeremy Conlin wrote:
> On Wed, Sep 8, 2010 at 10:42 AM, Tony S Yu <ts...@gm...> wrote:
>> 
>> On Sep 8, 2010, at 11:56 AM, Jeremy Conlin wrote:
>> 
>>> I have trouble getting any symbols or any super/sub scripts to work
>>> since I upgraded to 1.0 a few months ago. I always get a message
>>> saying that some font isn't found. This occurs whenever I try to put
>>> symbols, superscripts, or subscripts in a label, or when I use a log
>>> scale (because then it MPL has to use superscripts). I have tried
>>> changing my matplotlibrc file but haven't found any combination of
>>> settings that help.
>>> 
>>> To illustrate the problem, I have included three files, one python
>>> file and the other the error as captured from the output as well as my
>>> matplotlibrc file. The python file is trivial:
>>> 
>>> # -------------------------------------------------
>>> import matplotlib.pyplot as pyplot
>>> 
>>> pyplot.plot([1,2,3], label='$\alpha > \beta$')
>>> 
>>> pyplot.legend()
>>> pyplot.show()
>>> # -------------------------------------------------
>>> 
>>> Can someone please help me figure out what is wrong? I'm on a Mac
>>> running 10.6, python 2.6, matplotlib 1.0, and I have TeX installed.
>>> 
>> Works on my system if you use a raw string (note ``r`` before string):
>> 
>>>>> pyplot.plot([1,2,3], label=r'$\alpha > \beta$')
>> 
>> Does that fix your problem?
> 
> Unfortunately, no. When I use a raw string, I just get "*a@" instead
> of the expected result. See attached figure for proof. I still get a
> long list of errors of fonts not being found.
> 
> Jeremy
> <mathfont.pdf>
Hmm, that strange. All the fonts it says aren't found are fonts that should be included in the Matplotlib install. I have pretty much the same setup as you (OSX 10.6, python 2.6), although I'm on Matplotlib trunk. Is it possible your install got screwed up some how. Have you tried a clean install of Matplotlib?
If that doesn't work, I'm afraid I won't be of much help, since I can't really reproduce this on my system. Maybe, someone who knows the font system better can help.
Best,
-Tony
From: Gökhan S. <gok...@gm...> - 2010年09月08日 18:26:08
It is clear with python -c "import matplotlib"
I can't seem to find any "dateutil" phrase occurring within the IPython
installation folder (/site-packages/IPython)
Where else to look for?
On Wed, Sep 8, 2010 at 12:35 PM, Aman Thakral <ama...@gm...>wrote:
> try this in the terminal:
> python -c "import matplotlib"
>
> -Aman
>
> On Wed, Sep 8, 2010 at 12:17 PM, Gökhan Sever <gok...@gm...>wrote:
>
>> Hello,
>>
>> My usual ipython -pylab is giving me these warnings after I installed
>> matplotlib from the source (matplotlib rev.8624 using python setupegg.py
>> develop).
>>
>> /usr/lib/python2.6/site-packages/EPDLab-3.0.1.dev_r24658-py2.6.egg/enthought/__init__.py:7:
>> UserWarning: Module dateutil was already imported from
>> /home/user/Desktop/python-repo/matplotlib/lib/dateutil/__init__.pyc, but
>> /usr/lib/python2.6/site-packages is being added to sys.path
>> __import__('pkg_resources').declare_namespace(__name__)
>>
>>
>> Under /site-packages in easy-install.pth I moved
>> the /home/user/Desktop/python-repo/matplotlib/lib line to the very bottom of
>> the file but this doesn't make any change.
>>
>> Any ideas how to remove this warning?
>>
>> --
>> Gökhan
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net Dev2Dev email is sponsored by:
>>
>> Show off your parallel programming skills.
>> Enter the Intel(R) Threading Challenge 2010.
>> http://p.sf.net/sfu/intel-thread-sfd
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
>
> --
> Aman Thakral
> B.Eng & Biosci, M.Eng Design
>
-- 
Gökhan
From: Andre' Walker-L. <awa...@lb...> - 2010年09月08日 18:20:24
It may not be an MPL issue, but rather Snow Leopard.
I have a friend who had font troubles, but it was because Mac OSX 10.6 
(Snow Leopard) changed the way fonts are handled. He had a file in 
his home directory (which he created on 10.5) which had some font 
specifications, which he had to alter/remove to fix his trouble.
I can't remember any more details, but thought I would share in case 
this helps.
Andre
On Sep 8, 2010, at 8:56 AM, Jeremy Conlin wrote:
> I have trouble getting any symbols or any super/sub scripts to work
> since I upgraded to 1.0 a few months ago. I always get a message
> saying that some font isn't found. This occurs whenever I try to put
> symbols, superscripts, or subscripts in a label, or when I use a log
> scale (because then it MPL has to use superscripts). I have tried
> changing my matplotlibrc file but haven't found any combination of
> settings that help.
>
> To illustrate the problem, I have included three files, one python
> file and the other the error as captured from the output as well as my
> matplotlibrc file. The python file is trivial:
>
> # -------------------------------------------------
> import matplotlib.pyplot as pyplot
>
> pyplot.plot([1,2,3], label='$\alpha > \beta$')
>
> pyplot.legend()
> pyplot.show()
> # -------------------------------------------------
>
> Can someone please help me figure out what is wrong? I'm on a Mac
> running 10.6, python 2.6, matplotlib 1.0, and I have TeX installed.
>
> Thanks,
> Jeremy
> < 
> mathfonterror 
> .txt 
> > 
> < 
> mathfont 
> .py 
> > 
> < 
> matplotlibrc 
> > 
> ------------------------------------------------------------------------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jeremy C. <jlc...@gm...> - 2010年09月08日 18:10:47
Attachments: mathfont.pdf
On Wed, Sep 8, 2010 at 10:42 AM, Tony S Yu <ts...@gm...> wrote:
>
> On Sep 8, 2010, at 11:56 AM, Jeremy Conlin wrote:
>
>> I have trouble getting any symbols or any super/sub scripts to work
>> since I upgraded to 1.0 a few months ago. I always get a message
>> saying that some font isn't found. This occurs whenever I try to put
>> symbols, superscripts, or subscripts in a label, or when I use a log
>> scale (because then it MPL has to use superscripts). I have tried
>> changing my matplotlibrc file but haven't found any combination of
>> settings that help.
>>
>> To illustrate the problem, I have included three files, one python
>> file and the other the error as captured from the output as well as my
>> matplotlibrc file. The python file is trivial:
>>
>> # -------------------------------------------------
>> import matplotlib.pyplot as pyplot
>>
>> pyplot.plot([1,2,3], label='$\alpha > \beta$')
>>
>> pyplot.legend()
>> pyplot.show()
>> # -------------------------------------------------
>>
>> Can someone please help me figure out what is wrong? I'm on a Mac
>> running 10.6, python 2.6, matplotlib 1.0, and I have TeX installed.
>>
> Works on my system if you use a raw string (note ``r`` before string):
>
>>>> pyplot.plot([1,2,3], label=r'$\alpha > \beta$')
>
> Does that fix your problem?
Unfortunately, no. When I use a raw string, I just get "*a@" instead
of the expected result. See attached figure for proof. I still get a
long list of errors of fonts not being found.
Jeremy
From: Aman T. <ama...@gm...> - 2010年09月08日 17:36:17
try this in the terminal:
python -c "import matplotlib"
-Aman
On Wed, Sep 8, 2010 at 12:17 PM, Gökhan Sever <gok...@gm...> wrote:
> Hello,
>
> My usual ipython -pylab is giving me these warnings after I installed
> matplotlib from the source (matplotlib rev.8624 using python setupegg.py
> develop).
>
> /usr/lib/python2.6/site-packages/EPDLab-3.0.1.dev_r24658-py2.6.egg/enthought/__init__.py:7:
> UserWarning: Module dateutil was already imported from
> /home/user/Desktop/python-repo/matplotlib/lib/dateutil/__init__.pyc, but
> /usr/lib/python2.6/site-packages is being added to sys.path
> __import__('pkg_resources').declare_namespace(__name__)
>
>
> Under /site-packages in easy-install.pth I moved
> the /home/user/Desktop/python-repo/matplotlib/lib line to the very bottom of
> the file but this doesn't make any change.
>
> Any ideas how to remove this warning?
>
> --
> Gökhan
>
>
> ------------------------------------------------------------------------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
-- 
Aman Thakral
B.Eng & Biosci, M.Eng Design
From: Michael D. <md...@st...> - 2010年09月08日 16:43:38
On 09/02/2010 10:23 AM, Benjamin Root wrote:
> On Thu, Sep 2, 2010 at 9:11 AM, Ryan May <rm...@gm... 
> <mailto:rm...@gm...>> wrote:
>
> On Thu, Sep 2, 2010 at 2:15 AM, Mitesh Patel <qe...@gm...
> <mailto:qe...@gm...>> wrote:
> > Hello,
> >
> > Is it possible to specify both an alpha level and a background
> color so
> > that an entire saved image has a uniform transparency and color?
> For
> > example, with matplotlib 1.0.0, this script yields the attached
> image:
> >
> > from matplotlib.pyplot import figure, savefig, show
> >
> > fig = figure()
> > ax = fig.add_subplot(111)
> > ax.plot([1,2,3])
> >
> > fig.patch.set_alpha(0.5)
> > for ax in fig.axes:
> > ax.patch.set_alpha(0.5)
> >
> > fig.patch.set_facecolor('red')
> > for ax in fig.axes:
> > ax.patch.set_facecolor('red')
> >
> > savefig('test.png', facecolor='red')
> >
> >
> > In particular, the areas inside and outside the axes have different
> > transparency level and color. Perhaps I'm over/mis/ab-using the
> options
> > here?
>
> It's not that they're not uniform--you're seeing alpha blending
> between the figure patch and the axes patch. Within the axes, both are
> being rendered and blended together. This is more readily apparent if
> you use blue for the axes patch, as I did for the attached image. When
> the red and blue are blended together, you end up with purple. If you
> want it all uniform, you'd be better off setting the axes patch to an
> alpha of 0.0.
>
> Ryan
>
>
> This also raises another pet peeve of mine. The Agg backend seems to 
> use linear blending for alpha. This is inconsistent with how the 
> world works. It is more realistic for logarithmic blending, or at 
> least, a piece-wise linear blending.
>
> Imagine I have two overlapping objects with alpha set to .5 (a_1 and 
> a_2). What is rendered in matplotlib is completely opaque. A more 
> realistic result would have a final alpha setting of .75 (i.e. - the 
> first item takes away half the transparency, then the second item 
> takes away half of the remaining transparency.
>
> I am not nearly familiar enough with the Agg backend to know how to 
> implement this. Is this at all feasible?
The problem is that then the other backends (PDF, SVG etc) would have 
different alpha blending behavior. If that can be resolved, then I 
think getting Agg to handle logarithmic blending is the easy part.
Mike
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: Tony S Yu <ts...@gm...> - 2010年09月08日 16:43:15
On Sep 8, 2010, at 11:56 AM, Jeremy Conlin wrote:
> I have trouble getting any symbols or any super/sub scripts to work
> since I upgraded to 1.0 a few months ago. I always get a message
> saying that some font isn't found. This occurs whenever I try to put
> symbols, superscripts, or subscripts in a label, or when I use a log
> scale (because then it MPL has to use superscripts). I have tried
> changing my matplotlibrc file but haven't found any combination of
> settings that help.
> 
> To illustrate the problem, I have included three files, one python
> file and the other the error as captured from the output as well as my
> matplotlibrc file. The python file is trivial:
> 
> # -------------------------------------------------
> import matplotlib.pyplot as pyplot
> 
> pyplot.plot([1,2,3], label='$\alpha > \beta$')
> 
> pyplot.legend()
> pyplot.show()
> # -------------------------------------------------
> 
> Can someone please help me figure out what is wrong? I'm on a Mac
> running 10.6, python 2.6, matplotlib 1.0, and I have TeX installed.
> 
Works on my system if you use a raw string (note ``r`` before string):
>>> pyplot.plot([1,2,3], label=r'$\alpha > \beta$')
Does that fix your problem?
-Tony
From: Gökhan S. <gok...@gm...> - 2010年09月08日 16:17:12
Hello,
My usual ipython -pylab is giving me these warnings after I installed
matplotlib from the source (matplotlib rev.8624 using python setupegg.py
develop).
/usr/lib/python2.6/site-packages/EPDLab-3.0.1.dev_r24658-py2.6.egg/enthought/__init__.py:7:
UserWarning: Module dateutil was already imported from
/home/user/Desktop/python-repo/matplotlib/lib/dateutil/__init__.pyc, but
/usr/lib/python2.6/site-packages is being added to sys.path
 __import__('pkg_resources').declare_namespace(__name__)
Under /site-packages in easy-install.pth I moved
the /home/user/Desktop/python-repo/matplotlib/lib line to the very bottom of
the file but this doesn't make any change.
Any ideas how to remove this warning?
-- 
Gökhan
From: Jeremy C. <jlc...@gm...> - 2010年09月08日 15:56:43
I have trouble getting any symbols or any super/sub scripts to work
since I upgraded to 1.0 a few months ago. I always get a message
saying that some font isn't found. This occurs whenever I try to put
symbols, superscripts, or subscripts in a label, or when I use a log
scale (because then it MPL has to use superscripts). I have tried
changing my matplotlibrc file but haven't found any combination of
settings that help.
To illustrate the problem, I have included three files, one python
file and the other the error as captured from the output as well as my
matplotlibrc file. The python file is trivial:
# -------------------------------------------------
import matplotlib.pyplot as pyplot
pyplot.plot([1,2,3], label='$\alpha > \beta$')
pyplot.legend()
pyplot.show()
# -------------------------------------------------
Can someone please help me figure out what is wrong? I'm on a Mac
running 10.6, python 2.6, matplotlib 1.0, and I have TeX installed.
Thanks,
Jeremy
From: Michael D. <md...@st...> - 2010年09月08日 15:53:14
I believe this is now fixed in r8691 (branch and trunk).
Mike
On 09/03/2010 02:51 PM, Eric Firing wrote:
> On 08/31/2010 01:08 AM, Jens Nie wrote:
> 
>> Hi everyone.
>> I face a problem here, which I can’t seem to handle by myself, so any
>> help is really appreciated.
>> I would like to do a simple line plot of a huge dataset as an overview
>> to quickly compare success of different measurement scenarios, and it
>> seems that not every datapoint is displayed. I played a little with the
>> lod parameter, both for the creation of the axis and the plot command.
>> However timing the plot command and the display itself do not show
>> differences. Here are a few lines of code that help to reproduce the
>> problem.
>> 
> Jens,
>
> I'm confident this is the same bug as was reported more recently on the
> list and the tracker:
>
> https://sourceforge.net/tracker/index.php?func=detail&aid=3058804&group_id=80706&atid=560720
>
> That report will make it easier to debug because it illustrates the
> problem with a relatively few points.
>
>
> Eric
>
> 
>> import time
>> import matplotlib
>> matplotlib.use("Qt4Agg")
>> import matplotlib.pyplot as plt
>> import numpy as np
>> xData=np.linspace(0, 10.0, 1e6)
>> yData=np.zeros(xData.shape)
>> xDataDetail=np.linspace(0.0, 2*np.pi, 1000)
>> yDataDetail=np.exp(-xDataDetail)*np.sin(10.0*xDataDetail)
>> yData[100000:100000+len(yDataDetail)]=yDataDetail
>> fig=plt.figure()
>> axes=fig.add_subplot(111)
>> tic=time.time()
>> axes.plot(xData, yData, "b-")
>> toc=time.time()
>> axes.grid(True)
>> print "Plotting took %g s." % (toc-tic)
>> plt.show()
>> The code shows how I usually use the matplotlib environment and creates
>> a simple dataset of 1 million zeros with a short non trivial peak
>> within, that is to be plotted as a blue solid line.
>> You can see what happens, when you vary the width of the displaying
>> window. On my system usually the minimum amplitude varies when resizing
>> the window.
>> Is there any way to enforce plotting each and every point?
>> I use matplotlib version 1.0.0 on a 32 Bit windows XP system installed
>> via the windows installer from sf.
>> A quick check on a opensuse 11.3 linux box showed the same issue. Using
>> the "standard" TK backend instead of Qt4Agg behaves just the same.
>> Jens
>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net Dev2Dev email is sponsored by:
>>
>> Show off your parallel programming skills.
>> Enter the Intel(R) Threading Challenge 2010.
>> http://p.sf.net/sfu/intel-thread-sfd
>>
>>
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
>
>
> ------------------------------------------------------------------------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: Aman T. <ama...@gm...> - 2010年09月08日 15:29:50
Sorry,
This was just a silly mistake. I forgot declare the selectors as class
variables (by adding self in front of them).
-Aman
On Tue, Sep 7, 2010 at 1:37 PM, Aman Thakral <ama...@gm...> wrote:
> Hi,
>
> I seem to be encountering a strange problem. I'm using a SpanSelector and
> a RectangularSelector in my application and they seem to be working in Linux
> but not in Windows. I'm using wxpython as the gui layer. Has anyone else
> encountered similar issues?
>
> Thanks,
> Aman
>
-- 
Aman Thakral
B.Eng & Biosci, M.Eng Design
From: Brian L. <bal...@la...> - 2010年09月08日 14:36:15
Perfect thank you, no wonder I didnt find it, plt.gca().add_collection(lc) never found its way to my radar.
Cheers, 
Brian
On Sep 7, 2010, at 7:58 PM, Ryan May wrote:
> On Tue, Sep 7, 2010 at 6:50 PM, Brian Larsen <bal...@la...> wrote:
>> Hey all,
>> I think I know the answer here as "no" or something, but say I have a curve
>> I want to plot and I want the color to change along the curve to denote the
>> 3rd variable is there anyway to do this is matplotlib?
>> What I mean is take the simple plot
>> from pylab import *
>> plot(range(30), range(30, 60), lw=10)
>> and say that the 3rd variable is
>> inten = [val ** 2 for val in range(30)]
>> then can the line change color along its length according to a specified
>> color table?
>> In IDL this is done by just giving a color array with the same length as the
>> data then the line changes with the current colortable.
> 
> Try this:
> 
> http://matplotlib.sourceforge.net/examples/pylab_examples/multicolored_line.html
> 
> Ryan
> 
> -- 
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
-- 
Brian A. Larsen
Space Science and Applications
Group ISR-1
Los Alamos National Laboratory
PO Box 1663, MS-D466
Los Alamos, NM 87545
USA
(For overnight add:
SM-30, Bikini Atoll Road)
Phone: 505-665-7691
Fax: 505-665-7395
email: bal...@la...
Correspondence /
Technical data or Software Publicly Available
From: Jonathan S. <js...@cf...> - 2010年09月08日 14:18:47
This is of interest to me, and it's nice to know that this is do-able
with matplotlib, but like many of the examples, I find it sorely lacking
in documentation. For example, why are the points and segments arrays
shaped so specifically the way they are? Why the call to set_array?
Could the same thing be accomplished with a call to set_facecolor? I
hope the same things can be accomplished in a more straightforward way.
Any illumination on these points would be appreciated.
Jon
> On Tue, Sep 7, 2010 at 6:50 PM, Brian Larsen
> <bal...@la...> wrote:
> > Hey all,
> > I think I know the answer here as "no" or something, but
> say I have a curve
> > I want to plot and I want the color to change along the
> curve to denote the
> > 3rd variable is there anyway to do this is matplotlib?
> > What I mean is take the simple plot
> > from pylab import *
> > plot(range(30), range(30, 60), lw=10)
> > and say that the 3rd variable is
> > inten = [val ** 2 for val in range(30)]
> > then can the line change color along its length according to
> a specified
> > color table?
> > In IDL this is done by just giving a color array with the
> same length as the
> > data then the line changes with the current colortable.
> 
> Try this:
> 
> http://matplotlib.sourceforge.net/examples/pylab_examples/multicolored_line.html
> 
> Ryan
> 
> -- 
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
From: Ryan M. <rm...@gm...> - 2010年09月08日 13:35:39
2010年9月8日 Guillaume Chérel <gui...@gm...>:
> It works great with patches of circles. Thank you.
>
> Also, I want my circles to look round, so I use the command axis('equal').
> Is there any way to make sure that the area I defined with xlim() and ylim()
> won't be cut off. I'd rather have one dimension expanded than the other one
> shrunk. Can I control that?
You can make it so that axes box itself is changed instead of your data limits:
import matplotlib.pyplot as plt
ax = plt.gca()
ax.set_aspect('equal','box')
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Jae-Joon L. <lee...@gm...> - 2010年09月08日 10:07:29
Images can placed at arbitrary position (using the extent keyword).
I think this is enough as far as you're careful with the aspect.
Looking at the wikipedia example, I don't see any reason that this
cannot be done with matplotlib.
Regards,
-JJ
On Wed, Sep 8, 2010 at 6:34 AM, Joshua Holbrook <jos...@gm...> wrote:
> Hey y'all,
>
> I recently read about Chernoff faces
> (http://en.wikipedia.org/wiki/Chernoff_face) in one of Edward Tufte's
> books (great read btw) and would like to mess around with them in
> matplotlib. My current approach is to generate the faces as images,
> and then use them as markers on an x-y plot (like the example I
> found in the Tufte book). I just realized, though, that I have no idea how to
> incorporate images as position markers in matplotlib, or if it's even
> possible. My search of the mpl docs didn't turn up much.
>
> Any ideas?
>
>
> --Joshua Holbrook
>
> ------------------------------------------------------------------------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Guillaume C. <gui...@gm...> - 2010年09月08日 09:10:33
 It works great with patches of circles. Thank you.
Also, I want my circles to look round, so I use the command 
axis('equal'). Is there any way to make sure that the area I defined 
with xlim() and ylim() won't be cut off. I'd rather have one dimension 
expanded than the other one shrunk. Can I control that?
thanks,
guillaume
Le 07/09/2010 18:05, Benjamin Root a écrit :
> 2010年9月7日 Guillaume Chérel <gui...@gm... 
> <mailto:gui...@gm...>>
>
> Hello,
>
> I'm trying to draw circles with the scatter function. They are
> supposed
> to represent trees in the savannah. It is thus important that they are
> displayed with a proper size, that is, one which represents their
> actual
> size on the field. After quite some confusion, I've found out (I
> think)
> that the size argument one can specify with the scatter function is
> given as a disk's surface in pixels square (I think that's what means
> the "points^2" in the documentation and from my own tests)
>
> What I would like is to give a surface in unit^2, where "unit" is the
> unit of my data, and which you can read on the plot's axes ticks. For
> example, each tree has coordinates like x=3500, y=2210. (The unit here
> is centimeters but we don't really need to know this). Say I want to
> draw a tree which canopy is 200 cm wide. That makes a disk which
> radius
> is 100, or surface 100^2*PI. How can I draw this?
>
> Many thanks,
> Guillaume
>
>
>
> Guillaume,
>
> Using scatter is probably not the way to go about what you want. The 
> circles for scatter are a fixed size and if you zoom in, they will not 
> scale accordingly.
>
> You probably want to create patches of Circles:
>
> http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.patches.Circle
> http://www.mail-archive.com/mat...@li.../msg06786.html
>
> Or even utilize a collection of Circles:
>
> http://matplotlib.sourceforge.net/api/collections_api.html#matplotlib.collections.CircleCollection
>
> Note that for a CircleCollection, you would use 'offset' to indicate 
> the center of each circle. After creating the collection, you would 
> then use ax.add_collection() function to add that collection to the axes.
>
> I hope that is helpful.
> Ben Root
From: Guillaume C. <gui...@gm...> - 2010年09月08日 09:08:09
 It works great with patches of circles. Thank you.
Also, I want my circles to look round, so I use the command 
axis('equal'). Is there any way to make sure that the area I defined 
with xlim() and ylim() won't be cut off. I'd rather have one dimension 
expanded than the other one shrunk. Can I control that?
thanks,
guillaume
Le 07/09/2010 18:05, Benjamin Root a écrit :
> 2010年9月7日 Guillaume Chérel <gui...@gm... 
> <mailto:gui...@gm...>>
>
> Hello,
>
> I'm trying to draw circles with the scatter function. They are
> supposed
> to represent trees in the savannah. It is thus important that they are
> displayed with a proper size, that is, one which represents their
> actual
> size on the field. After quite some confusion, I've found out (I
> think)
> that the size argument one can specify with the scatter function is
> given as a disk's surface in pixels square (I think that's what means
> the "points^2" in the documentation and from my own tests)
>
> What I would like is to give a surface in unit^2, where "unit" is the
> unit of my data, and which you can read on the plot's axes ticks. For
> example, each tree has coordinates like x=3500, y=2210. (The unit here
> is centimeters but we don't really need to know this). Say I want to
> draw a tree which canopy is 200 cm wide. That makes a disk which
> radius
> is 100, or surface 100^2*PI. How can I draw this?
>
> Many thanks,
> Guillaume
>
>
>
> Guillaume,
>
> Using scatter is probably not the way to go about what you want. The 
> circles for scatter are a fixed size and if you zoom in, they will not 
> scale accordingly.
>
> You probably want to create patches of Circles:
>
> http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.patches.Circle
> http://www.mail-archive.com/mat...@li.../msg06786.html
>
> Or even utilize a collection of Circles:
>
> http://matplotlib.sourceforge.net/api/collections_api.html#matplotlib.collections.CircleCollection
>
> Note that for a CircleCollection, you would use 'offset' to indicate 
> the center of each circle. After creating the collection, you would 
> then use ax.add_collection() function to add that collection to the axes.
>
> I hope that is helpful.
> Ben Root
From: Eric F. <ef...@ha...> - 2010年09月08日 07:01:40
On 09/07/2010 07:33 PM, Philippe Crave wrote:
> hi,
>
> sorry to bring this up again.
> style haven't found how to draw my plot faster than
> self.fig.canvas.draw(), after a set_data()
If you need to change the scale of the plot when you update the data, 
then I don't see any alternative to redoing the whole plot. If that is 
too slow, then mpl may simply be the wrong tool for the job. Parts of 
mpl have been nicely optimized for speed, but generating a large number 
of subplots is not among them. I don't expect this will change any time 
soon. The tick generation and labeling is the main time sink. If I 
generate 20 blank subplots, with default ticks and labels, each draw 
takes 420 ms on my machine. If I set all the ticks to the empty list, 
it drops to 34 ms.
Eric
>
> thanks
>
> 2010年9月1日 Philippe Crave<phi...@gm...>:
>> Hi,
>>
>> I use qt4 backend.
>> I update some lines doing something like that:
>>
>> def draw_curves(self, datas, x):
>> for y in datas:
>> self.lines[i].set_data(x, y)
>> min_y, max_y = self.min_max(y)
>> self.ax[i].axis((0, x[-1], min_y, max_y))
>> #self.ax[i].draw_artist(self.lines[i])
>> #self.fig.canvas.blit(self.ax[i].bbox)
>> self.fig.canvas.draw()
>>
>>
>> the self.fig.canvas.draw() is very slow. (I have 20 subplot in that figure).
>> I tried to use:
>> self.ax[i].draw_artist(self.lines[i])
>> self.fig.canvas.blit(self.ax[i].bbox)
>> it's very fast. But it does not update the scale of the plot.
>> and it does not remove the old datas.
>>
>> Can someone help me on that ?
>> if I plot a sin(x) at first, I get it between 0 and 1. then, if I plot
>> 2.sin(x), it does not update the zoom to 0-2
>>
>> thank you,
>> Philippe
>>
>
> ------------------------------------------------------------------------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Philippe C. <phi...@gm...> - 2010年09月08日 05:33:22
hi,
sorry to bring this up again.
style haven't found how to draw my plot faster than
self.fig.canvas.draw(), after a set_data()
thanks
2010年9月1日 Philippe Crave <phi...@gm...>:
> Hi,
>
> I use qt4 backend.
> I update some lines doing something like that:
>
>  def draw_curves(self, datas, x):
>    for y in datas:
>      self.lines[i].set_data(x, y)
>      min_y, max_y = self.min_max(y)
>      self.ax[i].axis((0, x[-1], min_y, max_y))
>      #self.ax[i].draw_artist(self.lines[i])
>      #self.fig.canvas.blit(self.ax[i].bbox)
>    self.fig.canvas.draw()
>
>
> the self.fig.canvas.draw() is very slow. (I have 20 subplot in that figure).
> I tried to use:
>      self.ax[i].draw_artist(self.lines[i])
>      self.fig.canvas.blit(self.ax[i].bbox)
> it's very fast. But it does not update the scale of the plot.
> and it does not remove the old datas.
>
> Can someone help me on that ?
> if I plot a sin(x) at first, I get it between 0 and 1. then, if I plot
> 2.sin(x), it does not update the zoom to 0-2
>
> thank you,
> Philippe
>
From: Ryan M. <rm...@gm...> - 2010年09月08日 01:59:12
On Tue, Sep 7, 2010 at 6:50 PM, Brian Larsen <bal...@la...> wrote:
> Hey all,
> I think I know the answer here as "no" or something, but say I have a curve
> I want to plot and I want the color to change along the curve to denote the
> 3rd variable is there anyway to do this is matplotlib?
> What I mean is take the simple plot
> from pylab import *
> plot(range(30), range(30, 60), lw=10)
> and say that the 3rd variable is
> inten = [val ** 2 for val in range(30)]
> then can the line change color along its length according to a specified
> color table?
> In IDL this is done by just giving a color array with the same length as the
> data then the line changes with the current colortable.
Try this:
http://matplotlib.sourceforge.net/examples/pylab_examples/multicolored_line.html
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

Showing 21 results of 21

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 によって変換されたページ (->オリジナル) /