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

Showing results of 30

1 2 > >> (Page 1 of 2)
From: Alan G I. <ai...@am...> - 2005年09月02日 22:13:53
My lovely matplotlib EPS graphics are missing in my PDF 
files if I use dvipdfm. It looks (?) like they are included 
but then are blanked out afterwards. Any idea why? I have never had
trouble with other EPS files.
I tried cutting out all the page size stuff in the EPS file 
(what is that about?) but it did not help.
Using dvips and ps2pdf gives a fine result.
The EPS files appear to be valid, but must be doing
something that upsets dvipdfm.
Thanks,
Alan Isaac
PS Here is a "stripped down" example file.
%%%%%%%%%%% temp.tex %%%%%%%%%%%%%%%%%%%
\documentclass[10pt]{book}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htp]
\centering
\includegraphics[width=\textwidth]{temp.eps}
\end{figure}
\end{document}
%%%%%%%%%%% temp.eps %%%%%%%%%%%%%%%%%%%
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 188 781 765 1214
%%LanguageLevel: 2
%%EndComments
%%BeginProlog
% This copyright applies to everything between here and the %%EndProlog:
% Copyright (C) 2005 artofcode LLC, Benicia, CA. All rights reserved.
%%BeginResource: procset GS_epswrite_2_0_1001
/GS_epswrite_2_0_1001 80 dict dup begin
/!{bind def}bind def/#{load def}!/N/counttomark #
/rG{3{3 -1 roll 255 div}repeat setrgbcolor}!/G{255 div setgray}!/K{0 G}!
/r6{dup 3 -1 roll rG}!/r5{dup 3 1 roll rG}!/r3{dup rG}!
/w/setlinewidth #/J/setlinecap #
/j/setlinejoin #/M/setmiterlimit #/d/setdash #/i/setflat #
/m/moveto #/l/lineto #/c/rcurveto #
/p{N 2 idiv{N -2 roll rlineto}repeat}!
/P{N 0 gt{N -2 roll moveto p}if}!
/h{p closepath}!/H{P closepath}!
/lx{0 rlineto}!/ly{0 exch rlineto}!/v{0 0 6 2 roll c}!/y{2 copy c}!
/re{4 -2 roll m exch dup lx exch ly neg lx h}!
/f{P fill}!/f*{P eofill}!/s{H stroke}!/S{P stroke}!
end def
%%EndResource
/pagesave null def
%%EndProlog
%%Page: 1 1
%%BeginPageSetup
GS_epswrite_2_0_1001 begin
/pagesave save store
0.012 0.012 scale
%%EndPageSetup
mark
15690 65160 48000 36000 re
255 G
15690 65160 48000 36000 re
f
83.3333 w
2 J
15690 65160 48000 36000 re
S
21690 68760 37200 28800 re
f
K
21690 68760 37200 28800 re
S
cleartomark end pagesave restore
 showpage
%%PageTrailer
%%Trailer
%%Pages: 1
From: John H. <jdh...@ac...> - 2005年09月02日 22:02:43
>>>>> "Sascha" == Sascha <sas...@gm...> writes:
 >> Using the agg backend you can obtain an RGBA buffer or RGB
 >> string which can then be loaded as a PIL Image for processing.
 >> I've adapted a the examples/agg_oo.py to demonstrate.
 Sascha> Thanks a lot, Nicolas! Excellent... no more temp file! It
 Sascha> took me some time to figure out how to get the PNG image
 Sascha> data from PIL, but it worked out quite well.
Could you post a complete example so that others won't have to spend
that extra time figuring out how to put all the pieces together?
Thanks,
JDH
From: Sascha <sas...@gm...> - 2005年09月02日 21:54:57
> I posted this to the list a few days ago:
>
> Using the agg backend you can obtain an RGBA buffer or RGB string which
> can then be loaded as a PIL Image for processing. I've adapted a the
> examples/agg_oo.py to demonstrate.
Thanks a lot, Nicolas! Excellent... no more temp file! It took me some time 
to figure out how to get the PNG image data from PIL, but it worked out 
quite well.
Sascha 
From: Fernando P. <Fer...@co...> - 2005年09月02日 20:33:47
John Porter wrote:
> Hi,
> I have written some code which generates 3D plots, this was inspired by
> the 3D axes code posted recently. The basic idea is that 2D Artist
> elements have their 'draw' method subverted to generate the projected 3D
> coordinates. The plot is interactive and allows panning and tilting of
> the graph by pressing and holding mouse-2.
> 
> I am new to this list, and was wondering where I should post the code
> (it consists of two modules).
Very cool! I can report that it works under ipython -pylab with the TkAgg 
backend as well, using stock mpl 0.83.2.
Excellent work!
Cheers,
f
From: <and...@ti...> - 2005年09月02日 20:18:22
Hi John,
>I will, but it's very much work in progress....
>There are 
hardly any comments, but there are a few tests at the bottom 
>of 
mplot3d.
Very nice work, the script are working nice... mhm, I didn't 
understand the problem about WXAgg, I just commented out the lines 
involving self.toolbar.something, changed the default backend, and it's 
working also with WXAgg. But probably I did not understood correctly 
your email.
Thanks for the nice job.
Andrea.
I will be out of the office until September 26. I will respond to your message as soon as I return.
Thank you,
Eli
From: John P. <jp...@ca...> - 2005年09月02日 19:40:52
Attachments: mplot3d.py proj3d.py
John Hunter wrote:
>>>>>>"John" == John Porter <jp...@ca...> writes:
>>>>>> 
>>>>>>
>
> John> fig = p.figure() ax = mplot3d.Axes3D(fig)
>
>Very nice screenshot!! -- did you intend to the mplot3d module so we
>could test ourselves?
>
>JDH
>
>
> 
>
I will, but it's very much work in progress....
There are hardly any comments, but there are a few tests at the bottom 
of mplot3d.
John
I will be out of the office until September 26. I will respond to your message as soon as I return.
Thank you,
Eli
From: Mark B. <ma...@gm...> - 2005年09月02日 19:27:04
I think (hope) what Martin (nice email address btw) means is that when you=
=20
use the history button it reverts back to the old axis limits, but not to=
=20
the old position.
The history function needs to be updated to both keep track of axes limits=
=20
and axes positions.
This is also important for the new axis('equal') command that was submitted=
=20
as a patch and will hopefully appear in the next release.
I guess this shouldn't be too difficult.
Mark
Date: Fri, 2 Sep 2005 16:11:45 +0200 (MEST)
From: "Martin Richter" <law...@gm...>
To: mat...@li...urcef=20
>=20
> orge.net <http://orge.net>
> Subject: [Matplotlib-users]=20
> =3D?ISO-8859-1?Q?zoomhistory,_zoom_to_rectangle?=3D
>=20
> Hello,
>=20
> one of Matplotlib's greatest advantage (besides the great graphics of
> course) is the ability to zoom in into plotted curves. The zoomhistory is
> thereby a very good and useful tool.
> I figured out two things:
>=20
> 1) Unfortunetly this history seems not to work properly in some cases. I
> was able to track down this error on the call of the subplot-command (see
> example below).
> Is this a little bug or am I using those commands in a way they are not
> supposed to be used?
From: John H. <jdh...@ac...> - 2005年09月02日 19:18:19
>>>>> "John" == John Porter <jp...@ca...> writes:
 John> fig = p.figure() ax = mplot3d.Axes3D(fig)
Very nice screenshot!! -- did you intend to the mplot3d module so we
could test ourselves?
JDH
From: John P. <jp...@ca...> - 2005年09月02日 18:44:09
Attachments: surface.png
Hi,
I have written some code which generates 3D plots, this was inspired by
the 3D axes code posted recently. The basic idea is that 2D Artist
elements have their 'draw' method subverted to generate the projected 3D
coordinates. The plot is interactive and allows panning and tilting of
the graph by pressing and holding mouse-2.
I am new to this list, and was wondering where I should post the code
(it consists of two modules).
This example code here generates the attached png:
def run1():
 delta = 0.025
 x = y = p.arange(-3.0, 3.0, delta)
 X, Y = p.meshgrid(x,y)
 Z1 = p.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
 Z2 = p.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
 Z = Z2-Z1
 X = X * 10
 Y = Y * 10
 Z = Z * 500
 fig = p.figure()
 ax = mplot3d.Axes3D(fig)
 ax.plot_surface(X,Y,Z, div=10)
 ax.set_xlabel('X')
 ax.set_ylabel('Y')
 ax.set_zlabel('Z')
 fig.add_axes(ax)
 p.savefig("surface.png", dpi=40)
 p.show()
From: Alan I. <ai...@am...> - 2005年09月02日 16:50:02
matplotlib's __init__.py is apparently looking
at os.environ['HOME'], but the default XP setting
for that is '%USERPROFILE%', which then gets passed
(*without* expansion) on by get_home even though it's
expansion is needed. So import pylab does not work.
I don't have time to look at this now.
This is a common problem on Windows.
I'll post a solution I've found when I'm back home.
Cheers,
Alan Isaac
From: Mark B. <ma...@gm...> - 2005年09月02日 16:18:45
I have converted many eps files generated with matplotlib to pdf. This work=
s=20
well (for me) with both Acrobat 6 and GSview 4.0.
Mark
From: John H. <jdh...@ac...> - 2005年09月02日 15:59:01
>>>>> "Martin" == Martin Richter <law...@gm...> writes:
 Martin> Hello, first of all let me say: Matplotlib is really
 Martin> great. I'm used looking at xplt-graphics and MPL is just
 Martin> beautifull!
 Martin> For my programs I needed the coordinates of mouseclick and
 Martin> -release point so I modified the
 Martin> HorizontalSpanSelector. With the class in the attached
 Martin> file it is possible to use functions needing those
 Martin> coordinates.
Hi Martin,
A nice example. I've been meaning to add something like this to
widgets.py. Do you mind if I include this under the matplotlib
license. I would probably rename it to something like
"RubberbandWidget" or RectangleSelector. For some reason, rectangular
region selection is often called "rubberbanding". I also suggest
making the callback pass eventPress and eventRelease rather than the
positions, because this is more flexible. For example, it gives the
user access to the window coords and key presses in addition to the x
and y data coords.
 Martin> In the example a large number of pionts is added to the
 Martin> plot so that you can check out performance improvments
 Martin> when using blitting. This however is only possible when
 Martin> calling python LinseSelector.py -dGTKAgg If using another
 Martin> backend blitting will not be possible right now (I don't
 Martin> know ehy, 
The animation/blit API is new and requires some fairly low level
manipulation of pixel buffers and so on. To do this efficiently often
means writing extension code, so some of the other backends were a
little slower than others to implement it. Fortunately, thanks to the
hard work of Ken McIvor and Charles Moad, there is now also support
for WXAgg and TkAgg in CVS.
 Martin> I'm not very keen on this "manifold of backends"
I'm not sure exactly what this means, but I assume you think that
matplotlib is trying to support too many GUI toolkits. Perhaps. But
my philosophy is that the more developers you can get using
matplotlib, the more people will make useful contributions (like your
widget, hopefully). Since many groups are committed to a certain GUI
toolkit based on years of usage, they simply would not use matplotlib
if it didn't support their toolkit. Some of these people add support
if it is not there, and I am happy for it. It is a bit of a
maintenance hassle to support lots of toolkits across platforms, but
it mostly works.
 Martin> Although this works fine for my belongings I'm still
 Martin> unhappy with two things: - All this doesn't look like the
 Martin> normal connect('event',function)-style. It would be nicer
 Martin> if this LineSelector could also be handled in such a way.
One could define a drag_event in backend_bases. This would be
implemented in terms of the existing primitives (press, motion,
release) and so wouldn't require touching any backend code. Feel free
to take a crack at it if you are so inclined. As you note though, the
widget you've defined is perfectly functional.
 Martin> - If one uses this LineSelector the callback-function has
 Martin> to accept exactly two lenght-2 arays of floats (which
 Martin> means it is prescribed to the user). I'm not quite sure if
 Martin> this is very practical.
I'm not 100% sure what your problem with this is but as I said above,
passing events is more general.
Thanks again,
JDH
From: Alan I. <ai...@am...> - 2005年09月02日 15:53:23
On 2005年9月02日, John Hunter wrote:
> If you could send a docstring patch, that would be great.
I was going to but I looked in pylab.py and found a note
that the plot function def and docs were automatically
generated, so I did not know what file to patch. (Sorry;
I'm new to this kind of thing.)
Cheers,
Alan Isaac
From: John H. <jdh...@ac...> - 2005年09月02日 15:44:33
>>>>> "Alan" == Alan G Isaac <ai...@am...> writes:
 Alan> That reminds me: the pylab docs refer several times to
 Alan> 'plot' for the kwargs, but these are not listed by the plot
 Alan> docs. It would be nice if the plot docs said
If you could send a docstring patch, that would be great.
JDH
From: John H. <jdh...@ac...> - 2005年09月02日 15:43:43
>>>>> "Jack" == Jack Andrews <ef...@iv...> writes:
 Jack> the labels on the axes would also be rotated. of course, i
 Jack> could rotate the plot elements 45 degrees clockwise then
 Jack> rotate the resulting image anticlockwise
It's possible to draw it, but you would have to do all the
transformations/rotations by hand, including drawing the axes as
Line2D instances and labels as Text instances (see for example the
"Scatter3D" example in the archives). There is no easy, built-in, way
to do it, currently. In the planned refactoring of the axis handling,
I'll keep this use-case in mind.
JDH
From: John H. <jdh...@ac...> - 2005年09月02日 15:40:51
>>>>> "Arnd" == Arnd Baecker <arn...@we...> writes:
 Arnd> Hi John, I looked a little bit further into this, and maybe
 Arnd> there is a simple solution:
 Arnd> In imshow (axes.py): if I comment out the lines
 Arnd> #corners = (xmin, ymin), (xmax, ymax)
 Arnd> #self.update_datalim(corners) #self.set_xlim((xmin, xmax))
 Arnd> #self.set_ylim((ymin, ymax))
 Arnd> it works fine for the example I sent yesterday. (only the
Yes, that should read
 corners = (xmin, ymin), (xmax, ymax)
 self.update_datalim(corners)
 if self._autoscaleon:
 self.set_xlim((xmin, xmax))
 self.set_ylim((ymin, ymax))
Thanks.
 Arnd> different behaviour when changing the order of
 Arnd> `axis("equal")` and `axis([-0.35,2.1,-0.2,1.25])` persists.)
It is not surprising that the order makes a difference. When
correcting for the aspect ratio, either the data limits, window
limits, or both have to change. The default is to change the data
limits, but you can control this by calling
 ax.set_aspect(aspect='equal', fixLimits=True)
This is the function that axis('equal') calls, and by using it
directly you can tweak some of the default behaviors. See the
docstring for set_aspect (in CVS) for more information.
This is fairly new functionality so let us know if this works for you.
It might be a good idea for someone to start a wiki entry on the
various issues of axes aspect ratio.
JDH
From: Robert K. <rk...@uc...> - 2005年09月02日 15:30:44
Samuel M. Smith wrote:
> When I save graphs in either .eps or .ps, I can't convert them to .pdf.
> I tried using Adobe Distiller 7.0
> Apple Preview
> epstopdf
> 
> I believe the problem is that the postscript font definitions are bad.
> If I generate a plot without any text on the plot
> then I can convert just fine to pdf.
> 
> Has anyone else experienced this problem?
Yes. If you have LaTeX installed, and set
 rc('text', usetex=True)
then saving to EPS and converting to PDF through any of the various
means works fine.
-- 
Robert Kern
rk...@uc...
"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
 -- Richard Harter
From: Samuel M. S. <sm...@sa...> - 2005年09月02日 14:20:03
On 02 Sep, 2005, at 08:06, Samuel M. Smith wrote:
> I am a new user to MatPlotLib so some of the way it works is 
> unfamiliar to me.
> However I searched the archives and couldn't find anything like the 
> problem I am having.
> I hope someone has a work around or can tell me what is going on.
>
> I have OS X 10.4.2, Python 2.4.1 framework build
> I installed matplotlib 0.83.2 from source with freetype 2.10 from 
> source
typo its freetype 2.1.10
From: Martin R. <law...@gm...> - 2005年09月02日 14:11:54
Hello,
one of Matplotlib's greatest advantage (besides the great graphics of
course) is the ability to zoom in into plotted curves. The zoomhistory is
thereby a very good and useful tool.
I figured out two things:
1) Unfortunetly this history seems not to work properly in some cases. I 
was able to track down this error on the call of the subplot-command (see
example below).
Is this a little bug or am I using those commands in a way they are not
supposed to be used?
2) If the built-in zoomfunction "zoom to rectangle" is used too "hectic"
(i.e. the mouse is still moving when the button is released) the zoom is
done but not shown. Therefor one can see the just drawn
rectangles.
Bye,
Martin
#-----------------------------------------------------------------------------------
"""This program shows how the zoom-history is messed up by the usage of the
 subplot-command.
"""
from pylab import *
def click(event):
 """Plot a point.
 """
 if event.inaxes==subplot1 and event.button==1:
 x,y = event.xdata,event.ydata
 subplot(121,autoscale_on=False)
 # If those subplot-commands are commented out 
 # the zoom-history will work properly.
 # (i.e. the home-function is defective, 
 # only steps back untill the last click(event)-call 
 # are possible.)
 plot([x],[y],'ro')
 subplot(122,autoscale_on=False)
 plot([x],[y],'go')
 draw()
t=arange(100)/99.0
subplot2 = subplot(122,autoscale_on=False)
plot(t,.5*(sin(2*pi*t)+1))
subplot1 = subplot(121,autoscale_on=False)
plot(t,t**2)
axis([0,1,0,1])
connect('button_press_event',click)
show()
-- 
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++
From: Martin R. <law...@gm...> - 2005年09月02日 14:08:28
Hello,
I tried to retype python programs from xplt to matplotlib.
What is necessary some times is to plot some curves one after another
seperated by raw_input().
Unfortunately the figures seem not to be buffered correctly. Here is a
little example:
#---------------------------------------------------------
from pylab import *
ion() # interactive mode
x = arange(10)
plot(x,x*x) # ad something to the plot
draw() # draw it
raw_input("During this time the plot is not refreshed when \
temporarily overlapped by another window.") # wait for user
#---------------------------------------------------------
Is there a way to get the buffer working again?
Thanks a lot,
Martin
-- 
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++
From: Samuel M. S. <sm...@sa...> - 2005年09月02日 14:06:43
I am a new user to MatPlotLib so some of the way it works is =20
unfamiliar to me.
However I searched the archives and couldn't find anything like the =20
problem I am having.
I hope someone has a work around or can tell me what is going on.
I have OS X 10.4.2, Python 2.4.1 framework build
I installed matplotlib 0.83.2 from source with freetype 2.10 from =20
source
I fixed the bug in matplotlib in the font manager where the exception =20=
handling was commented out.
(BTW I had the same problem with a package install of matplotlib =20
0.82, I installed 0.83.2 hoping that
it would fix my problem)
When I save graphs in either .eps or .ps, I can't convert them to .pdf.
I tried using Adobe Distiller 7.0
Apple Preview
epstopdf
I believe the problem is that the postscript font definitions are =20
bad. If I generate a plot without any text on the plot
then I can convert just fine to pdf.
Has anyone else experienced this problem?
Has anyone tried to convert to pdf? If you were successful what =20
versions of the relevant software were you using
Is it just my setup or is the postscript generation code for font =20
definitions broken?
Does anyone have suggestions for a workaround?
I posted this to sourceforge a couple of days ago but so far it =20
doesn't appear that anyone has looked at it.
The error is as follows:
Acrobat Distiller 7.0
Started: Wednesday, 31 August, 2005 at 22:27
Adobe PostScript software version: 3016.102
CID support library initialization completed.
Distilling: test.ps
Start Time: Wednesday, 31 August, 2005 at 22:27
Source: /Users/smithsm/Data/Graphics/AWACS/plots/test.ps
Destination: /Users/smithsm/Data/Graphics/AWACS/plots/test.pdf
Adobe PDF Settings: /Library/Application Support/Adobe PDF/Settings/=20
PYLab.joboptions
Processing prologue.ps...
Done processing prologue.ps.
%%[ Error: syntaxerror; OffendingCommand: > ]%%
Stack:
0
-mark-
/sfnts
%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%
%%[ Warning: PostScript error. No PDF file produced. ] %%
Distill Time: 1 seconds (00:00:01)
**** End of Job ****
The offending command is in one of the font definitions
snip
%%BeginFont: ArialMT
%!PS-TrueType-0.1--32768.2
8 dict begin
/FontName /ArialMT def
/FontMatrix [1 0 0 1 0 0] def
/FontType 42 def
/Encoding StandardEncoding def
/FontBBox [-455 -431 2048 1869] def
/PaintType 0 def
/FontInfo 7 dict dup begin
/Notice (Typeface =A9 The Monotype Corporation plc. Data =A9 The =
Monotype =20
Corporation plc/Type Solutions Inc. 1990-1992. All Rights Reserved) def
/FamilyName (Arial) def
/FullName (Arial) def
/version (Version 2.60) def
/isFixedPitch false def
/UnderlinePosition -217 def
/UnderlineThickness 150 def
end readonly def
/sfnts [
00>
] def
/CharStrings 242 dict dup begin
end snip=
From: Smith, F. <F....@te...> - 2005年09月02日 14:05:08
Thanks John. This is an interesting application and sheds light in a
number of ways. Not quite what I'm looking for in terms of plot shape
but certainly addresses many of the issues with the asynchronous nature
of the incoming data. Thanks again for your fast response (and for
matplotlib in general).=20
Frank
-----Original Message-----
From: John Hunter [mailto:jdh...@ac...]=20
Sent: Wednesday, August 31, 2005 3:08 PM
To: Smith, Frank
Cc: mat...@li...
Subject: Re: [Matplotlib-users] Plotting Release on change data
>>>>> "Frank" =3D=3D Smith, Frank <F....@te...> writes:
 Frank> Hello Matplotlib users, I only just discovered Matplotlib
 Frank> and I'm having great fun with it. Wonderful package. Thank
 Frank> you to all contributors and maintainers.
 Frank> I have an application where the data that I want to plot is
 Frank> only released when it changes. So when this time tagged
 Frank> data is plotted it should be "flat" until the next data
 Frank> value that the application receives at which point the line
 Frank> should go instantaneously vertical to the new y-value, and
 Frank> then go horizontal until it changes again. Some graphics
 Frank> packages that I've used can handle this type of data
 Frank> automatically. I haven't found anything in the
 Frank> documentation or examples that shows this kind of feature
 Frank> in Matplotlib. Has anyone implemented a similar type of
 Frank> data handling application or is there something I've missed
 Frank> in Matplotlib? Any help or direction to this newbie would
 Frank> be very appreciated.
Here is an example that does something close to what you are trying to
do. It takes advantage of the new animation drawing techniques
described at http://www.scipy.org/wikis/topical_software/Animations
and requires matplotlib CVS. These techniques work with GTKAgg, WXAgg
and TkAgg.
To do this right, you will probably want to take advantage of your GUI
event handling framework, eg an idle handler or a timer. The example
below uses the gtk idle handler, but this approach should work fine with
other toolkits.
There are some refinements. Eg you could make the redrawing more
efficient potentially by narrowing the bbox you want to redraw in the
call to self.canvas.blit(self.ax.bbox). You could also tweak this to
preserve the old line (eg the 0-10 second data) while you are redrawing
the new line (eg the 10-20 second data) in the way many oscilloscopes
do. =20
But this should get you started. If you refine it or generalize it,
please post the fruits of your labors.
import gobject, gtk
import matplotlib
matplotlib.use('GTKAgg')
import matplotlib.numerix as nx
from matplotlib.lines import Line2D
class Scope:
 def __init__(self, ax, maxt=3D10, dt=3D0.01):
 self.ax =3D ax
 self.canvas =3D ax.figure.canvas
 self.dt =3D dt
 self.maxt =3D maxt
 self.tdata =3D [0]
 self.ydata =3D [0]
 self.line =3D Line2D(self.tdata, self.ydata, animated=3DTrue)
 self.ax.add_line(self.line)
 self.background =3D None
 self.canvas.mpl_connect('draw_event', self.update_background)
 self.ax.set_ylim(-.1, 1.1)
 self.ax.set_xlim(0, self.maxt)
 def update_background(self, event):
 self.background =3D self.canvas.copy_from_bbox(self.ax.bbox)
 =20
 def emitter(self, p=3D0.01):
 'return a random value with probability p, else 0'
 v =3D nx.mlab.rand(1)
 if v>p: return 0.
 else: return nx.mlab.rand(1)
 def update(self, *args):
 if self.background is None: return True
 y =3D self.emitter()
 lastt =3D self.tdata[-1]
 if lastt>self.tdata[0]+self.maxt: # reset the arrays=20
 self.tdata =3D [self.tdata[-1]]
 self.ydata =3D [self.ydata[-1]]
 self.ax.set_xlim(self.tdata[0], self.tdata[0]+self.maxt)
 self.ax.figure.canvas.draw()
 =20
 self.canvas.restore_region(self.background)
 =20
 t =3D self.tdata[-1] + self.dt =20
 self.tdata.append(t)
 self.ydata.append(y)
 self.line.set_data(self.tdata, self.ydata)
 self.ax.draw_artist(self.line)
 self.canvas.blit(self.ax.bbox)
 return True
from pylab import figure, show
fig =3D figure()
ax =3D fig.add_subplot(111)
scope =3D Scope(ax)
gobject.idle_add(scope.update)
show()
From: Martin R. <law...@gm...> - 2005年09月02日 12:19:30
Attachments: LineSelector.py
Hello,
first of all let me say: Matplotlib is really great. I'm used looking at
xplt-graphics and MPL is just beautifull!
For my programs I needed the coordinates of mouseclick and -release point so
I modified the HorizontalSpanSelector. With the class in the attached file
it is possible to use functions needing those coordinates. 
In the example a large number of pionts is added to the plot so that you can
check out performance improvments when using blitting. This however is only
possible when calling
python LinseSelector.py -dGTKAgg
If using another backend blitting will not be possible right now (I don't
know ehy, I'm not very keen on this "manifold of backends" - I'm happy that
I got this running for GTKAgg and don't know why it is not working for
WXAgg).
If the position of the mousecklick and the actual position should be linked
by a straight line or a box (or none of both) can be set (e.g.
drawstyle='box').
Although this works fine for my belongings I'm still unhappy with two
things:
- All this doesn't look like the normal connect('event',function)-style. It
would be nicer if this LineSelector could also be handled in such a way.
- If one uses this LineSelector the callback-function has to accept exactly
two lenght-2 arays of floats (which means it is prescribed to the user). I'm
not quite sure if this is very practical.
Nice weekend,
Martin
-- 
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++

Showing results of 30

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