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

Showing results of 36569

<< < 1 .. 1460 1461 1462 1463 > >> (Page 1462 of 1463)
From: John H. <jdh...@ac...> - 2003年10月16日 14:57:44
>>>>> "Gary" == Gary Ruben <ga...@em...> writes:
 Gary> Hi, I just wanted to mention that I had a lot of trouble
 Gary> installing Matplotlib on my Windows system. When you know
 Gary> what to do, it's easy. 
Hi Gary, thanks for your detailed note. You are right about "when you
know what to do, it's easy"; I have installed this so many times on
windows that I can do it in my sleep, so it was hard for me to see
where the directions were lacking. Your comments helped, and I have
included them, as well as more detailed help for linux users both on
the "Installing" page and on the "Output formats" page.
Take a look and let me know if you have further suggestions.
Thanks again,
John Hunter
From: Gary R. <ga...@em...> - 2003年10月16日 09:49:18
Hi,
I just wanted to mention that I had a lot of trouble installing Matplotlib on my Windows system. When you know what to do, it's easy. The main problem was that I didn't find the "Windows Users" section on <http://matplotlib.sourceforge.net/backends.html> for a while. This information belongs on the <http://matplotlib.sourceforge.net/installing.html> page.
Also, the advice it gives states that the GTK 2.2.4 Runtime has a "friendly windows installer". This was extremely difficult to find and given the provided link, I had assumed that there was no such installer and tried to install GTK+ manually. Eventually I found the installer here:
<http://prdownloads.sourceforge.net/gtk-win/>
so the current link to <http://www.pcpm.ucl.ac.be/~gustin/win32_ports/> should be changed.
I'd change the wording to a simple step-by-step guide such as:
Install the latest GTK runtime from <http://prdownloads.sourceforge.net/gtk-win/> (currently 2.2.4.1)
Install <http://www.pcpm.ucl.ac.be/~gustin/win32_ports/binaries/pygtk-2.0.0.win32-py2.3.exe>
Install matplotlib
Add the bin and lib subdirs to the PATH
Add GDFONTPATH environment variable
Hope this helps,
Gary
-- 
__________________________________________________________
Sign-up for your own personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers
From: John H. <jdh...@ac...> - 2003年10月09日 12:22:07
>>>>> "Andrew" == Andrew Straw <as...@in...> writes:
 Andrew> While we're pointing to potential backends, may I suggest
 Andrew> (for the distant future) that VTK be used as a backend
 Andrew> once matplotlib goes 3D? I've been using (the Python
 Andrew> bindings for) it for a while now and think it blows
 Andrew> everything else out of the water. A matplotlib bridge to
 Andrew> it would be awesome as a simple interface, and data could
 Andrew> be automatically saved in a .vtk format, making
 Andrew> arbitrarily sophisticated things possible. (Mayavi being a
 Andrew> good intermediate.)
I have worked a lot with VTK and as part of a subdural 3D electrode
localization application (python/pygtk/vtk) I wrote but haven't
released yet (screenshots below).
I was planning on going to VTK for the 3D support in the mythical
matplotlib 1.0. VTK is truly an amazing library -- I was just reading
the textbook again last night (which I recommend if you haven't read
it -- the textbook is better than the user's guide). I think I could
spend a year just trying to get my head fully wrapped around VTK.
The one area of VTK that I haven't been impressed by is the fonts,
which is one reason I didn't go with it when I made my initial choice
of backends. The other reason is that is a big library so I was
hesitant to make it a prerequisite. But now that enthought
distributes python with vtk built-in, and it could be one backend
among the others, it is a great idea. The VTK people would probably
like it too, since it would ease chart/graph production for them. So
much to do!
Electrode localization program
 http://nitace.bsd.uchicago.edu:8080/summer/jdh/loc3djr_shot3.png
High coherences between cortical electrodes
 http://nitace.bsd.uchicago.edu:8080/summer/jdh/coherence.png
Thought you might be interested to see them.
JDH
From: Andrew S. <as...@in...> - 2003年10月09日 02:08:36
> Wow, pyx looks great. I didn't even know it existed; I'm not sure how
While we're pointing to potential backends, may I suggest (for the 
distant future) that VTK be used as a backend once matplotlib goes 3D? 
I've been using (the Python bindings for) it for a while now and think 
it blows everything else out of the water. A matplotlib bridge to it 
would be awesome as a simple interface, and data could be automatically 
saved in a .vtk format, making arbitrarily sophisticated things 
possible. (Mayavi being a good intermediate.)
Cheers!
Andrew
From: Charles R. T. <ct...@ma...> - 2003年10月02日 23:10:56
John,
Looking at pyx was Nathan's main point. He also included a very short
program that showed how to preview PyX output in Python:
import pygtk; pygtk.require("2.0")
import sys
import gtk
import bonobo
import bonobo.ui
 
win = gtk.Window()
win.connect("delete-event", gtk.mainquit)
win.show()
 
container = bonobo.ui.Container()
control = bonobo.ui.Widget("file://home/ctwardy/Library/mcallister.pdf",
 container.corba_objref())
# A control widget is just like any other GtkWidget.
control.show()
win.add(control)
 
gtk.main()
 
}Wow, pyx looks great. I didn't even know it existed; I'm not sure how
I didn't know either.
}
}That said, I don't regret doing it myself since...
Absolutely.
--
Charles R. Twardy, Res.Fellow, Monash University, School of CSSE
ctwardy at alumni indiana edu +61(3) 9905 5823 (w) 5146 (fax)
"Incongruous places often inspire anomalous stories." -- S.J. Gould
From: John H. <jdh...@ac...> - 2003年10月02日 15:05:17
>>>>> "Charles" == Charles R Twardy <ct...@ma...> writes:
 Charles> John, the PS backend is great -- just used it in a paper
 Charles> -- but after Nathan's post I'm wondering about effort
 Charles> duplication. I looked over the examples on the PyX
 Charles> website (pyx.sourceforge.net): they _are_ impressive.
I didn't see any post by Nathan on this subject. But my email has
been a little flaky over the last month -- could you forward it to me?
 Charles> I don't want to offend, but I'm wondering if we could use
 Charles> PyX for the postscript backend, or otherwise merge? Two
 Charles> great tastes and all...
Wow, pyx looks great. I didn't even know it existed; I'm not sure how
I missed it. pyx has an advantage over matplotlib because it is
designed around postscript, which as you know is an extremely powerful
drawing program. It is, however, difficult to implement as an
abstract renderer, eg, to set up an interface that takes advantage of
postscript's power while still being able to render to a GTK drawing
area.
That said, I think your suggestion is a good one, to have a pyx
backend where matplotlib draws to a pyx canvas and then the user can
have access to that canvas to add things like latex markup, fancy
stuff that matplotlib can't do, etc.... I haven't had time to dive
into pyx yet, but it is certainly seems suitable for something like
that. Had I seen pyx before starting on the PS backend, I certainly
would have used it. 
That said, I don't regret doing it myself since 1) it gave me the
chance to learn some postscript and 2) now matplotlib can generate PS
with the only dependence being Numeric. pyx has some C code in it,
which makes it more difficult for win32 users since they have to have
the extension compiled for their particular python version. I wrote
an EEG and CT analysis application which must run on linux and win32
that depends on around 10-15 other packages, and it is a pain to get
all packages for a given version of python. I've spent long hours
trying to compile them myself if a win installer is not available.
But I suspect most people wanting postscript/tex are on a linux/unix
platform.
Thanks for the suggestion,
John Hunter
From: Charles R. T. <ct...@ma...> - 2003年10月02日 04:43:57
On 2003年9月30日, John Hunter wrote:
}done in CVS now and tested with the 3 backends. 
Now _that's_ service! :-) :-) :-)
Sounds like your implemention makes much more sense, as expected.
}Below is your script which works with the CVS version. Do you mind if
}I add it to the examples dir in the matplotlib distro?
I'd be honored!
Waiting for my cvs mirror to catch up....
	-C
--
Charles R. Twardy, Res.Fellow, Monash University, School of CSSE
ctwardy at alumni indiana edu +61(3) 9905 5823 (w) 5146 (fax)
"in much of the rest of the world, rich people live in gated
 communities and drink bottled water." --Jared Diamond
From: Charles R. T. <ct...@ma...> - 2003年10月02日 04:28:26
Andrew,
John's right, you almost certainly want to remove the manual editing step.
Think code. It saves lots of time and is reproducible. Let's see if your
tasks are easily code-able.
John, the PS backend is great -- just used it in a paper -- but after
Nathan's post I'm wondering about effort duplication. I looked over the
examples on the PyX website (pyx.sourceforge.net): they _are_ impressive.
I don't want to offend, but I'm wondering if we could use PyX for the
postscript backend, or otherwise merge? Two great tastes and all...
-Charles
}I am curious what kinds of editing you are doing with your plots.
}The reason I ask is that I wanted to make sure you know that you can
--
Charles R. Twardy, Res.Fellow, Monash University, School of CSSE
ctwardy at alumni indiana edu +61(3) 9905 5823 (w) 5146 (fax)
"in much of the rest of the world, rich people live in gated
 communities and drink bottled water." --Jared Diamond
From: John H. <jdh...@ac...> - 2003年10月01日 15:52:50
>>>>> "Michael" == Michael Thompson <Mic...@s3...> writes:
 Michael> Hi, the following seem to work,
 Michael> arctest.py axes_demo.py stock_demo.py
Thanks for the info. I can't replicate the warnings on my system
because I don't have the older pygtk installed, but if I an find an
appropriate test machine I'll see if I can find the source.
 Michael> The color_demo.py fails to run at all with the end of the
 Michael> error message being.
Oops, this was a bug introduced when I changed the color handling in
the abstract drawing interface. In older versions of matplotlib, rgb
tuples were specified as 0-255 ints, now they are 0-1 floats. It's
now fixed in CVS. Thanks for catching it.
John Hunter
From: Michael T. <Mic...@s3...> - 2003年10月01日 15:25:06
Hi,
	the following seem to work,
arctest.py
axes_demo.py
stock_demo.py
but all generate similar errors along the lines of
michaelt@arne examples>python stock_demo.py 
Xlib: extension "RENDER" missing on display ":0.0".
Warning: text label "0" is outside window extent
Warning: text label "0.6" is outside window extent
Warning: text label "1.2" is outside window extent
Warning: text label "1.8" is outside window extent
Warning: text label "2.4" is outside window extent
Warning: text label "3" is outside window extent
Warning: text label "Days" is outside window extent
Warning: text label "0.79" is outside window extent
Warning: text label "0.86" is outside window extent
Warning: text label "0.93" is outside window extent
Warning: text label "1" is outside window extent
Warning: text label "1.07" is outside window extent
Warning: text label "1.14" is outside window extent
The color_demo.py fails to run at all with the end of the error message
being.
michaelt@arne examples>python color_demo.py 
"/usr/lib/python2.2/site-packages/matplotlib/backends/backend_gtk.py",
line 41, in get_color
 color =
self._cmap.alloc_color(int(r*65025),int(g*65025),int(b*65025))
TypeError: GdkColormap.alloc_color() argument 1 must be string, not int
On Wed, 2003年10月01日 at 14:54, John Hunter wrote:
> >>>>> "Michael" == Michael Thompson <Mic...@s3...> writes:
> Michael> try: import pygtk pygtk.require('2.0') except: pass
> 
> Michael> I'm running redhat 8.0 and have these versions of pygtk
> Michael> installed.
> 
> Michael> [root@arne root]# rpm -qa | grep pygtk pygtk2-1.99.12-7
> Michael> pygtk2-libglade-1.99.12-7
> 
> Thanks for the info. matplotlib officially requires pygtk-1.99.16
> which is where the require('2.0') thing comes from, but this has
> caused a number of redhat users a lot of grief so I need to make the
> changes you suggest to backport to earlier versions. I'm curious to
> know if with these changes all of the demos run on the default RHL8
> install. If you get a chance to run a number of them, let me know and
> I'll update the web page.
> 
> John Hunter
-- 
Michael Thompson
RF IC Design Engineer
Silicon & Software systems
+353 1 291 1710
The information contained in this e-mail and in any attachments is confidential and is designated solely for the attention of the intended recipient(s). If you are not an intended recipient, you must not use, disclose, copy, distribute or retain this e-mail or any part thereof. If you have received this e-mail in error, please notify the sender by return e-mail and delete all copies of this e-mail from your computer system(s).
Please direct any additional queries to: com...@s3....
Thank You.
From: John H. <jdh...@ac...> - 2003年10月01日 14:49:47
>>>>> "Michael" == Michael Thompson <Mic...@s3...> writes:
 Michael> try: import pygtk pygtk.require('2.0') except: pass
 Michael> I'm running redhat 8.0 and have these versions of pygtk
 Michael> installed.
 Michael> [root@arne root]# rpm -qa | grep pygtk pygtk2-1.99.12-7
 Michael> pygtk2-libglade-1.99.12-7
Thanks for the info. matplotlib officially requires pygtk-1.99.16
which is where the require('2.0') thing comes from, but this has
caused a number of redhat users a lot of grief so I need to make the
changes you suggest to backport to earlier versions. I'm curious to
know if with these changes all of the demos run on the default RHL8
install. If you get a chance to run a number of them, let me know and
I'll update the web page.
John Hunter
From: Michael T. <Mic...@s3...> - 2003年10月01日 14:36:15
Hi,
	thanks for that example, I've been using the article from the Linux
journal "A begnners guide to using pyGTK and Glade",
http://www.linuxjournal.com/article.php?sid=6586, although I have been
using python for a while, and I ahd to make a small change to 
/usr/lib/python2.2/site-packages/matplotlib/backends/backend_gtk.py
try:
 import pygtk
 pygtk.require('2.0')
except:
 pass
I'm running redhat 8.0 and have these versions of pygtk installed.
[root@arne root]# rpm -qa | grep pygtk
pygtk2-1.99.12-7
pygtk2-libglade-1.99.12-7
Thanks, Michael
PS log scales by next week sounds great, take me at least that long to
sort out the rest of the stuff I need.
On Wed, 2003年10月01日 at 14:07, John Hunter wrote:
> >>>>> "Michael" == Michael Thompson <Mic...@s3...> writes:
> 
> Michael> Hi, does anyone have an example of how to use matplotlib
> Michael> with glade2?
> 
> See the attached example. I've used matplotlib with glade in my own
> work, but never distilled it down to a simple example, as I just did.
> I'll add them to the examples in the distribution. Note, you must be
> using matplotlib 0.29 for this example to work. You can certainly use
> matplotlib in any version with glade, but this example uses the new
> API, in which GTK is only one of several renderers. If you need to
> use an earlier version of matplotlib, the only change is at the top,
> in the way you import Figure, Subplot, etc...
> 
> Michael> Any idea when log scaling will be supported?
> 
> This is near the top of my todo list. I have been holding off on
> releasing 0.3 until I get this done. So I'll try to get it done by
> next week, time permitting!
> 
> John Hunter
> 
> Glade example:
-- 
Michael Thompson
RF IC Design Engineer
Silicon & Software systems
+353 1 291 1710
The information contained in this e-mail and in any attachments is confidential and is designated solely for the attention of the intended recipient(s). If you are not an intended recipient, you must not use, disclose, copy, distribute or retain this e-mail or any part thereof. If you have received this e-mail in error, please notify the sender by return e-mail and delete all copies of this e-mail from your computer system(s).
Please direct any additional queries to: com...@s3....
Thank You.
From: Michael T. <Mic...@s3...> - 2003年10月01日 13:20:43
Hi,
	does anyone have an example of how to use matplotlib with glade2?
Any idea when log scaling will be supported?
Thanks, Michael
The information contained in this e-mail and in any attachments is confidential and is designated solely for the attention of the intended recipient(s). If you are not an intended recipient, you must not use, disclose, copy, distribute or retain this e-mail or any part thereof. If you have received this e-mail in error, please notify the sender by return e-mail and delete all copies of this e-mail from your computer system(s).
Please direct any additional queries to: com...@s3....
Thank You.
From: John H. <jdh...@ac...> - 2003年10月01日 12:48:09
>>>>> "Andrew" == Andrew Straw <as...@in...> writes:
 Andrew> Basically, there are two select modes in Illustrator. The
 Andrew> first, "Selection tool", selects a whole group of paths.
 Andrew> The second, the "Direct selection tool" selects the path
 Andrew> segment or otherwise smallest path portion possible.
Hi Andrew -- thanks for the detailed information vis-a-vis
Illustrator. Things are clearer to me now, but it looks like I need
to get my hands on Illustrator and play with a few plots to get a
better feel for it. 
I am curious what kinds of editing you are doing with your plots.
The reason I ask is that I wanted to make sure you know that you can
control a lot from within matplotlib using the return values of the
functions. These return the text, line, and patch objects, and you
can use any method in their API to control them, including position,
size, linewidth, colors, symbols, etc. Ditto for the axes -- their
position, line styles, and colors can all be controlled with the
matplotlib API
 symbols, lines = errorbar(t, s, e, fmt='o')
 set(lines, 'linewidth', 3)
 set(symbols, 'markerfacecolor', 'g')
 set(symbols, 'markeredgecolor', 'r')
 set(symbols, 'markersize', 10)
If you want to have all the error bars in the axes, you can change the
ylimits of the axes with 
 set(gca(), 'ylim', [-1,10])
Likewise, you can control the location and properties of the
tickmarks, ticklabels, etc...
Not that this obviates the need to make a sane PS renderer, but I just
wanted to make sure you were aware of the possibility. I generally
try to do everything in code and minimize the amount of manual editing
because invariably I have to regenerate the figure with new data or
new stats and then I have to redo everything manually again.
So if you tell me the kinds of things you're trying to do, perhaps I
can point you to existing features that provide this, or include some
of them in the matplotlib API. This would also give me a better idea
of how to think about redesigning the PS engine to make it more
palatable to PS editors.
 Andrew> Yes, I just wonder about the explicit-ness of a decision
 Andrew> about whether it's matplotlib or PS that does clipping. I
 Andrew> don't know enough to feel strongly, but if file-size is a
 Andrew> factor, it should presumably be done by matplotlib. On
 Andrew> the other hand, I think optimizations (even for file size)
 Andrew> should happen later and for now maybe rendering everything
 Andrew> to PS and letting it handle clipping is best. On the
 Andrew> third(!) hand, huge files are clearly undesirable and
 Andrew> perhaps the best plan is what seems to already be done --
 Andrew> any primitives totally outside the clipping area aren't
 Andrew> drawn, but otherwise, they are drawn with PS itself doing
 Andrew> the clipping. This point is just food for thought.
This is generally the approach I take. lines handle clipping
themselves. This lets me plot really long signals (5 minutes of EEG)
with only 10 second windows on the screen at the time -- a matplotlib
clip. In addition, I rely on the graphics context clip (GTK / PS) to
handle the little things like circle markers extending outside the
axes lines, the top of a curve that extends past the top of the axes,
etc.... You can read the gory details in the _set_clip function in
the lines module, when you need a distraction from your thesis.
Without too much work, I can probably make a "no clip" an option of
the figure or axes if this would be useful.
 Andrew> No real problem, I'm just (mildly) against idea of
 Andrew> invisible primitives in PS files. (This probably stems
 Andrew> from me dealing with PS output from matlab5 many years ago
 Andrew> when I remember sorting through layer after layer after
 Andrew> layer of "strangely behaved rectangles" just to manipulate
 Andrew> my data. It's quite funny to me that matplotlib produces
 Andrew> the most matlab-like PS files I've seen in a while! 
Oh, now that was a low blow -- matlab5! And just what kind of
manipulation of your data are you doing -- you're not trying to cheat
on those error bars are you <wink>?
John Hunter
From: Andrew S. <as...@in...> - 2003年10月01日 05:59:12
John Hunter wrote:
> Andrew> I just tried a few things with the axes_demo and the
> Andrew> errorbar_demo in the examples directory. I liked that the
> Andrew> points grouped together. I didn't like that in the
> Andrew> errorbar_demo that the points and the errorbars grouped
> Andrew> together almost inseparably.
> 
> What do you mean by "grouped together". I assume this has something
> to do with editing in Illustrator, but can you explain in more detail?
Basically, there are two select modes in Illustrator. The first, 
"Selection tool", selects a whole group of paths. The second, the 
"Direct selection tool" selects the path segment or otherwise smallest 
path portion possible.
Let's take the example of 5 circles which have been drawn and then 
grouped in Illustrator. Clicking on one with the selection tool will 
select all of them, because they are all grouped. Clicking one with the 
direct select tool will only get one (or actually probably only a single 
path component between anchor points or the anchor point itself if it 
was clicked).
There is some way Illustrator extracts this information from all 
PostScript files, but it probably just makes intelligent guesses when 
it's dealing with "foreign" PS. (I think it must embed 
Illustrator-specific comments or other directives when it saves an 
"Illustrator .eps".)
> Learning (a little bit of) postscript has been a mind opening
> experience. I know a lot of programming languages, and postscript
> introduced me to several new ideas. It is difficult to take a
> (somewhat) state independent OO representation of a graphical object
> and translate it into the postscript state machine efficiently,
> especially, when the postscript backend has to act like the other
> backends at the interface level. 
(Sounds like OpenGL!) I know less about PS than you, but it seems one 
way to go about doing what you describe is to build a virtual PS engine 
and render to it, and have it spit out only the state-changing 
instructions it received.
 > A smart postscript backend keep track of this information so it wouldn't
> needlessly regenerate the information leading to file bloat. I would
> like to make these improvements, but my first goal was to get
> something that works
Always a good first step! :) Seriously, I realized that things were 
probably not very baroque yet, so I thought I'd pipe up to let you know 
about what is, IMHO, an important feature of good PS rendering.
> Andrew> With the demos tested, the primary curve or points grouped
> Andrew> with a rectangle around the plotting region that had no
> Andrew> fill or stroke but seemed to clip the contents to within
> Andrew> that box. I wonder if it would be nicer to produce
> Andrew> postscript output where the clipping is done before
> Andrew> rendering to a file, thus eliminating the need for this
> Andrew> rather strangely behaved box?
> 
> Could you also give me some detail here? Is the "box" the rectangular
> border of the axes? 
Yes.
> With regards to a specific demo, what is "the
> primary curve" and "rectangle"?
The "primary curve" consists of the main data points, either plotted as 
points/circles (in the case of the errorbar demo) or as line segments 
(in the axes_demo). "box" == "rectangle".
> I do use postscript clipping of lines and other objects etc so that
> they do not extend beyond the axes borders.
Yes, I see what you mean -- with this clipping box, the leftmost circle 
in the errorbars demo does not extend beyond the axes, and is therefore 
half cut-off. I'm not sure if this is desirable or not, but at least 
with the current behavior I could just go in and remove the clipping 
box. FYI, the circles, the errorbars (vertical lines), the "caps" on 
the bars, and the clipping rectangle all group together in Illustrator.
There is something that seems inconsistent to me with the current 
behavior -- the lower error "caps" that are completely beyond the 
clipping rectangle aren't present in the PS file at all. However, the 
errorbar does extend below the clipping rectangle to the position where 
the cap would be. Would things be more consistent if, when a clipping 
rectangle is used to do the clipping, all primitives get rendered and 
only the clipping rectangle handles clipping?
> Generally, I think this
> is *a good thing*. The general organization of matplotlib is figures
> contain axes which contain lines, patches and text. Normally, I don't
> want lines, patches and text spilling out of their axes containers.
Yes, I just wonder about the explicit-ness of a decision about whether 
it's matplotlib or PS that does clipping. I don't know enough to feel 
strongly, but if file-size is a factor, it should presumably be done by 
matplotlib. On the other hand, I think optimizations (even for file 
size) should happen later and for now maybe rendering everything to PS 
and letting it handle clipping is best. On the third(!) hand, huge files 
are clearly undesirable and perhaps the best plan is what seems to 
already be done -- any primitives totally outside the clipping area 
aren't drawn, but otherwise, they are drawn with PS itself doing the 
clipping. This point is just food for thought.
> Can you explain a little more what you are trying to achieve in
> Illustrator so I can get a better idea of what is missing? What
> exactly is the 'strangely behaved box'?
"strangely behaved" == if you remove one corner from a clipping 
rectangle, it then becomes a clipping triangle that leaves half of your 
plot normal and the other half disappears. This happens up to some 
distance away from the corner you just deleted. That's why I call it 
strangely behaved, but I think I do understand it.
> Andrew> Also, the generated plots have some two boxes, one with a
> Andrew> white stroke and one with a white fill, surrounding the
> Andrew> figure. These, too, seem unnecessary.
> 
> Yes, this is a holdover from the GUI. In a GUI presentation, the
> plots look nicer with a boundary -- see eg,
> http://matplotlib.sourceforge.net/screenshots/subplot_demo_large.png
> where the gray border is the default figure background -- matlab does
> this. So the figure (which contains the axes) renders a rectangular
> border with a fill color. For the postscript backend, I simply made
> these white and when I print on white paper, I never see them. They
> can easily be done away with by commenting out the line
> 
> self._figurePatch.draw(drawable)
> 
> in backends/backend_ps.py. I don't really have a problem removing it
> entirely as I don't see much need for it in the PS backend, unless
> someone wants to frame their plots with background rectangle. I
> mainly left it in their for vestigial compatibility with the other
> backends. But, so I can get a better understanding of the twisted
> mind of Illustrator, could you explain to me what kind of problem this
> is causing you?
No real problem, I'm just (mildly) against idea of invisible primitives 
in PS files. (This probably stems from me dealing with PS output from 
matlab5 many years ago when I remember sorting through layer after layer 
after layer of "strangely behaved rectangles" just to manipulate my 
data. It's quite funny to me that matplotlib produces the most 
matlab-like PS files I've seen in a while! Still nowhere near the 
number of layers, though!)
Anyhow, I'd love to dive into the code and help you with the 
PS/Illustrator improvements, but I have no time at the moment...
Cheers!
Andrew
From: John H. <jdh...@ac...> - 2003年10月01日 03:48:32
>>>>> "Andrew" == Andrew Straw <as...@in...> writes:
 Andrew> Hi John et al., I just had a chance to play with
 Andrew> matplotlib for a few minutes, and I'm very encouraged!
Glad to hear it .... keep me informed of bugs and feature requests.
 Andrew> A feature request: I frequently use Adobe Illustrator to
 Andrew> touch up postscript files that contain my figures. In this
 Andrew> case, it is REALLY handy when the postscript files group
 Andrew> nicely. Knowing little-to-nothing about PostScript and
 Andrew> Illustrator, I have no idea how hard the behavior is to
 Andrew> implement, but it would be fantastic if it did.
I know nothing about Illustrator, and have been learning postscript as
I go, so bear with me.
 Andrew> I just tried a few things with the axes_demo and the
 Andrew> errorbar_demo in the examples directory. I liked that the
 Andrew> points grouped together. I didn't like that in the
 Andrew> errorbar_demo that the points and the errorbars grouped
 Andrew> together almost inseparably.
What do you mean by "grouped together". I assume this has something
to do with editing in Illustrator, but can you explain in more detail?
Learning (a little bit of) postscript has been a mind opening
experience. I know a lot of programming languages, and postscript
introduced me to several new ideas. It is difficult to take a
(somewhat) state independent OO representation of a graphical object
and translate it into the postscript state machine efficiently,
especially, when the postscript backend has to act like the other
backends at the interface level. 
Simple example: suppose you want to draw all the axis tick labels,
each of which has the same font information. The abstract interface
makes a separate call for each label, which causes the postscript
backend to generate the same font information over and over again. A
smart postscript backend keep track of this information so it wouldn't
needlessly regenerate the information leading to file bloat. I would
like to make these improvements, but my first goal was to get
something that works.
Most of the improvements I've envisioned for the PS backend have been
in the realm of file size efficiency (I've seen some damn large PS
files in my day). So I'm interested to get your feedback about these
other areas that I don't yet understand.
 Andrew> With the demos tested, the primary curve or points grouped
 Andrew> with a rectangle around the plotting region that had no
 Andrew> fill or stroke but seemed to clip the contents to within
 Andrew> that box. I wonder if it would be nicer to produce
 Andrew> postscript output where the clipping is done before
 Andrew> rendering to a file, thus eliminating the need for this
 Andrew> rather strangely behaved box?
Could you also give me some detail here? Is the "box" the rectangular
border of the axes? With regards to a specific demo, what is "the
primary curve" and "rectangle"?
I do use postscript clipping of lines and other objects etc so that
they do not extend beyond the axes borders. Generally, I think this
is *a good thing*. The general organization of matplotlib is figures
contain axes which contain lines, patches and text. Normally, I don't
want lines, patches and text spilling out of their axes containers.
Can you explain a little more what you are trying to achieve in
Illustrator so I can get a better idea of what is missing? What
exactly is the 'strangely behaved box'?
 Andrew> Also, the generated plots have some two boxes, one with a
 Andrew> white stroke and one with a white fill, surrounding the
 Andrew> figure. These, too, seem unnecessary.
Yes, this is a holdover from the GUI. In a GUI presentation, the
plots look nicer with a boundary -- see eg,
http://matplotlib.sourceforge.net/screenshots/subplot_demo_large.png
where the gray border is the default figure background -- matlab does
this. So the figure (which contains the axes) renders a rectangular
border with a fill color. For the postscript backend, I simply made
these white and when I print on white paper, I never see them. They
can easily be done away with by commenting out the line
 self._figurePatch.draw(drawable)
in backends/backend_ps.py. I don't really have a problem removing it
entirely as I don't see much need for it in the PS backend, unless
someone wants to frame their plots with background rectangle. I
mainly left it in their for vestigial compatibility with the other
backends. But, so I can get a better understanding of the twisted
mind of Illustrator, could you explain to me what kind of problem this
is causing you?
JDH
From: Andrew S. <as...@in...> - 2003年10月01日 01:12:34
Hi John et al.,
I just had a chance to play with matplotlib for a few minutes, and I'm 
very encouraged!
A feature request: I frequently use Adobe Illustrator to touch up 
postscript files that contain my figures. In this case, it is REALLY 
handy when the postscript files group nicely. Knowing little-to-nothing 
about PostScript and Illustrator, I have no idea how hard the behavior 
is to implement, but it would be fantastic if it did.
I just tried a few things with the axes_demo and the errorbar_demo in 
the examples directory. I liked that the points grouped together. I 
didn't like that in the errorbar_demo that the points and the errorbars 
grouped together almost inseparably.
With the demos tested, the primary curve or points grouped with a 
rectangle around the plotting region that had no fill or stroke but 
seemed to clip the contents to within that box. I wonder if it would be 
nicer to produce postscript output where the clipping is done before 
rendering to a file, thus eliminating the need for this rather strangely 
behaved box?
Also, the generated plots have some two boxes, one with a white stroke 
and one with a white fill, surrounding the figure. These, too, seem 
unnecessary.
Cheers!
Andrew
From: John H. <jdh...@ac...> - 2003年09月30日 16:34:18
>>>>> "Charles" == Charles Twardy <ct...@ma...> writes:
 Charles> I couldn't see any way to do legends, so I hacked
 Charles> together a routine that worked for me. However, I don't
 Charles> know how to handle fonts properly (ie, find out how much
 Charles> plotting space they really take up), so someone might
 Charles> want to fix the two lines marked "#Hack" and maybe the
 Charles> related row spacing.
Thanks for the script. I've been meaning to add legends for some time
and you gave me the push I needed. To do it right (account for font
size) is a little more difficult so I've been putting it off, but it's
done in CVS now and tested with the 3 backends. 
I added the legend functionality to the Axes class, which has the
advantage that you don't need to specify the line styles, colors
etc... since the axes contains the lines and can get them from there.
Also, I decided not to go with a whole new legend axes, but rather
added a legend patch, legend lines and legend text to the current
axis. Changes to axes lines with handle graphics or Line2D API calls
are reflected in the legend text.
Below is your script which works with the CVS version. Do you mind if
I add it to the examples dir in the matplotlib distro?
JDH
# Thanks to Charles Twardy
from matplotlib.matlab import *
a = arange(0,3,.02)
b = arange(0,3,.02)
c=exp(a)
d=c.tolist()
d.reverse()
d = array(d)
ax = subplot(111)
plot(a,c,'k--',a,d,'k:',a,c+d,'k')
legend(('Model length', 'Data length', 'Total message length'), 'upper right')
ax.set_ylim([-1,20])
ax.grid(0)
xlabel('Model complexity --->')
ylabel('Message length --->')
title('Minimum Message Length')
set(gca(), 'yticklabels', [])
set(gca(), 'xticklabels', [])
savefig('mml')
show()
From: John H. <jdh...@ac...> - 2003年09月30日 12:21:03
>>>>> "Flavio" == Flavio Coelho <fcc...@ci...> writes:
 Flavio> Hi, does anyone know why matplotlib crashes wxbased apps?
 Flavio> (Pycrust for instance?) is there any way around this?
I have never used matplotlib with wx but I suspect the problem is that
by default matplotlib enters the gtk mainloop, which is not compatible
with other GUIs that do the same. Generally, one has to hack a shell
to use matplotlib interactively -- you can read about two such shells
on http://matplotlib.sourceforge.net/interactive.html. I suspect the
same can be done for pycrust, but I haven't any experience with it.
The best thing to do would be to port to a matplotlib backend to wx
and use it natively. That's what I really want to do, because wx
comes with enthought python, which will make it easy for win32 users
to use.
John Hunter
From: Flavio C. <fcc...@ci...> - 2003年09月30日 00:24:50
Hi,
 does anyone know why matplotlib crashes wxbased apps? (Pycrust for
instance?)
is there any way around this?
thanks,
Fl=E1vio
From: Charles T. <ct...@ma...> - 2003年09月29日 23:44:36
Attachments: legendplot.py
I couldn't see any way to do legends, so I hacked together a routine that
worked for me. However, I don't know how to handle fonts properly (ie, find
out how much plotting space they really take up), so someone might want to
fix the two lines marked "#Hack" and maybe the related row spacing.
Here's a simple demo that includes the legend() function. 
Attached, I hope.
-C
-- 
Charles R. Twardy Monash University, School of CSSE
ctwardy at alumni indiana edu +61(3) 9905 5823 (w) 5146 (fax)
 ~^~
 "eloquence ought to be banish'd out of all civil Societies as a
 thing fatal to Peace and good Manners..." ~Sprat 1667
From: Nathan H. <nj...@ha...> - 2003年09月26日 06:31:33
I ran across PyX (http://pyx.sourceforge.net/) yesterday. It handles
eps and postscript beautifully! Combine with this snippet of code:
 import pygtk; pygtk.require("2.0")
 import sys
 import gtk
 import bonobo
 import bonobo.ui
 win = gtk.Window()
 win.connect("delete-event", gtk.mainquit)
 win.show()
 container = bonobo.ui.Container()
 control = bonobo.ui.Widget("file://home2/njh/numpy.pdf",
 container.corba_objref())
 # A control widget is just like any other GtkWidget.
 control.show()
 win.add(control)
 gtk.main()
And you have a simple plotting system with wysiwyg. Should Matplotlib
move towards using PyX?
-- 
njh
http://www.csse.monash.edu.au/~njh/
From: K.KISHIMOTO <ko...@us...> - 2003年09月25日 06:36:42
Hi,
I'm glad to find this project and planning to use this wonderful 
matplotlib package in my project "PAIDA".
I think the log scaling capability is relatively important in 
scientific analysis but the matplotlib does not support currently.
While I know this capability will be supported in next release, would 
you tell me if it will be 0.3 release or more later?
K. KISHIMOTO
From: John H. <jdh...@ac...> - 2003年09月22日 16:01:55
Over the last few weeks I've made a lot of changes to matplotlib,
particularly to allow rendering to multiple output formats, and thus
break the dependence on GTK/pygtk. The new output formats are
postscript and GD module. The latter allows you to use matplotlib in
an environment where there is no window server running, such as for a
web application server creating dynamic charts. You can choose the
backend from the command line, so the same script can be used without
changes to create either a GUI window or postscript output.
The latest release of matplotlib, 0.29, incorporates these changes,
and fixes some other bugs, some important (like marker and figure text
scaling with figure resolution).
I've uploaded this release to the sourceforge site, and added some new
documentation describing them and how to use them
 What's new : http://matplotlib.sourceforge.net/whats_new.html
 Backends : http://matplotlib.sourceforge.net/backends.html
 Fonts : http://matplotlib.sourceforge.net/fonts.html
I would like to add a few more features before I make the 0.3 release,
and am hoping some of you will try the new version and report any
problems you may have before I do 0.3 and make a wider announcement
the python and scipy communities.
Note that the figure and savefig commands no longer takes a figure
size in pixels, but rather a figure size as a width, height tuple in
inches and a DPI (figure) or simply DPI (savefig). See the help for
those functions for more info.
Thanks! Let me know how it goes,
John Hunter
From: John H. <jdh...@ac...> - 2003年09月13日 14:59:53
>>>>> "Charles" == Charles R Twardy <ct...@ma...> writes:
 Charles> How hard would it be to add pie charts? Or have I missed
 Charles> them?? How would one do this? Patches? Or: how many
 Charles> coffees to sponsor it?
I've been thinking about adding pie charts. I never use them in my
own research, but I know the rest of the world, particularly the
business world, does. A "wedge" patch would be the appropriate
primitive, combined with a pie chart function that drew the wedges in
the right place. I have never used a pie chart in matlab -- I'm
curious to know what kind of patch primitive they use.
However, there is no existing patch class is particularly suited for
drawing a wedge, but it would be easy to implement using the drawable
draw_arc method combined with a fill; basically just follow the lead
of draw circle and change the angles of the arc. If you want to take
a stab at it, that would be great!
BTW, as I've alluded to in previous posts, I have reworked the backend
considerably, and can now make plots with GTK, PS and GD module. I'll
update CVS monday morning. This doesn't much affect the patch
classes, because the patch is an abstraction which calls the renderer
primitives eg, draw_arc, draw_rectangle, and all the backends support
these calls.
In any case, I'll get around to adding it myself if you don't want to
take it on (and will hold you to those coffees next time I'm down
under!), but I have a few other feature request and bug fixes in the
que to tackle first.
JDH
657 messages has been excluded from this view by a project administrator.

Showing results of 36569

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