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


Showing 14 results of 14

Mike,
Thanks for the help. It worked. I have another question but I will send it
as a new thread.
Nihat
On Mon, Jun 30, 2008 at 12:02 PM, Michael Droettboom <md...@st...>
wrote:
>
>
> Tony S Yu wrote:
>
>>
>> On Jun 30, 2008, at 11:13 AM, Michael Droettboom wrote:
>>
>>> transScale is where all of the (optionally) logarithmic transformation
>>> takes place. I'm surprised
>>>
>>> >>> transDesired = self.transScale + self.transLimits
>>>
>>> didn't work for going from data to a (0, 0) - (1, 1) bounding box. Can
>>> you provide a small, yet complete, example that illustrates the bug so I can
>>> look at it further?
>>>
>>
>> I tried to put together a simple example showing my problem, but the
>> example worked properly! Doh!
>>
>> It turns out that my problem was specific to using a bounding box as an
>> input to transform:
>>
>> =========
>> from numpy.random import rand
>> import matplotlib.pyplot as plt
>>
>> ax = plt.subplot(111)
>> xy = rand(5,2)
>> ax.loglog(xy[:, 0], xy[:, 1], 'ro')
>>
>> trans = ax.transScale + ax.transLimits
>> result = trans.transform(ax.dataLim) =========
>>
>> The above command gives me:
>> * TypeError:* 'Bbox' object is unsubscriptable
>> (Note, if I call `plot` instead of `loglog` I don't have problems). The
>> quick solution is to replace the last line with
>>
>> >>> result = trans.transform(ax.dataLim._points)
>>
>> I guess I was confused because the transform worked fine with `plot`. Is
>> the TypeError above expected behavior?
>>
>> Yes. The "transform" method is meant to take an Nx2 array, it doesn't
> take a bounding box. I think it probably works with non-log plots only by
> accident because bounding boxes can cast to arrays in some cases. It may be
> worth taking that out to avoid confusion, but I'll have to think on it some.
>
> Thanks for looking into this!
>
>
> Mike
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
From: Brent P. <bpe...@gm...> - 2008年07月02日 22:20:05
On Wed, Jul 2, 2008 at 2:53 PM, Brent Pedersen <bpe...@gm...> wrote:
> hi, for pylab.plot, i am able to get the transform like this:
>
> import pylab
> xs = [0, 999]
> ys = [10, 555]
>
> f, = pylab.plot(xs, ys)
> t = f.get_transform()
> print t.transform(zip(xs, ys))
>
>
> how can i do that for a pylab.scatter? this:
>
> s = pylab.scatter(xs, ys)
> print s.get_transform().transform(zip(xs, ys))
>
> simply prints the original x,y coordinates unaltered. the only way i'm
> able to do this, is to plot() the points, get the transform t,
> scatter() the points, and
> then set the transform. how can i get the transform directly?
>
> thanks,
> -brentp
>
as it goes, i figured this out after sending. the code below does the trick.
but i'm not sure why i have to manually set the transform.
 s = pylab.scatter(xs, ys)
 s.set_transform(s.axes.transData)
 print s.get_transform().transform(zip(xs,ys))
From: Brent P. <bpe...@gm...> - 2008年07月02日 21:53:48
hi, for pylab.plot, i am able to get the transform like this:
 import pylab
 xs = [0, 999]
 ys = [10, 555]
 f, = pylab.plot(xs, ys)
 t = f.get_transform()
 print t.transform(zip(xs, ys))
how can i do that for a pylab.scatter? this:
 s = pylab.scatter(xs, ys)
 print s.get_transform().transform(zip(xs, ys))
simply prints the original x,y coordinates unaltered. the only way i'm
able to do this, is to plot() the points, get the transform t,
scatter() the points, and
then set the transform. how can i get the transform directly?
thanks,
-brentp
From: Barry W. <bar...@gm...> - 2008年07月02日 20:41:38
Attachments: backend_cocoa.py
I've written the start of a Cocoa-native backend for matplotlib and
would like to submit feedback on the code and on the possibility of
including it in the standard matplotlib distribution. The backend
implementation is not complete (image rendering and mathtext rendering
are currently no implemented, nor are the print_* methods of the
FigureCanvas). Image rendering is trivial once I figure out how to get
the pixel data out of a matplotlib image (I just haven't investigated
the API yet). The print_* methods are also trivial (see point 1
below). I'm not sure how to handle mathtext yet. This backend has two
major feature differences from CocoaAgg:
1. All drawing is done via native Quartz drawing calls. This has the
advantage of making all of the native rendering functionality
(including native font rendering and output formats (all those
supported by Cocoa-eps,pdf,tiff,etc.) available to matplotlib. It has
the disadvantage that the translation from matplotlib paths to Cocoa
NSBezierPaths is done in python and is much slower than the compiled
version of this operation in the Agg backend (this is a solvable
problem, of course).
2. The reason I wrote the backend was so that matplotlib could be used
seemlesslly from within a Cocoa application. Thus this backend *will
not work* without an existing NSRunLoop. It won't work from the
terminal or an IPython session. It will work from the in-progress
Cocoa frontend for IPython or from any other Cocoa application. Again
there are tradeoffs. On the positive side, figure windows are treated
like any other application window, selectable from the Window menu
etc. and matplotlib becomes a seemless part of the application.
Existing backends designed to create their own runloop (e.g. CocoaAgg
or TkAgg) cause menubar and run loop problems when used from within an
existing application. It would be possible to merge the CocoaAgg and
Cocoa backends in this regard to use the existing run loop if present.
I've attached the backend_cocoa.py.
cheers,
Barry
From: John H. <jd...@gm...> - 2008年07月02日 20:30:32
Attachments: memleak_hawaii3.py
On Wed, Jul 2, 2008 at 3:20 PM, laurent oget <la...@og...> wrote:
> I use the Pdf backend. I did do some digging in the GC module but have not
> found anything yet
Please keep all replies on list so others can contribute to the
discussion and future generations of googlers can benefit from it
(reply to all)
If you can provide a stand-along script that replicates the problem,
please post it. Our canonical memory leak testing script (attached)
does not appear to be leaking in my tests with the PDF backend.
From: John H. <jd...@gm...> - 2008年07月02日 20:07:06
On Wed, Jul 2, 2008 at 2:56 PM, laurent oget <la...@og...> wrote:
> I am using matplotlib to produce a big number(16000) of charts and am facing
> a steady memory leak. my code sofar looks like:
>
> while(1):
> fig=PL.figure(1)
> ..plot some things..
> fig.clf()
> PL.close()
>
>
> am i missing something?
What backend are you using -- some of the GUI backends have known
leaks that are outside the control of mpl. So you may want to use the
agg backend (or ps, etc.). If you still gt a leak, consult the memory
leak FAQ and follow instructions there
http://matplotlib.sourceforge.net/faq.html#LEAKS
From: Momme B. <mo...@ya...> - 2008年07月02日 19:56:16
Trying to set the interpolation method for a NonUniformImage object I 
receive the following error:
 >>> im.set_interpolation('bilinear')
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/usr/lib/python2.5/site-packages/matplotlib/image.py", line 396, 
in set_interpolation
 raise NotImplementedError('Only nearest neighbor supported')
If I am not mistaken according to the class reference on the web-page 
this should be possible though. Is this functionality depending on the 
version I am running (0.91.2) or am I doing something wrong
Alternatively, what methods are there to obtain interpolated color plots 
of data on irregurarly spaced rectengular grids?
Cheers,
Momme
From: laurent o. <la...@og...> - 2008年07月02日 19:56:07
I am using matplotlib to produce a big number(16000) of charts and am facing
a steady memory leak. my code sofar looks like:
while(1):
 fig=PL.figure(1)
 ..plot some things..
 fig.clf()
 PL.close()
am i missing something?
Laurent
From: Darren D. <dsd...@gm...> - 2008年07月02日 16:20:11
Hi Gideon,
On Wednesday 02 July 2008 11:34:46 am Gideon Simpson wrote:
> So no one else has seen this bug? I'm on an OS X 10.5.4 machine with
> fink python 2.5.2 and associated backend packages. i'm using my own
> builds of numpy/scipy and matplotlib.
> -gideon
(Please don't top post, it makes it difficult to follow the conversation.)
When I run::
 help()
 help> modules
I get an error related to Moin:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/darren/<ipython console> in <module>()
/usr/lib64/python2.5/site.pyc in __call__(self, *args, **kwds)
 345 def __call__(self, *args, **kwds):
 346 import pydoc
--> 347 return pydoc.help(*args, **kwds)
 348
 349 def sethelper():
/usr/lib64/python2.5/pydoc.pyc in __call__(self, request)
 1646 else:
 1647 self.intro()
-> 1648 self.interact()
 1649 self.output.write('''
 1650 You are now leaving help and returning to the Python interpreter.
/usr/lib64/python2.5/pydoc.pyc in interact(self)
 1664 request = strip(replace(request, '"', '', "'", ''))
 1665 if lower(request) in ('q', 'quit'): break
-> 1666 self.help(request)
 1667
 1668 def getline(self, prompt):
/usr/lib64/python2.5/pydoc.pyc in help(self, request)
 1680 elif request == 'keywords': self.listkeywords()
 1681 elif request == 'topics': self.listtopics()
-> 1682 elif request == 'modules': self.listmodules()
 1683 elif request[:8] == 'modules ':
 1684 self.listmodules(split(request)[1])
/usr/lib64/python2.5/pydoc.pyc in listmodules(self, key)
 1801 if find(modname, '.') < 0:
 1802 modules[modname] = 1
-> 1803 ModuleScanner().run(callback)
 1804 self.list(modules.keys())
 1805 self.output.write('''
/usr/lib64/python2.5/pydoc.pyc in run(self, callback, key, completer)
 1852 callback(None, modname, desc)
 1853
-> 1854 for importer, modname, ispkg in pkgutil.walk_packages():
 1855 if self.quit:
 1856 break
/usr/lib64/python2.5/pkgutil.pyc in walk_packages(path, prefix, onerror)
 123 path = [p for p in path if not seen(p)]
 124
--> 125 for item in walk_packages(path, name+'.', onerror):
 126 yield item
 127
/usr/lib64/python2.5/pkgutil.pyc in walk_packages(path, prefix, onerror)
 108 if ispkg:
 109 try:
--> 110 __import__(name)
 111 except ImportError:
 112 if onerror is not None:
/usr/lib64/python2.5/site-packages/MoinMoin/macro/__init__.py in <module>()
 49 
#############################################################################
 50
---> 51 class Macro:
 52 """ Macro handler
 53
/usr/lib64/python2.5/site-packages/MoinMoin/macro/__init__.py in Macro()
 81 # we need the lang macros to execute when html is generated,
 82 # to have correct dir and lang html attributes
---> 83 for lang in i18n.wikiLanguages():
 84 Dependencies[lang] = []
 85
TypeError: 'NoneType' object is not iterable
From: Michael D. <md...@st...> - 2008年07月02日 15:36:06
Attachments: legend.py.patch
Yeah, it looks like this is a real bug (that only affects the 0.91.x 
maintenance branch). LineCollection seemingly had get_lines() at one 
point but it disappeared. 
I have committed a fix to SVN and attached a patch against legend.py.
Cheers,
Mike
Yannick Copin wrote:
> Hi,
>
> I thought this AttributeError when using legend was solved a long time ago 
> (see http://article.gmane.org/gmane.comp.python.matplotlib.general/10306) but 
> I still face it in matplotlib 0.91.3, released 4 weeks ago (and this does not 
> seem to have changed in recent version of collections.py).
>
> Can someone tell me what is the actual situation?
>
> Cheers.
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Gideon S. <gr...@co...> - 2008年07月02日 15:34:56
So no one else has seen this bug? I'm on an OS X 10.5.4 machine with 
fink python 2.5.2 and associated backend packages. i'm using my own 
builds of numpy/scipy and matplotlib.
-gideon
On Jul 1, 2008, at 11:16 AM, Gideon Simpson wrote:
> matplotlib itself seems to work, in the sense that it makes figures
> and puts the lines in the right places.
>
> however, that error is still showing up if i go to help() then modules
> On Jul 1, 2008, at 11:01 AM, John Hunter wrote:
>
>> On Tue, Jul 1, 2008 at 9:14 AM, Gideon Simpson
>> <gr...@co...> wrote:
>>
>>> python -c 'import matplotlib; print matplotlib.__file__'
>>> python simple_plot.py --verbose-debug >& run.out\
>>
>> There was no traceback in run.out -- does this mean everything is
>> working for you now?
>>
>> JDH
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Sebastian H. <seb...@gm...> - 2008年07月02日 12:38:09
Hi,
I am new to matplotlib and just installed it in my home directory as
an egg along with numpy and pytz on Solaris 10. Building matplotlib
using setupegg.py bdist_egg worked out just fine. But when I am
trying to run the simple_plot.py example or do an interactive plot([1,
2, 3]); show(), all I get is the Tk window frame and an empty plotting
area.
Below is the output I got from --verbose-helpful:
python simple_plot.py --verbose-helpful
$HOME=/home/shauer
CONFIGDIR=/home/shauer/.matplotlib
matplotlib data path
/home/shauer/sys/py/lib/matplotlib-0.98.1-py2.5-solaris-2.10-sun4u.egg/matplotlib/mpl-data
loaded rc file /home/shauer/sys/py/lib/matplotlib-0.98.1-py2.5-solaris-2.10-sun4u.egg/matplotlib/mpl-data/matplotlibrc
matplotlib version 0.98.1
verbose.level helpful
interactive is False
units is False
platform is sunos5
Using fontManager instance from /home/shauer/.matplotlib/fontManager.cache
numerix numpy 1.1.0
backend TkAgg version 8.5
Any help is appreciated,
Sebastian
From: Matthias M. <Mat...@gm...> - 2008年07月02日 08:00:31
Hello John,
I'm not sure there is a better way, but the following works for me:
--------------------------------------------------------------------------------------
from pylab import *
fig = figure()
# adding some subplots / axes instances
subplot(121)
x = linspace(-0.5, 1.5, 10)
plot(x, 0.5*x**2, 'ro', x, 0.33*x**3, 'bs')
for i in [2, 4]:
 subplot(2,2,i)
# get all axes of the figure 'fig' ...
allaxes = fig.get_axes()
# ... and reset their property x-limits 
setp(allaxes, 'xlim', (-.5, 1.5))
ax = allaxes[0]
# get all lines of the axes 'ax' ...
lines = ax.get_lines() # == ax.lines
# ... and reset their markerfacecolor
setp(lines, 'mfc', 'g')
show()
---------------------------------------------------------------------------------------
best regards
Matthias
On Thursday 26 June 2008 00:21:13 John Kitchin wrote:
> Is there a way to find all the "axes" objects or "line" object handles in
> pylab? In matlab I used to do something like
> A = findobj(gcf)
> Allaxes = findall(a,'Type','axes')
> Set(allaxes,'Fontname','Arial')
>
> Is there a way to do that in pylab/matplotlib?
>
> Thanks,
>
> j
>
>
>
> -----------------------------------
> John Kitchin
> Assistant Professor
> NETL-IAES Resident Institute Fellow
> Doherty Hall 3112
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> http://kitchingroup.cheme.cmu.edu
>
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Sebastian K. <seb...@io...> - 2008年07月02日 03:02:53
Hi folks!
I was wondering if it's possible to have legends that are horizontaly 
aligned instead of verticaly?
Thanks in advance.
Sebastian
1 message has been excluded from this view by a project administrator.

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