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

Showing results of 284

<< < 1 .. 8 9 10 11 12 > >> (Page 10 of 12)
From: Werner F. B. <wer...@fr...> - 2005年04月09日 13:03:38
The part about the sub-title got over looked, so I'll post again - 
anyhow it was bad from me to stick two things into one message - sorry!
Is it possible to have sub-title lines, I saw that I can pass newline 
with title string but this uses the same font attributes, I would like a 
slightly smaller font and non bold etc for the second title line.
Thanks for any hints.
Werner
From: Werner F. B. <wer...@fr...> - 2005年04月09日 12:54:56
Hi John and Chris,
John Hunter wrote:
>>>>>>"Chris" == Chris Barker <Chr...@no...> writes:
> 
> 
> Chris> By the way, I'm on a quest to make the OO interface to
> Chris> matplotlib fully functional and convenient. If you want to
> Chris> work on it, John would probably except a patch to make a
> Chris> figure.legend() method.
> 
> pylab.figlegend is a thin wrapper to matplotlib.Figure.legend; see
> http://matplotlib.sf.net/matplotlib.figure.html#Figure-legend
Got it, also don't understand why I could not get this to work yesterday 
- probably had crossed eyes.
Thanks and best regards
Werner
> 
> <wink>
> 
> JDH
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
From: John H. <jdh...@ac...> - 2005年04月09日 11:59:31
>>>>> "Brian" == Brian B <b-m...@bb...> writes:
 Brian> Hello, I have generated an image with savefig(...,
 Brian> dpi=100). I do not use a main title for the graph (not the
 Brian> same as the X- and Y- axis labels). When I display the
 Brian> image on an HTML page, there is a space of approximately 60
 Brian> pixels above the image that contain no graph drawing, I
 Brian> assume this space was reserved for a title that I have no
 Brian> need for. The white space of 60 pixels on top creates too
 Brian> much gap between the image and another HTML page element
 Brian> above.
Hi Brian,
The Axes is the white space that contains the lines, rectangles, text
etc. The Figure is the whole canvas that contains the Axes. The
default Axes is created by Subplot(111) which leaves empty space at
the left, bottom, top, right and bottom. You can create your own Axes
dimensions. with the "axes" command
 http://matplotlib.sf.net/matplotlib.pylab.html#-axes
Eg, to leave no room at right or top, use
 ax = axes([0.1, 0.1, 0.9, 0.9])
The arguments to the axes function are left, bottom, width and height,
expressed as fractions of the figure width and height. 0,0 is bottom,
left and 1,1 is top, right. So the lower left corner of this axes is
0.1, 0.1 and the upper right is 0.1+0.9, 0.1+0.9 or 1,1 which is the
upper right of the figure (no white space). 
You may also want to customize the background color of the Axes and
Figure to be the same -- see help for axes, figure and savefig (hint,
although the figure has a background color, savefig overrides it
because sometimes you want a different figure background when working
interactively and saving).
See also examples/axes_demo.py.
JDH
From: Brian B. <b-m...@bb...> - 2005年04月09日 06:06:34
Hello,
I have generated an image with savefig(..., dpi=100). I do not use a main title
for the graph (not the same as the X- and Y- axis labels). When I display the
image on an HTML page, there is a space of approximately 60 pixels above the
image that contain no graph drawing, I assume this space was reserved for a
title that I have no need for. The white space of 60 pixels on top creates too
much gap between the image and another HTML page element above.
I'm generating the figure dynamically so I can't manually crop out the
white space above the top graph border.
Is there any way to reduce whitespace above the graph to be reasonably
trimmed down when not using a graph title?
Thanks!
Brian
From: John H. <jdh...@ac...> - 2005年04月08日 19:03:28
>>>>> "Rick" == Rick Muller <rm...@sa...> writes:
 Rick> I find the following definitions really useful: def
 Rick> xmin(val): a = axis() a[0]=val axis(a) return
 Rick> def xmax(val): a = axis() a[1]=val axis(a) return
 Rick> def ymin(val): a = axis() a[2]=val axis(a) return
 Rick> def ymax(val): a = axis() a[3]=val axis(a) return
I'm not real keen on adding four new names to the pylab interface for
such a small convenience. This has nothing to do with matlab
compatibility, but just to try and limit the number of different
functions that mostly do the same thing. Already we have axis, xlim,
ylim, and ax.set_xlim, etc. Adding more different functions to set
the limits is a recipe for complexity and confusion.
I think there is a solution for you though by extending the functions
already in place, which would entail just a little more typing. One
possibility would be to allow kwargs to axis or xlim/ylim, so that you
could do
 axis(xmin=2)
and it would just update the xmin while keeping all other args the
same.
Alternatively, that interface could be expose in xlim/ylim
 xlim(xmin=2)
What do you think?
JDH
From: Rick M. <rm...@sa...> - 2005年04月08日 18:52:35
I find the following definitions really useful:
def xmin(val):
 a = axis()
 a[0]=val
 axis(a)
 return
def xmax(val):
 a = axis()
 a[1]=val
 axis(a)
 return
def ymin(val):
 a = axis()
 a[2]=val
 axis(a)
 return
def ymax(val):
 a = axis()
 a[3]=val
 axis(a)
 return
I realize that part of the reason behind the pylab api is to mimic what 
is in matlab. But is there any reason why functions such as these 
couldn't be added?
Rick Muller - rm...@sa... - http://www.cs.sandia.gov/~rmuller
Computational Materials and Molecular Biology
Sandia National Laboratories
PO Box 5800, M/S 1110
Albuquerque, NM 87185-1110
From: John H. <jdh...@ac...> - 2005年04月08日 18:17:04
>>>>> "Chris" == Chris Barker <Chr...@no...> writes:
 Chris> By the way, I'm on a quest to make the OO interface to
 Chris> matplotlib fully functional and convenient. If you want to
 Chris> work on it, John would probably except a patch to make a
 Chris> figure.legend() method.
pylab.figlegend is a thin wrapper to matplotlib.Figure.legend; see
http://matplotlib.sf.net/matplotlib.figure.html#Figure-legend
<wink>
JDH
From: Chris B. <Chr...@no...> - 2005年04月08日 17:47:56
Werner F. Bruhin wrote:
> However I can't get this to work within the wxcursor_demo.py, is 
> figlegend only available with "from pylab import *"?
I'm not sure about that one, but there are a number of convenience 
functions that are only in pylab. If so, you have two choices:
1) Use:
import pylab
pylab.figlegend(...)
2) you can look at the code in pylab.figlegend, and see what it does, 
and make your own version.
By the way, I'm on a quest to make the OO interface to matplotlib fully 
functional and convenient. If you want to work on it, John would 
probably except a patch to make a figure.legend() method.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Werner F. B. <wer...@fr...> - 2005年04月08日 17:23:57
Hi,
I am just getting my feet wet with matplotlib.
I like plots with the legend outside the plotting area. I found the 
demo which uses figlegend (thanks Andrea), this fits the bill - at least 
I think so.
However I can't get this to work within the wxcursor_demo.py, is 
figlegend only available with "from pylab import *"?
The other question is can I have sub-title lines, I saw that I can pass 
newline with title string but this uses the same font attributes, I 
would like a slightly smaller font and non bold etc for the second title 
line.
Looked through the archive on gmane, but couldn't find anything.
Appreciate any pointers on this.
See you
Werner
From: John H. <jdh...@ac...> - 2005年04月08日 16:05:13
>>>>> "kristen" == kristen kaasbjerg <co...@ya...> writes:
 kristen> Hello John I was wondering how to change the size of a
 kristen> point marker in legend. I only plot single points like:
 kristen> h1 = plot([1],[2],'ro') h2 = plot([3],[4],'go')
 kristen> legend((h1,h2),('1','2'), numpoints = 1)
 kristen> but the marker 'o' comes out quite small in the legend.
 kristen> Is there an easy way to enlarge it ??
See help(legend), specifically the markerscale kwarg
 markerscale = 0.6 # the relative size of legend markers vs. original
 kristen> By the way, why aren't things like fontsize,
 kristen> Frame=True/False etc legend kwargs ?? It would be much
 kristen> easier to change them this way compared to what you have
 kristen> shown in legend_demo.py. But, I guess there is a sensible
 kristen> reason for this.
You can pass in a kwarg 
 
 prop = FontProperties(size='smaller') # the font properties
to control the font property. See
http://matplotlib.sf.net/matplotlib.font_manager.html#FontProperties
for more information
As a general answer to your question, there are simply too many things
to customize to make them all kwargs. We would have to add all the
properties of the frame, all the properties of the markers, all the
properties of the text, and these would be ambiguous since they all
derive from the base Artist class and hence properties like "visible"
which apply to all artists would be ambiguous. matplotlib Artists
have a lot of configurable properties (eg for the frame alone)
In [5]: frame = leg.get_frame()
 
In [6]: get(frame)
 alpha = 1.0
 antialiased or aa = True
 clip_on = False
 edgecolor or ec = k
 facecolor or fc = w
 figure = <matplotlib.figure.Figure instance at 0x41a9ecac>
 fill = 1
 height = 0.0123998966675
 label =
 linewidth or lw = 1.0
 transform = <Affine object at 0x84b7cec>
 verts = ((0.89123573200992556, 0.96760010333247226), (0.89123573200992556, 0.97999999999999998), (0.97999999999999998, 0.97999999999999998), (0.97999999999999998, 0.96760010333247226))
 visible = True
 width = 0.0887642679901
 window_extent = <Bbox object at 0x84316ec>
 x = 0.89123573201
 y = 0.967600103332
 zorder = 1
and it would be tedious and difficult to maintain to expose all of
these in the kwarg interface.
JDH
From: kristen k. <co...@ya...> - 2005年04月08日 15:51:59
Hello John
I was wondering how to change the size of a point
marker in legend.
I only plot single points like:
h1 = plot([1],[2],'ro')
h2 = plot([3],[4],'go')
legend((h1,h2),('1','2'), numpoints = 1)
but the marker 'o' comes out quite small in the
legend.
Is there an easy way to enlarge it ??
By the way, why aren't things like fontsize,
Frame=True/False etc legend kwargs ?? It would be much
easier to change them this way compared to what you
have shown in legend_demo.py. But, I guess there is a
sensible reason for this.
Cheers
Kristen
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Personals - Better first dates. More second dates. 
http://personals.yahoo.com
From: John H. <jdh...@ac...> - 2005年04月08日 14:58:09
>>>>> "Travis" == Travis Brady <td...@fa...> writes:
 Travis> Hi John, I've finally gotten to the point where I'm making
 Travis> really nice plots on the fly in a bit of code I wrote that
 Travis> I call from within the analysis part of my code and I must
 Travis> say, Matplotlib rules.
Great -- glad it's starting to work for you.
In the future, could you post to the list instead of me directly.
That way the responses show up in the archives, and others can provide
help as well
 Travis> But there are a few things that I always find difficult.
 Travis> Most of the time the legend is a good bit larger than I'd
 Travis> like and I can't seem to figure out how to change that,
 Travis> though I'm thinking it probably involves something like
 Travis> what you do in legend_demo.py in the examples. Is this
 Travis> true, getting the text and then setting its fontsize? and
 Travis> then setting the width and height of the frame?
Yes, you can control the size of the text following the example from
examples/legend_demo.py. There are a few other parameters to tweak as
well, eg the following kwargs to the legend command
 numpoints = 4 # the number of points in the legend line
 fontprop = ... # the font property
 pad = 0.2 # the fractional whitespace inside the legend border
 markerscale = 0.6 # the relative size of legend markers vs. original
 labelsep = 0.005 # the vertical space between the legend entries
 handlelen = 0.05 # the length of the legend lines
 handletextsep = 0.02 # the space between the legend line and legend text
 axespad = 0.02 # the border between the axes and legend edge
Setting the width and height of the frame directly probably won't
help, as this is dynamically resized at drawing time to accommodate
the artists contained inside it.
 Travis> Also, I'm making a plot of some signed errors and for some
 Travis> reason the y axis seems broken as the negative values are
 Travis> being plotting above the positive ones, any idea why this
 Travis> might be?
I haven't seen anything like this before. An example which shows the
bug would help, as would the version info provided when you run your
script with --verbose-helpful.
JDH
From: Tim L. <ti...@cs...> - 2005年04月08日 07:55:58
And to answer my own question, I need to do:
plot(range(75))
axis([0, 74, 0, 74])
show()
Sorry for the noise.
Tim
On 2005年4月08日, Tim Leslie <ti...@cs...> wrote...
> Hi All,
> 
> I've got a nice simple question for you. If I do:
> 
> plot(range(75))
> show()
> 
> The figure shows up as expected, but the x and y axes both run from 0 to
> 80. Is there some way to force them to only include the required range of
> points, eg 0 to 75? I had a play around with the axes() and figure()
> functions but I wasn't able to get them to do what I wanted. Not sure if I
> was maybe barking up the wrong tree.
> 
> Cheers,
> 
> Tim Leslie
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
`-
From: Tim L. <ti...@cs...> - 2005年04月08日 07:50:06
Hi All,
I've got a nice simple question for you. If I do:
plot(range(75))
show()
The figure shows up as expected, but the x and y axes both run from 0 to
80. Is there some way to force them to only include the required range of
points, eg 0 to 75? I had a play around with the axes() and figure()
functions but I wasn't able to get them to do what I wanted. Not sure if I
was maybe barking up the wrong tree.
Cheers,
Tim Leslie
From: Daisy F. <eli...@ya...> - 2005年04月08日 03:22:54
John,
Thank you for clarifying things for me! As far as the
replacement function goes, well -- yours is right on
the money. It's a simple moving average calculation
and it gets the job done. I just kept getting a
different result when comparing to an actual financial
chart since the calculation was based on open prices. 
I just added a calculation for the Exponential Moving
Average (based on
http://www.stockcharts.com/education/IndicatorAnalysis/indic_movingAvg.html):
def ema(s, n):
 """
 returns an n period exponential moving average for
the time series s
 s is a list ordered from oldest (index 0) to most
recent (index -1)
 n is an integer
 returns a numeric array of the exponential
moving average
 """
 s = array(s)
 ema = []
 j = 1
 #get n sma first and calculate the next n period
ema
 sma = sum(s[:n]) / n
 multiplier = 2 / float(1 + n)
 ema.append(sma)
 #EMA(current) = ( (Price(current) - EMA(prev) ) x
Multiplier) + EMA(prev)
 ema.append(( (s[n] - sma) * multiplier) + sma)
 #now calculate the rest of the values
 for i in s[n+1:]:
 tmp = ( (i - ema[j]) * multiplier) + ema[j]
 j = j + 1
 ema.append(tmp)
 return ema
I hope you can find it useful in your examples.
--- John Hunter <jdh...@ac...> wrote:
> OK, I see what is going on. The lines are being
> plotted over the
> rectangles, so even if the rectangles are
> transparent, you still see
> the lines. There are two candlestick functions in
> matplotlib
> candlestick and candlestick2. They have slightly
> different call
> signatures and a different implementation under the
> hood. candlestick
> creates a bunch of separate lines and rectangles,
> candlestick2 uses
> collections (see the help for the
> matplotlib.collections module).
> 
> You can control the z-ordering on the plot by
> setting the zorder
> property (see examples/zorder_demo.py). For
> candlestick (see
> examples/candlestick_demo.py) you would do
> 
> lines, patches = candlestick(ax, quotes,
> width=0.6)
> set(lines, zorder=0.9*patches[0].zorder)
> 
> for candlestick2 you would do (untested)
> 
> linecol, rectcol = candlestick2(blah) 
> z = rectcol.get_zorder()
> linecol.set_zorder(0.9*z)
> 
> Argg, that's embarrassing. Good thing mpl is
> distributed with no
> warranties.... No telling how many billions this
> bug has cost the
> wall street barons already!
> 
> In matplotlib/finance.py in the candlestick2
> function, find this code
> 
> colord = { True : colorup,
> False : colordown,
> }
> colors = [colord[open>=close] for open, close in
> zip(opens, closes) if open!=-1 and close !=-1]
> 
> 
> That should read
> 
> colors = [colord[close>=open] for open, close in
> zip(opens, closes) if open!=-1 and close !=-1]
> 
> 
> right? I believe this is already correct in
> candlestick, so this is a
> candlestick2 specific bug.
> 
> 
 
> OK, if you submit a replacement function that better
> matches actual
> plots, I will be happy to include it.
> 
> Thanks for the report!
> JDH
> 
> 
>
-------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT
> Products from real users.
> Discover which products truly live up to the hype.
> Start reading now.
>
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
>
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 
From: Stephen W. <ste...@cs...> - 2005年04月07日 23:03:26
Robert Kern wrote:
> Exuberant ctags
>
> http://ctags.sourceforge.net/
>
Which, as it turns out, is the version of ctags on Fedora Core 3. I did 
a 'ctags -R' in the matplotlib root directory and am now happily 
browsing the source using nedit.
Thanks, Robert!
Steve
From: Robert K. <rk...@uc...> - 2005年04月07日 21:35:24
Stephen Walton wrote:
> I'm sure the code is fine, John, and it's just me. Specifically, if I 
> want to see how matplotlib is doing something, I can't just trace 
> function calls like I'm used to doing with Fortran and C, because there 
> are methods too and I have to find the class which defines those methods 
> to see what's happening. Is there anything like ctags for Python?
Exuberant ctags
http://ctags.sourceforge.net/
-- 
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: Stephen W. <ste...@cs...> - 2005年04月07日 19:00:40
John Hunter wrote:
>>>>>>"Stephen" == Stephen Walton <ste...@cs...> writes:
>>>>>> 
>>>>>>
>Does changing the rc param
>
> image.origin : upper # lower | upper
>
>to lower help?
> 
>
Yes, it makes the image the right way around. I was simply confused 
because I expected the pixel at (x,y) in the imshow display to be the 
value of img[x,y]. It appears not to be. I hasten to add MATLAB's 
worse, as the pixel at (x,y) is actually the value of img[y,x]; MATLAB 
displays with the first array coordinate increasing downward and the 
second from left to right.
> Stephen> I've tried to look at the source, really, but I feel like
> Stephen> I'm *years* away from being enough of a Python hacker to
> Stephen> understand matplotlib.
>
>Hmm, the code's not that bad is it :-)
> 
>
I'm sure the code is fine, John, and it's just me. Specifically, if I 
want to see how matplotlib is doing something, I can't just trace 
function calls like I'm used to doing with Fortran and C, because there 
are methods too and I have to find the class which defines those methods 
to see what's happening. Is there anything like ctags for Python?
Steve
From: Rich D. <dr...@in...> - 2005年04月07日 18:51:53
Some ability to specify empty space between subplots would be very 
convenient. I'm not sure if this could best be done at figure creation or 
at subplot creation with an additional argument that says how much space 
to leave above or below.
The motivation is that creating subplots with separate titles is a very
common desire, and doing so now results in title text that invariably
overlaps the plot above (or if the font is reduced enough, it may fit but
looks squished in there).
Using manual axes creation is another approach that has been suggested, 
but this is a pain and seems to obviate the convenience of subplot().
If there is a better approach than creating custom axes, I'd love to hear
about it.
Thanks to all the pylab developers!
Rich
From: John H. <jdh...@ac...> - 2005年04月07日 18:15:06
>>>>> "Stephen" == Stephen Walton <ste...@cs...> writes:
 Stephen> Hi, I was just comparing images displayed with imshow()
 Stephen> with what I get from IRAF's display command and ds9. The
 Stephen> latter puts the first axis increasing horizontally and
 Stephen> the second axis increasing vertically, as if the image
 Stephen> array were addressed as img[ix,iy], where ix and iy are
 Stephen> integer x and y coordinates. The axes imshow() produces
 Stephen> are labeled as if this is true for it as well, but in
 Stephen> fact the image is upside down with respect to what I see
 Stephen> with IRAF. Even odder, to see the same display I see in
 Stephen> IRAF I have to do imshow(img[::-1,:]), as if I'm
 Stephen> reversing the direction of the first axis.
Does changing the rc param
 image.origin : upper # lower | upper
to lower help?
 Stephen> I've tried to look at the source, really, but I feel like
 Stephen> I'm *years* away from being enough of a Python hacker to
 Stephen> understand matplotlib.
Hmm, the code's not that bad is it :-)
JDH
From: Perry G. <pe...@st...> - 2005年04月07日 18:12:31
check out the .matplotlibrc image.origin configuration parameter. The 
default is to have pixel 0,0 on the upper left which is opposite of 
what us weird astronomers think is the natural locationl
Perry
On Apr 7, 2005, at 2:08 PM, Stephen Walton wrote:
> Hi,
>
> I was just comparing images displayed with imshow() with what I get 
> from IRAF's display command and ds9. The latter puts the first axis 
> increasing horizontally and the second axis increasing vertically, as 
> if the image array were addressed as img[ix,iy], where ix and iy are 
> integer x and y coordinates. The axes imshow() produces are labeled 
> as if this is true for it as well, but in fact the image is upside 
> down with respect to what I see with IRAF. Even odder, to see the 
> same display I see in IRAF I have to do imshow(img[::-1,:]), as if I'm 
> reversing the direction of the first axis.
>
> I've tried to look at the source, really, but I feel like I'm *years* 
> away from being enough of a Python hacker to understand matplotlib.
>
> Steve
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real 
> users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Stephen W. <ste...@cs...> - 2005年04月07日 18:08:35
Hi,
I was just comparing images displayed with imshow() with what I get from 
IRAF's display command and ds9. The latter puts the first axis 
increasing horizontally and the second axis increasing vertically, as if 
the image array were addressed as img[ix,iy], where ix and iy are 
integer x and y coordinates. The axes imshow() produces are labeled as 
if this is true for it as well, but in fact the image is upside down 
with respect to what I see with IRAF. Even odder, to see the same 
display I see in IRAF I have to do imshow(img[::-1,:]), as if I'm 
reversing the direction of the first axis.
I've tried to look at the source, really, but I feel like I'm *years* 
away from being enough of a Python hacker to understand matplotlib.
Steve
From: <oli...@ma...> - 2005年04月07日 09:28:10
Hi,
I have some problems compiling an .exe-file for my application. I use
wxPython together with matplotlib and tried to make an .exe-file with both
packages for the first time.
Windows XP
Python 2.4
wxPython 2.5.3.1
matplotlib 0.74
I checked the FAQ at the matplotlib homepage and the py2exe-examples and
did the following:
from distutils.core import setup
import glob
import py2exe
data = glob.glob(r'C:\Python24\Lib\site-packages\matplotlib\*')
data.append(r'C:\Python24\Lib\site-packages\matplotlib\.matplotlibrc')
setup(
 console = ["PanelCheck.py"],
 data_files = [("matplotlibdata", data)],
 )
After py2exe is finished I find both folders 'dist' and 'build' as ususal,
however I can't finde an .exe-file of my application PanelCheck.py in the
dist-folder.
I assume that 'window' is what I want to use in the code above, but when I
do that I get the following error:
--(just a small part of the console output)--
error: can't copy 'C:\Python24\Lib\site-packages\matplotlib\backends':
doesn't exist or not a regular file
What am I doing wrong? Help is really appreciated!
Oliver
From: <and...@ti...> - 2005年04月07日 09:03:48
Hello NG,
 this morning I have done the really BIG mistake of uninstalling the
following things:
- Numeric 23.5
- ctypes 0.9.2
- numarray 1.1.1
- Matplotlib 0.72
And I have installed the following:
- Numeric 23.8
- ctypes 0.9.6
- numarray 1.2.3
- Matplotlib 0.74
Using py2exe 0.5.4, now I get some errors on not-found modules, that I pu=
t
at the end of the mail. I have never encountered these problems with olde=
r
versions of the aforementioned tools. Please note that, a part the VTK th=
ings,
almost all the missing modules are from numerix/backends. If I try to sta=
rt
the application, I get a Visual C++ runtime error (and not the usual MYEX=
E.exe.log
message from py2exe, so I do not know how to track the error). 
I am on a Windows 2000 machine.
Deinstalling the new tools and re-installing the old ones didn't help any=
more...
Does anyone have a suggestion?
['backends.draw_if_interactive', 'backends.new_figure_manager', 'backends=
.show',
 'cephes', 'dl', 'libvtkCommonPython', 'libvtkFilteringPython', 'libvtkGr=
aphicsP
ython', 'libvtkHybridPython', 'libvtkIOPython', 'libvtkImagingPython', 'l=
ibvtkPa
rallelPython', 'libvtkPatentedPython', 'libvtkRenderingPython', 'numerix.=
ArrayTy
pe', 'numerix.Complex', 'numerix.Complex32', 'numerix.Complex64', 'numeri=
x.Float
', 'numerix.Float32', 'numerix.Float64', 'numerix.Int', 'numerix.Int16',
'numeri
x.Int32', 'numerix.Int8', 'numerix.Matrix', 'numerix.UInt16', 'numerix.UI=
nt32',
'numerix.UInt8', 'numerix.absolute', 'numerix.add', 'numerix.allclose',
'numerix
.alltrue', 'numerix.arange', 'numerix.arccos', 'numerix.arccosh', 'numeri=
x.arcsi
n', 'numerix.arcsinh', 'numerix.arctan', 'numerix.arctan2', 'numerix.arct=
anh',
'
numerix.argmax', 'numerix.argmin', 'numerix.argsort', 'numerix.around',
'numerix
.array', 'numerix.arrayrange', 'numerix.asarray', 'numerix.asum', 'numeri=
x.bitwi
se_and', 'numerix.bitwise_or', 'numerix.bitwise_xor', 'numerix.ceil', 'nu=
merix.c
hoose', 'numerix.clip', 'numerix.compress', 'numerix.concatenate', 'numer=
ix.conj
ugate', 'numerix.convolve', 'numerix.cos', 'numerix.cosh', 'numerix.cross=
_correl
ate', 'numerix.cumproduct', 'numerix.cumsum', 'numerix.diagonal', 'numeri=
x.divid
e', 'numerix.dot', 'numerix.equal', 'numerix.exp', 'numerix.fabs', 'numer=
ix.fft.
fft', 'numerix.floor', 'numerix.fmod', 'numerix.fromfunction', 'numerix.f=
romstri
ng', 'numerix.greater', 'numerix.greater_equal', 'numerix.hypot', 'numeri=
x.ident
ity', 'numerix.indices', 'numerix.innerproduct', 'numerix.less', 'numerix=
.less_e
qual', 'numerix.log', 'numerix.log10', 'numerix.logical_and', 'numerix.lo=
gical_n
ot', 'numerix.logical_or', 'numerix.logical_xor', 'numerix.matrixmultiply=
',
'num
erix.maximum', 'numerix.minimum', 'numerix.mlab.amax', 'numerix.mlab.amin=
',
'num
erix.mlab.cov', 'numerix.mlab.diff', 'numerix.mlab.flipud', 'numerix.mlab=
.hannin
g', 'numerix.mlab.rand', 'numerix.mlab.std', 'numerix.mlab.svd', 'numerix=
.multip
ly', 'numerix.negative', 'numerix.nonzero', 'numerix.not_equal', 'numerix=
.nx',
'
numerix.ones', 'numerix.outerproduct', 'numerix.pi', 'numerix.power', 'nu=
merix.p
roduct', 'numerix.put', 'numerix.putmask', 'numerix.rank', 'numerix.ravel=
',
'num
erix.repeat', 'numerix.reshape', 'numerix.resize', 'numerix.searchsorted'=
,
'nume
rix.shape', 'numerix.sin', 'numerix.sinh', 'numerix.size', 'numerix.somet=
rue',
'
numerix.sort', 'numerix.sqrt', 'numerix.subtract', 'numerix.swapaxes', 'n=
umerix.
take', 'numerix.tan', 'numerix.tanh', 'numerix.trace', 'numerix.transpose=
',
'num
erix.where', 'numerix.which', 'numerix.zeros', 'vtkParallelPython', 'matp=
lotlib.
numerix.absolute', 'matplotlib.numerix.equal', 'numarray.Complex', 'numar=
ray.Com
plex32', 'numarray.Complex64', 'numarray.Float', 'numarray.Float32', 'num=
array.F
loat64', 'numarray.Int', 'numarray.Int16', 'numarray.Int32', 'numarray.In=
t8',
'n
umarray.NumArray', 'numarray.UInt16', 'numarray.UInt32', 'numarray.UInt8'=
,
'numa
rray._dotblas', 'numarray.asarray', 'numarray.dot', 'numarray.fromlist',
'numarr
ay.shape', 'numarray.typecode', 'numarray.zeros', 'wx.BitmapFromImage',
'wx.Empt
yIcon']
From: John H. <jdh...@ac...> - 2005年04月07日 03:47:17
>>>>> "jim" == jim <jl...@yv...> writes:
 jim> John: What I need to do is create drawings of windows (as in
 jim> plug holes in houses and let in light) with grid and other
 jim> options on the fly.
 jim> So what I need are the graphic primitives -- canvas, lines,
 jim> fills ... The output needs to be a graphic file.
You probably want to be using matplotlib primitives. Assuming you
have a matplotlib.axes.Axes (or Subplot) instance stored as "ax", The
primitives are
 matplotlib.lines.Line2D - add with ax.add_line 
 matplotlib.patches.Rectangle - add with ax.add_patch
 matplotlib.patches.Polygon - add with ax.add_patch
 matplotlib.patches.RegularPolygon - add with ax.add_patch
 matplotlib.patches.Circle - add with ax.add_patch
 matplotlib.patches.Text - add with ax.add_artist
Ie, there are not too many mpl primitives, and using these will
insulate you from changes in the mpl backend (renderer) api. The
backend API is meant only for mpl developers. The classes referred to
above are all part of the matplotlib Artist hierarchy.
 jim> I will go back and study the docs, but a suggestion of what
 jim> area to use would be most welcome. Or, of course, a
 jim> different module than matplotlib if that would be more
 jim> appropriate.
To reiterate, there is one base class matplotlib.artist.Artist that
all the objects that render into the figure derive from. From this,
there are just a few derived classes to be aware of: Line2D, Patch,
Text, and Collection. From these there are a few more derived classes (eg
Patch and Collection have some specialized derived classes, Line2D and
Text do not as of yet). Other Artists (including Figure, Axes,
Legend, Table and so on) are simply composites of these primitive
types. See the following class docs for more info:
 http://matplotlib.sourceforge.net/matplotlib.artist.html
 http://matplotlib.sourceforge.net/matplotlib.lines.html
 http://matplotlib.sourceforge.net/matplotlib.patches.html
 http://matplotlib.sourceforge.net/matplotlib.text.html
 http://matplotlib.sourceforge.net/matplotlib.collections.html
In short, you should concentrate on building the primitive types you
need rather than calling the renderer methods directly. The
primitives will call the right renderer methods as necessary (as they
do in matplotlib.lines, for example).
Hope this helps,
JDH
2 messages has been excluded from this view by a project administrator.

Showing results of 284

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