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

Showing results of 53

<< < 1 2 3 (Page 3 of 3)
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
3 messages has been excluded from this view by a project administrator.

Showing results of 53

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