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




Showing results of 152

1 2 3 .. 7 > >> (Page 1 of 7)
From: Todd M. <jm...@st...> - 2004年08月31日 21:51:11
Release Name: matplotlib-0.62.4
Notes:
What's new in matplotlib-0.62 -=20
You can read this in html with hyperlinks at
http://matplotlib.sf.net/whats.new.html.
 * interactive support in ipython http://ipython.scipy.org with
 ipython -pylab, which detects your backend and loads the
 appropriate interactive, threaded shell, as well as all of
 matplotlib.matlab and numerix. Requires ipython-0.6.3. Backend
 status summary: linux (all backends working), OSX (tkagg and gtk*
 work), win32 (tkagg only). Thanks Fernando Perez!
 * Excellent improvements in log ticking and formatting. You can now
 do log plots in any base with major and minor tick support. You
 can easily customize the location of the minor ticks with the subs
 arguments. Mathtext exponential labeling for log plots. Thanks
 Darren Dale and Gregory Lielens. See the new screenshot and
 example - http://matplotlib.sf.net/screenshots.html#log_shot and
 help for the semilogx, semilogy and loglog.
 # base 16 semilog x plot with minor ticks on the 2s, 4s and 8s
 semilogx(x,y, basex=3D16, subsx=3D[2,4,8])
 * Mathtext now more than 5x faster. Thanks to Paul Mcguire for
 optimizations in both pyparsing and the matplotlib grammar!
 Warning, mathtext broken on python2.2. We hope to fix this soon.
 * fltkagg backend - alpha. Gregory Lielens submitted an fltkagg
 backend which requires CVS pyfltk. Feedback please!
 * Bug fixes: fixed some image edge effects, a ttf read problem in
 backend_ps on win32, several errorbar problems, a HOME dir bug on
 win32, grid w/o args now toggle grid state, multiple imshows with
 different extents, markerface color as RGB tulple
Downloads at http://sourceforge.net/projects/matplotlib
-------------------------------------------------------------------------=
-------
Changes:
2004年08月30日 matplotlib 0.62.4 released
2004年08月30日 Fixed a multiple images with different extent bug,
 Fixed markerfacecolor as RGB tuple
2004年08月27日 Mathtext now more than 5x faster. Thanks to Paul Mcguire
 for fixes both to pyparsing and to the matplotlib grammar!
 mathtext broken on python2.2
2004年08月25日 Exposed Darren's and Greg's log ticking and formatting
 options to semilogx and friends
2004年08月23日 Fixed grid w/o args to toggle grid state - JDH
2004年08月11日 Added Gregory's log patches for major and minor ticking
2004年08月18日 Some pixel edge effects fixes for images
2004年08月18日 Fixed TTF files reads in backend_ps on win32. =20
2004年08月18日 Added base and subs properties for logscale plots, user
 modifiable using
 set_[x,y]scale('log',base=3Db,subs=3D[mt1,mt2,...]) - GL
2004年08月18日 fixed a bug exposed by trying to find the HOME dir on win32
 thanks to Alan Issac for pointing to the light - JDH
2004年08月18日 fixed errorbar bug in setting ecolor - JDH
2004年08月12日 Added Darren Dale's exponential ticking patch
2004年08月11日 Added Gregory's fltkagg backend
-------------------------------------------------------------------------=
-------Special numarray Note:The windows installers for the numarray =
version of=20
matplotlib will be unavailable until some time next=20
week due to the untimely death of Todd Miller's PC.
From: Ray S. <rj...@bl...> - 2004年08月31日 18:04:24
 > I suggest you start with
 > 
<http://matplotlib.sourceforge.net/examples/embedding_in_wx2.py>http://matplotlib.sourceforge.net/examples/embedding_in_wx2.py 
and
 > perturb off of that. I can"t take a close look at your code right
 > now, but this should get you started.
 >
 > Cheers,
 > JDH
Hi, and thanks for the reply.
The code was stripped out of embedding_in_wx.py; the version I have did not 
have embedding_in_wx2.py included... I upgraded to 
matplotlib-0.61.0.win32-py2.2
This (mostly) Boa generated code now does work similarly (no toolbar):
__________________________________________________________________
#Boa:Frame:wxFrame1
from wxPython.wx import *
from matplotlib.numerix import arange, sin, pi
import matplotlib
matplotlib.use('WX')
from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas
#from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.figure import Figure
from wxPython.wx import *
def create(parent):
 return wxFrame1(parent)
[wxID_WXFRAME1] = map(lambda _init_ctrls: wxNewId(), range(1))
class wxFrame1(wxFrame):
 def _init_ctrls(self, prnt):
 # generated method, don't edit
 wxFrame.__init__(self, id=wxID_WXFRAME1, name='', parent=prnt,
 pos=wxPoint(66, 66), size=wxSize(391, 312),
 style=wxDEFAULT_FRAME_STYLE, title='wxFrame1')
 self.SetClientSize(wxSize(383, 285))
 def __init__(self, parent):
 self._init_ctrls(parent)
 self.SetBackgroundColour(wxNamedColor("WHITE"))
 self.figure = Figure()
 self.axes = self.figure.add_subplot(111)
 t = arange(0.0,3.0,0.01)
 s = sin(2*pi*t)
 self.axes.plot(t,s)
 self.canvas = FigureCanvas(self, -1, self.figure)
 self.sizer = wxBoxSizer(wxVERTICAL)
 self.sizer.Add(self.canvas, 1, wxLEFT | wxTOP | wxGROW)
 self.SetSizer(self.sizer)
 self.Fit()
 def OnPaint(self, event):
 self.canvas.draw()
Ray
http://rjs.org
From: Vittorio P. <re...@em...> - 2004年08月31日 12:58:39
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I've packaged a new version of python-matplotlib and ipython, you can find my
packages at this address:
deb http://anakonda.altervista.org/debian packages/
deb-src http://anakonda.altervista.org/debian sources/
# apt-get install python-matplotlib python-matplotlib-doc ipython
P.S.
python-matplotlib-doc isn't complete because pydoc exits with a segfault when I
build documentation, I'm investigating on this...
- --
/Vittorio Palmisano/
Home Page: http://redclay.altervista.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBNHZjpT6bvDtyXOIRAmdSAKCeCdL+LKWEoZe86XqGXaKpyGQUzwCfSWz6
fZPWvFkHuv40FVbpXdUUveo=
=mUTV
-----END PGP SIGNATURE-----
 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 E' iniziata l'era del fax virtuale! Si chiama EmailFax IN e significa: affidabilità, semplicità, qualità e risparmio.
* Clicca per saperne di più
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=1570&d=31-8
From: redclay <re...@em...> - 2004年08月31日 12:01:09
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I've packaged a new version of python-matplotlib and ipython, you can find my
packages at this address:
deb http://anakonda.altervista.org/debian packages/
deb-src http://anakonda.altervista.org/debian sources/
# apt-get install python-matplotlib python-matplotlib-doc ipython
P.S.
python-matplotlib-doc isn't complete because pydoc exits with a segfault when I
build documentation, I'm investigating on this...
- --
/Vittorio Palmisano/
Home Page: http://redclay.altervista.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBNFq/pT6bvDtyXOIRAqLtAKCvofM7S4LEBD6grWC0zAkghzsCaQCgoV3T
q4+FEtMxwotTJ4MnW+JNrF0=
=3fLp
-----END PGP SIGNATURE-----
From: John H. <jdh...@ac...> - 2004年08月31日 04:20:29
>>>>> "Ray" == Ray Schumacher <rj...@bl...> writes:
 Ray> Hi all, I've been looking at matplotlib, as I'm using
 Ray> wxPyPlot and want a bit more...
 Ray> Q1: Has anyone used matplotlib with Boa, and, as a Plug-in?
 Ray> Q2: In the code below, (and with/from the example) I'm trying
 Ray> to simply display a plot, no toolbar, sizer etc. The canvas
 Ray> appears on the panel, but no plot appears. What am I missing?
I suggest you start with
http://matplotlib.sourceforge.net/examples/embedding_in_wx2.py and
perturb off of that. I can't take a close look at your code right
now, but this should get you started.
Cheers,
JDH
From: John H. <jdh...@ac...> - 2004年08月31日 04:19:02
>>>>> "GHubert" == Hubert Hickman <hu...@tc...> writes:
 GHubert> Hello, I am trying to construct a plot that is a barchart
 GHubert> with the X-axis being dates. I have used the plot_dates
 GHubert> to generated line plots that look great, however, other
 GHubert> than turning the dates into integers myself I cannot
 GHubert> figure out a way to do a barchart with dates as the
 GHubert> Xaxis.
 GHubert> Has anyone done one of these - I am using the wxPython
 GHubert> backend, if that matters.
I suggest you use integer (epoch) dates on the x axis of the bar as
provided by a datetime converter (see
http://matplotlib.sourceforge.net/matplotlib.dates.html) and then use
one of the many matplotlib datetime tick locators and formatters which
know how to format these epoch dates. With any axes, you can set a
custom tick locator and/or formatter. This is, in fact, what
plot_date does; see also
http://matplotlib.sourceforge.net/matplotlib.ticker.html and see the
examples (from http//matplotlib.sf.net/examples or in the matplotlib
src distribution in the examples subdir)
 custom_ticker1.py
 major_minor_demo1.py
and major_minor_demo2.py
and take a look at the src code of the plot_date function in
matplotlib/axes.py for an example of using date tickers and
formatters.
Sorry I can't be of more help right now but I'm short on time; perhaps
someone else can provide a concrete example.
Cheers,
JDH
From: John H. <jdh...@ac...> - 2004年08月31日 04:13:05
>>>>> "Xavier" == Xavier MERIAUX <Me...@mr...> writes:
 Xavier> Hi, I am a new user of matplotlib. I have already plot
 Xavier> some data whit it but, I can't find the way to control the
 Xavier> axis scales ... I know how to define the min/max number
 Xavier> for each axis. Is it possible to define the intermediate
 Xavier> scale values ?? For example , the x - axis marks are
 Xavier> (automatically) choosen :0 , 0.2 , 0.4 , 0.6 , 0.8 , 1.0
 Xavier> Can I have instead the values 0, 0.5 , 1.0 written on the
 Xavier> axis ?
You can set the xticks with the following. 
 set(gca(), xticks=[0, 0.5 , 1.0])
If you haven't had a chance yet to read the tutorial at
http://matplotlib.sourceforge.net/tutorial.html, it should help
somewhat. See the section "Controlling axes properties"
Cheers,
John Hunter
From: Ray S. <rj...@bl...> - 2004年08月30日 22:09:28
Hi all,
I've been looking at matplotlib, as I'm using wxPyPlot and want a bit more...
Q1: Has anyone used matplotlib with Boa, and, as a Plug-in?
Q2: In the code below, (and with/from the example) I'm trying to simply 
display a plot, no toolbar, sizer etc.
The canvas appears on the panel, but no plot appears. What am I missing?
Python 2.2
WX 2.4
Thanks,
Ray
wxFrame1.py:
_____________________________________________________________
#Boa:Frame:wxFrame1
from wxPython.wx import *
from wxPyPlot.wxPyPlot import PlotCanvas
import numarray
import matplotlib
matplotlib.use('WX')
from matplotlib.backends.backend_wx import FigureCanvasWx
from matplotlib.figure import Figure
from matplotlib.axes import Subplot
def create(parent):
 return wxFrame1(parent)
[wxID_WXFRAME1, wxID_WXFRAME1PANEL1,
] = map(lambda _init_ctrls: wxNewId(), range(2))
class wxFrame1(wxFrame):
 def _init_ctrls(self, prnt):
 # generated method, don't edit
 wxFrame.__init__(self, id=wxID_WXFRAME1, name='', parent=prnt,
 pos=wxPoint(0, 0), size=wxSize(406, 341),
 style=wxDEFAULT_FRAME_STYLE, title="Test embedded wxFigure")
 self.panel1 = wxPanel(id=wxID_WXFRAME1PANEL1, name='panel1',
 parent=self, pos=wxPoint(0, 0), size=wxSize(398, 314),
 style=wxTAB_TRAVERSAL)
 def __init__(self, parent):
 self._init_ctrls(parent)
 self.fig = Figure((5,4), 75)
 self.canvas = FigureCanvasWx(self.panel1, -1, self.fig)
 self.plot_data()
 def plot_data(self):
 a = Subplot(self.fig, 111)
 t = numarray.arange(0.0,3.0,0.01)
 s = numarray.sin(2*numarray.pi*t)
 c = numarray.cos(2*numarray.pi*t)
 a.plot(t,s)
 a.plot(t,c)
From: Chris B. <Chr...@no...> - 2004年08月30日 17:48:34
Gregory Lielens wrote:
>>Except that z-order and a z coordinate really are different, so we 
>>shouldn't use z, it will make it harder, not easier to add 3-plots in 
>>the future!
> 
> Are they? I think not, cause in 3D you can not control the order of
> "painting", this is done so that elements which are in the background
> are hidden by elements which are more close to the observer...
sure, for data elements, but what about legends, error bars, etc?
-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: Matt N. <new...@ca...> - 2004年08月30日 17:02:29
> > > What is a
> > > good attribute name? I think a method like scale_buoyancy would be
> > > useful too so users wouldn't have to know the default values.
> > 
> > zorder or layer
> 
> or height...
This is an excellent idea, but I'd suggest using the term 'depth'.
Then attributes with larger depth would be drawn below those with
smaller depth.
--Matt Newville <newville at cars.uchicago.edu>
From: Gregory L. <gre...@ff...> - 2004年08月30日 16:46:16
On Mon, 2004年08月30日 at 18:13, Chris Barker wrote:
> Gregory Lielens wrote:
> > I think this ordering is an excellent idea! In fact, I also prefer
> > zorder, or maybe height, or simply z: This can be seen as a
> > z-coordinate, whose only effect would be to change ordering for a 2D
> > plot, but could leads to 3D plots in the future :-)
> 
> Except that z-order and a z coordinate really are different, so we 
> shouldn't use z, it will make it harder, not easier to add 3-plots in 
> the future!
Are they? I think not, cause in 3D you can not control the order of
"painting", this is done so that elements which are in the background
are hidden by elements which are more close to the observer...
Having both a layer info and a z info in 3D would not be consistent
imho, painting at the end an element which should normally be hidden by
others seems like a hack for bypassing normal 3D rendering to me...
And if you use no perspective (infinite focal? ), a 3D plot watched from
above (Z=+inf) would be the same as a 2D plot with z=layer...In fact,
the painting from lower z to higher z is the basic 3D rendering
technique as far as I know...hum, except that the convention used in 3D
is z increasing means further away from the observer, so highest z =
first to be painted, which destroy my argument for "Large number printed
last", oups ;-)
From: Chris B. <Chr...@no...> - 2004年08月30日 16:18:33
Gregory Lielens wrote:
> I think this ordering is an excellent idea! In fact, I also prefer
> zorder, or maybe height, or simply z: This can be seen as a
> z-coordinate, whose only effect would be to change ordering for a 2D
> plot, but could leads to 3D plots in the future :-)
Except that z-order and a z coordinate really are different, so we 
shouldn't use z, it will make it harder, not easier to add 3-plots in 
the future!
-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: Hubert H. <hu...@tc...> - 2004年08月30日 16:05:30
Hello,
I am trying to construct a plot that is a barchart with the X-axis being
dates. I have used the plot_dates to generated line plots that look
great, however, other than turning the dates into integers myself I cannot
figure out a way to do a barchart with dates as the Xaxis.
Has anyone done one of these - I am using the wxPython backend, if that
matters.
Thanks!
Hubert Hickman
From: Xavier M. <Me...@mr...> - 2004年08月30日 15:24:57
Hi,
I am a new user of matplotlib.
I have already plot some data whit it but, I can't find the way to control 
the axis scales ...
I know how to define the min/max number for each axis. Is it possible to 
define the intermediate scale values ??
For example , the x - axis marks are (automatically) choosen :0 , 0.2 , 0.4 
, 0.6 , 0.8 , 1.0
Can I have instead the values 0, 0.5 , 1.0 written on the axis ?
Best regards,
Xavier.
From: John H. <jdh...@ac...> - 2004年08月30日 13:14:03
>>>>> "Jon" == Jon Peirce <Jon...@no...> writes:
 Jon> Hi there I just recently upgraded my copy of matplotlib to
 Jon> 0.61 (from 0.54!) and have found a couple of my scripts no
 Jon> longer working. It seems that, for plot(), the argument
 Jon> markerfacecolor no longer takes a color triplet, but requires
 Jon> a string ('w', 'k' etc). markerEDGEcolor is still happy to
 Jon> take either form of color descriptor.
When you say, "no longer takes a color triplet" do you mean "causes an
error". I tried an example and got an exception. Simple fix: in
matplotlib/lines.py, at the top of the code import is_string_like from
matplotlib.cbook, ie,
from cbook import True, False, iterable, is_string_like
and at the end of the code, replace the _get_rgb_face method with
 def _get_rgb_face(self):
 if (self._markerfacecolor is None or
 (is_string_like(self._markerfacecolor) and
 self._markerfacecolor.lower()=='none') ): rgbFace = None
 else: rgbFace = colorConverter.to_rgb(self._markerfacecolor)
 return rgbFace
Thanks for letting me know,
JDH
From: John H. <jdh...@ac...> - 2004年08月30日 13:08:18
>>>>> "Jon" == Jon Peirce <Jon...@no...> writes:
 Jon> On a different topic, imshow() only seems to display a single
 Jon> image at a time. e.g. in the following example, when image2
 Jon> is drawn image1 is deleted.
 Jon> #------------------------------------------------- import
 Jon> matplotlib.matlab as mat myImage = mat.imread('image1.png')
 Jon> myImage2 = mat.imread('image2.png') mat.imshow(myImage,
 Jon> extent=[0,1,0,1]) mat.imshow(myImage2, extent=[1,2,1,2])
 Jon> mat.axis([0, 2, 0, 2]) mat.show()
 Jon> #------------------------------------------------- Is that a
 Jon> known issue? Is there a workaround?
 Jon> all the best, Jon
Ahh, interesting case. I put the following line in the Axes.imshow
code to protect users from senselessly piling up lots of images
 if alpha==1: self._images = []
That is, I cleared the image stack if alpha was 1, reasoning you can't
see behind a fully opaque image; I was afraid someone might plot lots
of images to the same axes with alpha=1 , and never know they were
piling up images and hurting performance. I had neglected to consider
that you might be using multiple images with different extents.
If you comment out that line in matplotlib/axes.py, your example will
work.
Note that I find it a bit more natural to define separate axes to hold
the separate images. Of course, my approach won't work if you want to
plot other data, eg lines, that cover multiple images on the same
axes, but for simple montages, I think it's cleaner.
 import matplotlib.matlab as mat
 myImage = mat.imread('test1.png')
 myImage2 = mat.imread('test2.png')
 ax1 = mat.axes([0.5, 0.5, 0.5, 0.5])
 ax1.imshow(myImage)
 mat.axis('off')
 ax2 = mat.axes([0, 0.0, 0.5, 0.5])
 ax2.imshow(myImage2)
 mat.axis('off')
 mat.show()
JDH
From: Jon P. <Jon...@no...> - 2004年08月30日 09:25:23
Hi there
I just recently upgraded my copy of matplotlib to 0.61 (from 0.54!) and 
have found a couple of my scripts no longer working. It seems that, for 
plot(), the argument markerfacecolor no longer takes a color triplet, 
but requires a string ('w', 'k' etc). markerEDGEcolor is still happy to 
take either form of color descriptor.
On a different topic, imshow() only seems to display a single image at a 
time.
e.g. in the following example, when image2 is drawn image1 is deleted.
#-------------------------------------------------
import matplotlib.matlab as mat
myImage = mat.imread('image1.png')
myImage2 = mat.imread('image2.png')
mat.imshow(myImage, extent=[0,1,0,1])
mat.imshow(myImage2, extent=[1,2,1,2])
mat.axis([0, 2, 0, 2])
mat.show()
#-------------------------------------------------
Is that a known issue? Is there a workaround?
all the best,
Jon
This message has been scanned but we cannot guarantee that it and any
attachments are free from viruses or other damaging content: you are
advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
From: Gregory L. <gre...@ff...> - 2004年08月30日 07:29:21
Hi,
I think this ordering is an excellent idea! In fact, I also prefer
zorder, or maybe height, or simply z: This can be seen as a
z-coordinate, whose only effect would be to change ordering for a 2D
plot, but could leads to 3D plots in the future :-)
> > Should large numbers
> > be drawn last or first (last is my instinct, like list indexing, and
> > more efficient since you won't have to reverse the sort).
> 
> No preference.
Large number printed last, consistent with the zorder = 3rd coordinate
idea if one look the plot from above.
> > What is a
> > good attribute name? I think a method like scale_buoyancy would be
> > useful too so users wouldn't have to know the default values.
> 
> zorder or layer
or height...
Best regards,
Greg.
From: Gary R. <ga...@em...> - 2004年08月30日 07:09:20
Just some comments below as requested
----- Original Message -----
From: John Hunter <jdh...@ac...>
> Isn't this debatable? Might someone want to see the errorbar range in
> front of or behind a large marker with transparency? Why do you say
> this with certainty?
You're right John. Personally, I think the default order should be for ma=
rkers to be in front of errorbars, but on occasions I've wanted it the ot=
her way (the current implementation). I like your bouyancy idea. If you'r=
e after a different name, how about the more conventional "z-order".
> It's so easy to do that I could implement it faster than I can
> describe it, but I think buoyancy is a bad name (too hard to spell),
> and I wanted to get some feedback on the idea. Should large numbers
> be drawn last or first (last is my instinct, like list indexing, and
> more efficient since you won't have to reverse the sort).
No preference.
> What is a
> good attribute name? I think a method like scale_buoyancy would be
> useful too so users wouldn't have to know the default values.
zorder or layer
regards,
Gary
--=20
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
From: John H. <jdh...@ac...> - 2004年08月28日 20:58:50
>>>>> "Jin-chung" == Jin-chung Hsu <hs...@st...> writes:
 Jin-chung> When using the errorbar(), I have no way to change the
 Jin-chung> marker size (except do a separate plot()). Should we
 Jin-chung> add that to the errorbar's argument list?
Hi Jin-chung,
You can change the marker size with 
 1 >>> l, el = errorbar(x, y, fmt='ro',yerr=yerr)
 2 >>> set(l, ms=12)
The first return arg of errorbar is the marker line, and the second
the errorbar lines. Abbreviations in the kwargs (eg ms for
markersize) were introduced in 0.61.
 Jin-chung> Also there is another inconsistency between plot() and
 Jin-chung> errorbar(), the latter needs the fmt argument, but the
 Jin-chung> former does not recognize it.
The fact that plot doesn't recognize fmt as a kwarg stems from the
fact that it uses positional args for multiple lines and kwargs to set
line properties. The fact that you can do anf of the following and
more
 a.plot(x,y) # plot Numeric arrays y vs x
 a.plot(x,y, 'bo') # plot Numeric arrays y vs x with blue circles
 a.plot(y) # plot y using x as index array 0..N-1
 a.plot(y, 'r+', antialiased=False, alpha=0.5)
 a.plot(x1, y1, 'g^', x2, y2, 'ro') # arbitrary number of lines
 a.plot(x1, y1, x2, y2, 'g-', linewidth=2) # w/ or w/o fmt strings
means plot is already stretched to its limit in processing variable
numbers and types of arguments! All kwargs are assumed to be line set
methods, and Line2D doesn't have a set_fmt method. The line class
doesn't know about format strings.
 Jin-chung> Another comment about errorbar() is that the error bar
 Jin-chung> should not show in the marker face area, i.e the error
 Jin-chung> bars should be drawn first and then the markers with no
 Jin-chung> transparency.
Isn't this debatable? Might someone want to see the errorbar range in
front of or behind a large marker with transparency? Why do you say
this with certainty?
I agree there is a serious limitation in the way the axes draws it
objects - it's too rigid. The following order is used: frame, images,
axis, patches, lines, text, title, legend, table.
I've been thinking about how to fix this and I think it will be easy.
Assign a buoyancy to each Artist (Line2D, Text, Rectangle, etc are all
derived from Artist). The higher the buoyancy, the greater the
tendency to float to the top. Choose defaults in the range of 0..10
(or some other range), and assign default numbers like
 frame : 2
 images : 2.5
 axis : 3 
 patches : 4 (rectangles, polygons and such)
 lines : 5
 text : 6
 title : 7 and so on
The user, of course, could override the number for any object. Eg
 markerline, errlines = errorbar(*args)
 set(markerline, buoyancy=5.5) # move it up a little
 set(errlines, buoyancy=4.5) # move it down a little
Because all the artists have the same drawing signature, it would be
easy to put them in a list of ( buoyancy, artist) tuples, sort them,
and draw them all. This would give you the ability to control the
rendering order.
It's so easy to do that I could implement it faster than I can
describe it, but I think buoyancy is a bad name (too hard to spell),
and I wanted to get some feedback on the idea. Should large numbers
be drawn last or first (last is my instinct, like list indexing, and
more efficient since you won't have to reverse the sort). What is a
good attribute name? I think a method like scale_buoyancy would be
useful too so users wouldn't have to know the default values. Eg, in
the marker example you could scale the buoyancy of the errorlines by
0.9 and the marker lines by 1.1. Any thoughts?
Once this structure is in place, it would be easy to change the
default order of errorbar and marker on the plot. But I would like
some defense of the idea that the order you propose is the right one,
and/or input from others.
 Jin-chung> In 0.61.0, the marker edge color is still black,
 Jin-chung> instead of being the same as the marker face color.
 Jin-chung> Personally, I think they should be the same. What do
 Jin-chung> people think?
 Jin-chung> One reason for the same color argument is that if the
 Jin-chung> markersize is set to a small value, it will show mostly
 Jin-chung> the edge color.
 Jin-chung> One possible reason against it is that if the marker
 Jin-chung> color is white (or whatever the background color is),
 Jin-chung> then you can't see the marker. But we can default this
 Jin-chung> case to black (or whatever).
I tend to prefer the black marker edge color - I think it looks a
little better. I'm willing to be persuaded. Note that for regular
plot commands (not yet for errorbar) you can do
 plot(x, y, 'bo', mec='b') 
I would like to support 'lines.markeredgecolor : None' in rc, but None
is already doing double duty in the Line2D constructor and means "use
the rc value". I could introduce a new value 'Same' or the string
'None' as opposed to the symbol None for this purpose, or something to
that effect.
For errorbars, since they don't accept all the kwargs that plot
does (the situation is more complex since you have the markers and the
error lines) you have to use the
 1 >>> l, el = errorbar(x, y, fmt='ro',yerr=yerr)
 2 >>> set(l, mec='r', ms=12)
incantation.
 Jin-chung> In 0.61.0, when plotting a simple array with error
 Jin-chung> bars, the default color of the error bars is black,
 Jin-chung> instead of being the same as the line/markers color,
 Jin-chung> e.g.:
 >>>> errorbar([1,2,3,4,5],[3,4,5,6,7],fmt='ro',yerr=[1,1,1,1,1])
 Jin-chung> I prefer them to be the same, especially since the
 Jin-chung> default color for marker/line is blue and a beginner
 Jin-chung> may be surprised to see the different color.
Fixed in CVS. The ecolor param defaults to None, in which case the
marker color is used. You can override this by specifying an ecolor
value.
Thanks for the comments,
JDH
From: Jin-chung H. <hs...@st...> - 2004年08月27日 21:44:29
In 0.61.0, when plotting a simple array with error bars, the default color of 
the error bars is black, instead of being the same as the line/markers color, 
e.g.:
>>> errorbar([1,2,3,4,5],[3,4,5,6,7],fmt='ro',yerr=[1,1,1,1,1])
I prefer them to be the same, especially since the default color for marker/line 
is blue and a beginner may be surprised to see the different color.
This may be related to my last posting regarding the (default) marker edge 
color.
JC Hsu
From: Jin-chung H. <hs...@st...> - 2004年08月27日 21:42:57
In 0.61.0, the marker edge color is still black, instead of being the same as 
the marker face color. Personally, I think they should be the same. What do 
people think?
One reason for the same color argument is that if the markersize is set to a 
small value, it will show mostly the edge color.
One possible reason against it is that if the marker color is white (or whatever 
the background color is), then you can't see the marker. But we can default 
this case to black (or whatever).
JC Hsu
From: Jin-chung H. <hs...@st...> - 2004年08月27日 21:01:42
Hi John:
When using the errorbar(), I have no way to change the marker size (except do a 
separate plot()). Should we add that to the errorbar's argument list?
Also there is another inconsistency between plot() and errorbar(), the latter 
needs the fmt argument, but the former does not recognize it.
Another comment about errorbar() is that the error bar should not show in the 
marker face area, i.e the error bars should be drawn first and then the markers 
with no transparency.
JC Hsu
From: Gary P. <pa...@in...> - 2004年08月27日 13:14:50
----- Original Message ----- 
From: "John Hunter" <jdh...@ac...>
> >>>>> "Gary" == Gary Pajer <pa...@in...> writes:
> 
> Gary> I've poked around the docs and archives, for a clue to this,
> Gary> but if it's there I didn't recognize it.
> 
> Gary> version: 0.62 WinXP default backend: TkAgg interactive (with
> Gary> ipython)
> 
> Hi Gary, just to make sure we're clear. The last version of
> matplotlib released was 0.61.0. Is this what you mean, or are you
> using CVS?
0.61.0 (my typo)
> 
> Gary> On computer A I have version 0.54 installed. There I can
> Gary> create a plot and say savefig('plot.eps') and get a good eps
> Gary> file.
> 
> Gary> On computer B I have version 0.62 installed. There I can
> Gary> create a plot and say savefig('plot.eps') with different
> Gary> results: ghostscript chokes.
> 
> There is a known bug in the ps backend on win32 that was discussed
> here a couple of weeks ago. Fortunately, it has a trivial fix. In
> site-packages/matplotlib/backends/backend_ps.py, in the encodeTTFasPS
> function, replace the line
> 
> font = file(fontfile)
> 
> with
> 
> font = file(fontfile, 'rb')
> 
> Windows cares a lot about that binary flag.
> 
> Please let me know if this cures what ails you, because we are getting
> ready to release the next matplotlib version and I hate to release
> code with known bugs.
That was it. Problem solved.
I remember that thread now. It didn't sink in at the time. Thanks, Gary
> 
> Thanks!
> JDH
From: John H. <jdh...@ac...> - 2004年08月27日 11:57:59
>>>>> "Gary" == Gary Pajer <pa...@in...> writes:
 Gary> I've poked around the docs and archives, for a clue to this,
 Gary> but if it's there I didn't recognize it.
 Gary> version: 0.62 WinXP default backend: TkAgg interactive (with
 Gary> ipython)
Hi Gary, just to make sure we're clear. The last version of
matplotlib released was 0.61.0. Is this what you mean, or are you
using CVS?
 Gary> On computer A I have version 0.54 installed. There I can
 Gary> create a plot and say savefig('plot.eps') and get a good eps
 Gary> file.
 Gary> On computer B I have version 0.62 installed. There I can
 Gary> create a plot and say savefig('plot.eps') with different
 Gary> results: ghostscript chokes.
There is a known bug in the ps backend on win32 that was discussed
here a couple of weeks ago. Fortunately, it has a trivial fix. In
site-packages/matplotlib/backends/backend_ps.py, in the encodeTTFasPS
function, replace the line
 font = file(fontfile)
with
 font = file(fontfile, 'rb')
Windows cares a lot about that binary flag.
Please let me know if this cures what ails you, because we are getting
ready to release the next matplotlib version and I hate to release
code with known bugs.
Thanks!
JDH
4 messages has been excluded from this view by a project administrator.

Showing results of 152

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