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


Showing 14 results of 14

From: Michael S. <mic...@gm...> - 2006年08月31日 23:13:06
I don't think that Matplotlib has such a plot, but I would also be
interested in using such a plot - for presenting hierarchical
clustering results.
Michael
On 8/31/06, R. Padraic Springuel <R.S...@um...> wrote:
> Can Matplotlib create dendrograms? As best I can tell, there isn't a
> plotting function for doing so directly, but maybe one could make one by
> combining a series of commands. Has anyone done this? Does anyone know
> if it is possible, or if there is another package that would do the job
> if it isn't?
> --
>
> R. Padraic Springuel
> Teaching Assistant
> Department of Physics and Astronomy
> University of Maine
> Bennett 309
> Office Hours: By Appointment only during the Summer
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Michael F. <mp...@be...> - 2006年08月31日 22:17:53
On Aug 31, 2006, at 2:56 PM, John Hunter wrote:
>>>>>> "Michael" == Michael Fitzgerald <mp...@be...> writes:
>
> Michael> Is there a way to force some sort of pseudo-draw event,
> Michael> such that the sizing is done and the ticks are created
> Michael> from the protoTick, but the draw isn't actually performed
> Michael> by the backend? That way one could set the visibility
> Michael> property rather than wrap the Formatter.
>
> Try fig.canvas.draw() and see if that helps.
>
> If not, we'll come up with something else...
I placed that command before the ax.get_xticklabels(), and no dice.
Thanks for looking into this,
Mike
From: Eric F. <ef...@ha...> - 2006年08月31日 22:14:01
Jim,
The problem is that the new quiver--the one for which Jeff quoted a 
docstring extract--appeared after 0.87.3. I hope you can update to 
0.87.4 or to svn. I gather there will be another release within a week 
or two, also, to support the latest numpy.
Eric
James Boyle wrote:
> when I call quiver in the Basemap toolkit, the scale keyword has the 
> effect of eliminating all vectors, no matter what value I assign 
> (except None).
> I am using matplotlib 0.87.3 - Basemap 0.9
> In any case the exact effect of the scale parameter is obscure - how 
> does is scale? units/inch, units/gridbox ???
> 
> Thanks for any help.
> --Jim
> 
> 
> the calls I use are below:
> mercMap = 
> Basemap(llcrnrlon=120.,llcrnrlat=-20,urcrnrlon=200.,urcrnrlat=20.,\
> resolution='c',area_thresh=10000.,projection='merc',\
> lon_0=160.,lat_ts=0.)
> istride = 3
> mercMap.quiver(x[::istride,::istride],y[::istride,::istride],uERA[:: 
> istride,::istride],vERA[::istride,::istride],scale=None)
> 
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John H. <jdh...@ac...> - 2006年08月31日 22:09:18
>>>>> "Michael" == Michael Fitzgerald <mp...@be...> writes:
 Michael> Is there a way to force some sort of pseudo-draw event,
 Michael> such that the sizing is done and the ticks are created
 Michael> from the protoTick, but the draw isn't actually performed
 Michael> by the backend? That way one could set the visibility
 Michael> property rather than wrap the Formatter.
Try fig.canvas.draw() and see if that helps.
If not, we'll come up with something else...
JDH
From: Jeff W. <js...@fa...> - 2006年08月31日 21:41:38
James Boyle wrote:
> when I call quiver in the Basemap toolkit, the scale keyword has the 
> effect of eliminating all vectors, no matter what value I assign 
> (except None).
> I am using matplotlib 0.87.3 - Basemap 0.9
> In any case the exact effect of the scale parameter is obscure - how 
> does is scale? units/inch, units/gridbox ???
>
> Thanks for any help.
> --Jim
>
>
> the calls I use are below:
> mercMap = 
> Basemap(llcrnrlon=120.,llcrnrlat=-20,urcrnrlon=200.,urcrnrlat=20.,\
> resolution='c',area_thresh=10000.,projection='merc',\
> lon_0=160.,lat_ts=0.)
> istride = 3
> mercMap.quiver(x[::istride,::istride],y[::istride,::istride],uERA[:: 
> istride,::istride],vERA[::istride,::istride],scale=None)
>
>
> 
Jim: Basemap passes the scale keyword directly to matplotlib quiver. 
 From the docstrings in quiver.py:
 * scale = None | float
 data units per arrow unit, e.g. m/s per plot width;
 a smaller scale parameter makes the arrow longer.
 If None, a simple autoscaling algorithm is used, based
 on the average vector length and the number of vectors.
I just tried changing the projection to 'merc' in the quiver_demo.py 
example, and it looked OK with the default (scale=None).
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Michael F. <mp...@be...> - 2006年08月31日 21:03:09
On Aug 31, 2006, at 4:36 AM, John Hunter wrote:
> So: how do you solve your problem, of making the first tick invisible?
> What I do when I need to solve this problem, which comes up a lot with
> multiple axes where ticks can overlap, is the following
>
> from matplotlib.ticker import ScalarFormatter
>
> class MyFormatter(ScalarFormatter):
> def __call__(self, x, pos=None):
> if pos==0: return ''
> else: return ScalarFormatter(self, x, pos)
>
> ax.xaxis.set_major_formatter(MyFormatter())
>
> I often want to do this for the last tick as well, but there is
> currently no convenient way to do this, as the tick locator produces
> the tick location list and the tick formatter doesn't know how many of
> them there are. I've been considering modifying the tick locator code
> to pass -1 for the pos for the last tick to solve just this use case.
> If others need this or think it desirable, just give me a nudge and
> I'll do it.
Hi John,
Hmm.... I have 3 use cases where I want to isolate individual tick 
labels and make them invisible:
1) the first tick (0; for stacked plots)
2) the last tick (-1; for stacked plots)
3) every other tick for the last few ticks (e.g. -2, -4, -6; for a 
log-scale axis with large tick labels, which can overlap on one end)
Is there a way to force some sort of pseudo-draw event, such that the 
sizing is done and the ticks are created from the protoTick, but the 
draw isn't actually performed by the backend? That way one could set 
the visibility property rather than wrap the Formatter.
Thanks,
Mike
From: James B. <bo...@ll...> - 2006年08月31日 19:59:32
when I call quiver in the Basemap toolkit, the scale keyword has the 
effect of eliminating all vectors, no matter what value I assign 
(except None).
I am using matplotlib 0.87.3 - Basemap 0.9
In any case the exact effect of the scale parameter is obscure - how 
does is scale? units/inch, units/gridbox ???
Thanks for any help.
--Jim
the calls I use are below:
mercMap = 
Basemap(llcrnrlon=120.,llcrnrlat=-20,urcrnrlon=200.,urcrnrlat=20.,\
 resolution='c',area_thresh=10000.,projection='merc',\
 lon_0=160.,lat_ts=0.)
istride = 3
mercMap.quiver(x[::istride,::istride],y[::istride,::istride],uERA[:: 
istride,::istride],vERA[::istride,::istride],scale=None)
From: Scott R. <sr...@nr...> - 2006年08月31日 19:09:57
Hi Eric,
This shows what I'm talking about:
--------------------
from pylab import *
delta = 0.025
x = arange(-3.0, 3.0, delta)
y = arange(-2.0, 2.0, delta)
X, Y = meshgrid(x, y)
Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
# difference of Gaussians
Z = 10.0 * (Z2 - Z1)
contourf(X, Y, sin(Y)*cos(X),
 alpha=0.2)
hot()
contour(X, Y, Z, 6,
 linewidths=4,
 colors=('r', 'green', 'blue', (1,1,0), '#afeeee', '0.5'),
 alpha=0.4)
show()
-------------------
On Thursday 31 August 2006 13:50, Eric Firing wrote:
> Scott,
>
> Please send a minimal example that I can use as a test case. This
> sounds vaguely familiar.
>
> Thanks.
>
> Eric
>
> Scott Ransom wrote:
> > Hi All,
> >
> > I'm using matplotlib (with agg backends) from recent svn:
> >
> > In [63]: matplotlib.__version__
> > Out[63]: '0.87.4'
> >
> > and I can't seem to get contour() or contourf() to utilize the
> > alpha keyword. No matter what value I set, alpha=1.0 on the
> > output. Alpha in general works fine, as the scatter_demo2.py
> > example gives very nicely alpha-channeled output.
> >
> > Any ideas? Thanks a bunch,
> >
> > Scott
-- 
Scott M. Ransom Address: NRAO
Phone: (434) 296-0320 520 Edgemont Rd.
email: sr...@nr... Charlottesville, VA 22903 USA
GPG Fingerprint: 06A9 9553 78BE 16DB 407B FFCA 9BFA B6FF FFD3 2989
From: Eric F. <ef...@ha...> - 2006年08月31日 18:14:40
Samuel,
Trying to manipulate variables with leading underscores is 
discouraged--that is the meaning of the leading underscores.
Changing the shared status of axes involves changes in additional 
variables. This could be encapsulated in a single method. It might be 
very easy, or complexities and gotchas might turn up. How important is 
it? What is the problem with setting the shared status when you make 
the axes, as in your first example?
Eric
Samuel GARCIA wrote:
> Hi all,
> is there a possibility to change the sharex and sharey after creating a 
> axes ?
> 
> For example this perfectitly work :
> 
> import pylab
> fig = pylab.figure()
> ax1 = fig.add_subplot(121)
> ax2 = fig.add_subplot(122, sharex=ax1)
> ax1.plot(rand(5))
> ax2.plot(rand(5))
> pylab.show()
> 
> But when I try naively to change _sharex and _masterx after creating 
> the axes it doesn't work :
> 
> 
> import pylab
> fig = pylab.figure()
> ax1 = fig.add_subplot(121)
> ax2 = fig.add_subplot(122)
> ax1.plot(rand(5))
> ax2.plot(rand(5))
> ax2._sharex = ax1
> ax1._masterx = True
> pylab.show()
> 
> What 's the solution ?
> thank you
> 
> Samuel
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Eric F. <ef...@ha...> - 2006年08月31日 17:51:01
Scott,
Please send a minimal example that I can use as a test case. This 
sounds vaguely familiar.
Thanks.
Eric
Scott Ransom wrote:
> Hi All,
> 
> I'm using matplotlib (with agg backends) from recent svn:
> 
> In [63]: matplotlib.__version__
> Out[63]: '0.87.4'
> 
> and I can't seem to get contour() or contourf() to utilize the
> alpha keyword. No matter what value I set, alpha=1.0 on the
> output. Alpha in general works fine, as the scatter_demo2.py
> example gives very nicely alpha-channeled output.
> 
> Any ideas? Thanks a bunch,
> 
> Scott
> 
From: Gary R. <gr...@bi...> - 2006年08月31日 12:16:07
Perhaps NetworkX <https://networkx.lanl.gov/> will do what you want, 
depending on how much control you need over the node placement. There 
are a few more suggestions for general graph plotting solutions here:
<https://networkx.lanl.gov/wiki/Drawing>.
hth
Gary R.
R. Padraic Springuel wrote:
> Can Matplotlib create dendrograms? As best I can tell, there isn't a 
> plotting function for doing so directly, but maybe one could make one by 
> combining a series of commands. Has anyone done this? Does anyone know 
> if it is possible, or if there is another package that would do the job 
> if it isn't?
From: John H. <jdh...@ac...> - 2006年08月31日 11:49:24
>>>>> "Michael" == Michael Fitzgerald <mp...@be...> writes:
 Michael> Hi all,
 Michael> I'm still having trouble figuring out what's going on
 Michael> with tick labels. I can't figure out why
 Michael> Axes.get_{x,y}ticklabels() is returning a list of length
 Michael> unity when I expect to have the list of all labels.
 Michael> If I run the code below (test.py), I expect a list of 9 x
 Michael> tick labels. If I run the code once ('run test' in
 Michael> ipython), then it gives me a list of 1 tick label. If I
 Michael> close the interactive window it generates and run it
 Michael> again, it again returns 1 tick label. However, if I
 Michael> leave the window open and re-run the test, it gives the
 Michael> right answer.
 Michael> Can anyone else reproduce this? Is there something I'm
 Michael> missing? I'm using svn rev 2730 of matplotlib, and I
 Michael> think this is new behavior in the last couple months.
It's a feature, not a bug :-)
Here is what is happening. matplotlib allocates a different number of
ticks depending on the zoom level, and the axis seeds itself with a
single tick called the "protoTick". If you zoom to the right and new
ticks need to be created, the properties from the protoTick are copied
to the newly created ticks. 99% of the time, this is what you want.
If you have large bold tick labels, and zoom to the right, you want
the new ticks that appear to be large and bold. So this explains why
you see a single tick before the window is drawn (the protoTick), a
list of ticks after the window is drawn, and why the properties of the
first tick (the "visible" property in this case) are transferred to
the other ticks.
So: how do you solve your problem, of making the first tick invisible?
What I do when I need to solve this problem, which comes up a lot with
multiple axes where ticks can overlap, is the following
from matplotlib.ticker import ScalarFormatter
class MyFormatter(ScalarFormatter):
 def __call__(self, x, pos=None):
 if pos==0: return ''
 else: return ScalarFormatter(self, x, pos)
ax.xaxis.set_major_formatter(MyFormatter())
I often want to do this for the last tick as well, but there is
currently no convenient way to do this, as the tick locator produces
the tick location list and the tick formatter doesn't know how many of
them there are. I've been considering modifying the tick locator code
to pass -1 for the pos for the last tick to solve just this use case.
If others need this or think it desirable, just give me a nudge and
I'll do it.
Details about the tick locators and formatter can be found at
http://matplotlib.sourceforge.net/matplotlib.ticker.html and there are
a number of examples
 ~/mpl/examples> grep -l Formatter *.py
 custom_ticker1.py
 dashtick.py
 date_demo1.py
 date_demo2.py
 date_demo_rrule.py
 finance_demo.py
 major_minor_demo1.py
 major_minor_demo2.py
 newscalarformatter_demo.py
 shared_axis_demo.py
Hope this helps,
JDH
From: Aaron H. <ah...@ee...> - 2006年08月31日 05:52:17
Hi all,
Sorry to trouble you with this (likely) trivial issue, but I 
installed matplotlib 0.87.4_r2587 using the .mpkg included with SciPy 
SuperPack for Intel, and I'm unable to import pylab from the iPython 
command line. When I try I get the error message "no module named 
matplotlib.pylab." I checked and the matplotlib sub-directory is 
there under my /Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages directory. In iPython a help(); modules shows 
pylab but importing doesn't work. I'm new to this framework business 
that seems to be favored by Apple, so I'm not really familiar with 
how Python is setup in OS X. Any tips are much appreciated.
Thanks,
Aaron
From: Michael F. <mp...@be...> - 2006年08月31日 02:25:37
Attachments: test.py
Hi all,
I'm still having trouble figuring out what's going on with tick 
labels. I can't figure out why Axes.get_{x,y}ticklabels() is 
returning a list of length unity when I expect to have the list of 
all labels.
If I run the code below (test.py), I expect a list of 9 x tick 
labels. If I run the code once ('run test' in ipython), then it 
gives me a list of 1 tick label. If I close the interactive window 
it generates and run it again, it again returns 1 tick label. 
However, if I leave the window open and re-run the test, it gives the 
right answer.
Can anyone else reproduce this? Is there something I'm missing? I'm 
using svn rev 2730 of matplotlib, and I think this is new behavior in 
the last couple months.

Showing 14 results of 14

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