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: Rich S. <rsh...@ap...> - 2006年08月29日 22:38:19
On 2006年8月29日, John Hunter wrote:
> I think the PNG corruption happened in the cvs to svn migration. These
> files are from a short course that Fernando and I put together which was a
> general introduction to scientific computing in python, and so it is not
> just matplotlib. We can probably provide you with a PDF.
John,
 That would be great. When I saw the integrated tutorial
(python->ipython->numpy->scipy->matplotlib) I knew it was the overview I
needed. That's why I tried to build it here.
Thanks,
Rich
-- 
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc.(TM) | Accelerator
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
From: John H. <jdh...@ac...> - 2006年08月29日 22:22:42
>>>>> "Rich" == Rich Shepard <rsh...@ap...> writes:
 Rich> Having just downloaded the latest code from svn trunk, I
 Rich> started to look at the courses/ directory and was delighted
 Rich> to see all the documentation in .lyx format. However, when I
 Rich> tried to export to pdflatex I discovered that all the .png
 Rich> images in figs/ have damaged headers.
 Rich> They also do not display or convert.
I think the PNG corruption happened in the cvs to svn migration.
These files are from a short course that Fernando and I put together
which was a general introduction to scientific computing in python,
and so it is not just matplotlib. We can probably provide you with a
PDF.
JDH
From: Charlie M. <cw...@gm...> - 2006年08月29日 22:12:11
On 8/29/06, PGM <pgm...@gm...> wrote:
> Folks,
> I've just noticed that in order to get the size of a figure in inches, one can
> use:
> >>> fig.get_size_inches()
> However, the corresponding 'set' method is
> >>>fig.set_figsize_inches()
>
> Is this intentional ? Wouldn't it be better to keep the set/get methods
> consistent ?
>
> Thx for your insight
Agreed. fig.set_figsize seems redundant, so I am changing it to
fig.set_size_inches. The old one will still be present, but will
issue a deprecation warning. I'll commit these changes soon.
- Charlie
From: Rich S. <rsh...@ap...> - 2006年08月29日 22:12:05
 Having just downloaded the latest code from svn trunk, I started to look
at the courses/ directory and was delighted to see all the documentation in
.lyx format. However, when I tried to export to pdflatex I discovered that
all the .png images in figs/ have damaged headers.
 They also do not display or convert.
Rich
-- 
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc.(TM) | Accelerator
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
From: PGM <pgm...@gm...> - 2006年08月29日 20:28:35
Folks,
I've just noticed that in order to get the size of a figure in inches, one can 
use:
>>> fig.get_size_inches()
However, the corresponding 'set' method is 
>>>fig.set_figsize_inches()
Is this intentional ? Wouldn't it be better to keep the set/get methods 
consistent ?
Thx for your insight
P.
From: Kenny O. <ya...@em...> - 2006年08月29日 20:15:36
this could be a very "large" solution depending on the size of your data
sets, but you could make a class for your data and then if you make a
change to the data just import it into your drawing code and then redraw
it. this way if you have more than 1 set of data you are just creating
more than one instance of your data class. but if you are using very
large sets of data this could maybe become very slow and ugly.
if you impliment your data class well enough you could make it so that you
have functions in the data class that "add the new stuff" that you need
to. I'm currently working with a graph that has 6000+ plots of data I am
picking subplots from it and applying a cubic integration to it. It runs
in a timely manner and i have no complaints.
>Hi,
>Does someone know of a convenient way to save a plotted figure in order to
>reloading it later, possible adding new stuffs to it ? Presently, i keep
>pickling my data and cut&pasting my drawing code, by hand. I'm interested if
>some of you would have better solutions.
>Thanks
>--
>Benjamin Thyreau
>CEA Orsay
From: Eric F. <ef...@ha...> - 2006年08月29日 19:33:19
Benjamin THYREAU wrote:
> Hi,
> Does someone know of a convenient way to save a plotted figure in order to 
> reloading it later, possible adding new stuffs to it ? Presently, i keep 
> pickling my data and cut&pasting my drawing code, by hand. I'm interested if 
> some of you would have better solutions.
There has been some discussion of making such a mechanism, but it does 
not exist. I think a better strategy is to encapsulate your code in 
files as functions and/or scripts so as to avoid the cutting and 
pasting. If initially you are plotting interactively, ipython can make 
it easier for you to do this encapsulation: 
http://ipython.scipy.org/doc/manual/node6.html#SECTION00066000000000000000
Eric
From: Benjamin T. <th...@sh...> - 2006年08月29日 16:28:31
Hi,
Does someone know of a convenient way to save a plotted figure in order to 
reloading it later, possible adding new stuffs to it ? Presently, i keep 
pickling my data and cut&pasting my drawing code, by hand. I'm interested if 
some of you would have better solutions.
Thanks
--
Benjamin Thyreau
CEA Orsay
From: John H. <jdh...@ac...> - 2006年08月29日 16:17:20
>>>>> "Samuel" == Samuel GARCIA <sg...@ol...> writes:
 Samuel> Hi all, there is a image.set_clim() but I can't find the
 Samuel> image.get_clim()
 Samuel> Any solution ?
I just committed get_clim to SVN, but in the meantime, you can access
with the image normalization instance, which is what clim is an
interface to anyhow:
In [5]: im = imshow(rand(10,10))
In [6]: im.norm.vmin, im.norm.vmax
Out[6]: (0.011246857233345509, 0.99705302715301514)
From: Samuel G. <sg...@ol...> - 2006年08月29日 09:16:33
Hi all,
there is a image.set_clim()
but I can't find the image.get_clim()
Any solution ?
thank you
Samuel
From: John H. <jdh...@ac...> - 2006年08月29日 04:41:14
>>>>> "Tommy" == Tommy Grav <tg...@ma...> writes:
 Tommy> In a plot window (using Tkagg). just right of the menu the
 Tommy> x and y positions of the pointer is shown when the mouse is
 Tommy> in the window. Since I am using small windows this will
 Tommy> change the size of the window. Is there a way to set the
 Tommy> format or remove this text?
This is fixed in mpl svn -- give it a test drive if you can...
JDH
From: John H. <jdh...@ac...> - 2006年08月29日 04:38:43
>>>>> "Eric" == Eric Firing <ef...@ha...> writes:
 Eric> I don't think so; and although I have not thought hard about
 Eric> it, my impression is that adding this capability would take
 Eric> a lot of work and redesign. I expect that in most cases
 Eric> what you describe would not be the desired behavior, so it
 Eric> would have to be a non-default option.
One should be able to write a specific example that exposes this
functionality fairly easily using callback event handling. I'll
provide a simple example using a line plot to get the approximate
ylimits of the data based on the xaxis zoom limits, and maybe some
enterprising developer can extend this example to an image which sets
the clim based on the xlim and ylim
from pylab import nx, figure, show
t = nx.arange(0.0, 2.0, 0.1)
s = nx.sin(2*nx.pi*t)
fig = figure()
ax = fig.add_subplot(111)
ax.plot(t, s)
def on_xlim(ax):
 xmin, xmax = ax.get_xlim()
 imin, imax = nx.searchsorted(t, (xmin, xmax))
 thiss = s[imin:imax]
 ax.set_ylim(min(thiss), max(thiss))
 ax.figure.canvas.draw()
ax.connect('xlim_changed', on_xlim)
show()
From: John H. <jdh...@ac...> - 2006年08月29日 04:21:20
>>>>> "Richard" == Richard Harvey Chapman <hch...@3g...> writes:
 Richard> Briefly, is there a way to get a callback in the event
 Richard> that the canvas has been redrawn (e.g. from a zoom or
 Richard> pan)?
 Richard> matplotlib 0.86.2 python 2.4.1 wxPython 2.6.2.1 Mac OS
 Richard> X.4.7
 Richard> I draw a circle at a certain point. I let the user drag
 Richard> that point to a new location. However, if the plot is
 Richard> redrawn for any reason, I have to redraw my circle in a
 Richard> new position. I can't seem to find any way to get
 Richard> notified of a redraw.
Have you dried connecting to a draw_event?
 def ondraw(event):
 # do something
 pass
 fig.canvas.mpl_connect('draw_event', ondraw)
FYI, the widgets module matplotlib.widgets is a good place to look for
examples of mpl event handling, in addition to the class documentation
in the Event hierarchy in
http://matplotlib.sourceforge.net/matplotlib.backend_bases.html
JDH
From: John H. <jdh...@ac...> - 2006年08月29日 04:13:33
>>>>> "Jouni" =3D=3D Jouni K Sepp=E4nen <jk...@ik...> writes:
 Jouni> How I came up with this: I knew that I wanted to make some
 Jouni> of the xticklines invisible, so I looked at the list of
 Jouni> line objects for clues as to what differs between
 Jouni> them. They seem to have xdata and ydata properties, and
 Jouni> ydata is (0,) for half of the lines and (1,) for the other
 Jouni> half, so it looks like it is the vertical position in axis
 Jouni> coordinates. (xdata seems to be in data coordinates.)
Off the top of my head, I didn't remember the answer either. Here's
how I answered it: I opened up lib/matplotlib/axis.py in my local copy
of the mpl src distro and searched for Tick (you could have done the
same by pointing your browser to
http://matplotlib.sourceforge.net/matplotlib.axis.html#Tick) and saw
the following attributes in the docstring
 Publicly accessible attributes
 tick1line : a Line2D instance
 tick2line : a Line2D instance
 gridline : a Line2D instance
 label1 : a Text instance
 label2 : a Text instance
 gridOn : a boolean which determines whether to draw the ticklin=
e
 tick1On : a boolean which determines whether to draw the 1st tic=
kline
 tick2On : a boolean which determines whether to draw the 2nd tic=
kline
 label1On : a boolean which determines whether to draw tick label
 label2On : a boolean which determines whether to draw tick label
I know, and it should be better documented, that for the x-axis, the
tick1 and label1 designations are for the lower axis, and the tick2
and label2 are for the upper (ditto for left/right for the y-axis).
So tick.tick1line controls the properties for the lower tick, etc.
Thus one can do
for tick in ax.xaxis.get_major_ticks():
 tick.tick1line.set_visible(False)
 tick.label2.set_color('darkslategray')
As Jouni notes, the documentation could and should be better, but the
underlying concepts are pretty simple. A Figure contains multiple
Axes, each of which contains an XAxis and YAxis. The XAxis and Yaxis
contains XTicks and YTicks, and these contains tick lines (Line2D
instances) and tick labels (Text instances). Each of these upper-case
thingies is a well-documented matplotlib class (this class containment
hierarchy is also documented in the user's guide). For future
reference, the links to the class documentation for each of these is
Figure : http://matplotlib.sourceforge.net/matplotlib.figure.html
Axes/Subplot : http://matplotlib.sourceforge.net/matplotlib.axes.html
XAxis/YAxis : http://matplotlib.sourceforge.net/matplotlib.axis.html
XTick/YTick : http://matplotlib.sourceforge.net/matplotlib.axis.html
Line2D : http://matplotlib.sourceforge.net/matplotlib.lines.html
Text : http://matplotlib.sourceforge.net/matplotlib.text.html
As Jouni notes, setp and getp are a nice way to get quick interactive
access to the configurable properties, but they are also documented in
the class documentation in the links above.
JDH

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