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




Showing results of 315

<< < 1 2 3 4 .. 13 > >> (Page 2 of 13)
From: Mark S. <ms...@bi...> - 2005年05月30日 10:51:44
Hi,
I need to make a small application that will do real time graphs. 
Basically, it will receive data, and then:
* store that data in a database
* display it on a graph
The graph will be Time vs Input so that a user can watch the graph 
grow. Updates may be needed as quickly as 5 times per second.
Can matplotlib do this, or should I be looking at using something else? 
If it can, how? I've taken a browse through the website but can't find 
relevant information.
Mark
From: Christian M. <mee...@un...> - 2005年05月30日 10:36:44
Thanks, Matt!
It took me a while to understand this: Your mini-script worked like 
expected. I could change the size easily. But my own program still 
didn't react to any change in the figsize parameter.
However, as soon as I took out the toolbar, everything was fine! There 
seems to be a conflict with the sizers, which I could not solve until 
now. I will dive into this and post an update, if I find a solution.
Cheers
Christian
On 29 May 2005, at 05:08, Matt Newville wrote:
> Christian,
>
> I don't recall seeing this behavior of absurdly small figures
> and no response to figsize argement, even using wxPython 2.5.3
> on Mac OS X (though, admittedly I'm using matplotlib 0.8).
>
> The script below works fine for me, and changing the figsize
> argument to Figure() does change the figure size. Does this work
> for you -- you might have to change the wxversion.select() line,
> or just comment it out. If this works for you, can you post a
> simple, self-contained script that fails?
>
> Cheers,
>
> --Matt
>
From: Matt N. <new...@ca...> - 2005年05月29日 03:08:41
Christian,
I don't recall seeing this behavior of absurdly small figures
and no response to figsize argement, even using wxPython 2.5.3
on Mac OS X (though, admittedly I'm using matplotlib 0.8).
The script below works fine for me, and changing the figsize
argument to Figure() does change the figure size. Does this work
for you -- you might have to change the wxversion.select() line,
or just comment it out. If this works for you, can you post a
simple, self-contained script that fails?
Cheers,
--Matt
#!/usr/bin/env python
import wxversion
wxversion.select('2.5.3-mac-ansi')
import wx
print 'using wxPython version ', wx.__version__
import matplotlib
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.figure import Figure
class SimpleFrame(wx.Frame):
 def __init__(self):
 wx.Frame.__init__(self,None,-1, 'wx Matplotlib Frame')
 self.figure = Figure(figsize=(5,3),dpi=96)
 self.axes = self.figure.add_subplot(111)
 self.canvas = FigureCanvas(self, -1, self.figure)
 self.sizer = wx.BoxSizer(wx.VERTICAL)
 self.sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW|wx.EXPAND)
 self.SetSizer(self.sizer)
 self.Fit()
 
class App(wx.PySimpleApp):
 def OnInit(self):
 frame = SimpleFrame()
 frame.Show(True)
 return True
app = App(0)
app.MainLoop()
##############
From: John H. <jdh...@ac...> - 2005年05月29日 01:21:59
>>>>> "Christian" == Christian Meesters <mee...@un...> writes:
 Christian> Hm, 2.5.3.1. I know it's time to update my system, but
 Christian> this will have to wait for a while. I need to
 Christian> coordinate several modules / versions.
The figsize parameter is being respected for me on OSX 10.3 with
matplotlib 0.80 and wx 2.5.4.1.
Not sure if it is a matplotlib version or wxpythnon version that is
causing your problems. I looked through the CHANGELOG to see if there
were any obvious changes between 0.71 and 0.80 that indicated a bugfix
for wx figure sizing, but didn't see any. You might also check the
commit notes for backend_wx or backend_wxagg.
JDH
From: Christian M. <mee...@un...> - 2005年05月28日 23:51:54
On 28 May 2005, at 17:20, Ken McIvor wrote:
> On May 28, 2005, at 6:24 AM, Christian Meesters wrote:
>> Now, changing the figsize parameter has absolutely no effect on the 
>> canvas size whatsoever. Does anybody know how to change the figure 
>> size? Currently I only get a beautifully, tiny window every user 
>> needs to expand by hand ...
>
> I have been unable to reproduce this behavior using matplotlib 0.72 
> under OS X 10.3.9 with wxPython 2.6.0.0. What version of wxPython are 
> you running?
>
> Ken
>
Hm, 2.5.3.1. I know it's time to update my system, but this will have 
to wait for a while. I need to coordinate several modules / versions.
Anyway, thanks for looking into this. If it is really related to my wx 
version, there is no solution for me now. But then again, if I move my 
stuff to an updated Linux system soon, there should be no problem (at 
least not with wx ...).
Thanks,
Christian
From: Ken M. <mc...@ii...> - 2005年05月28日 15:19:28
On May 28, 2005, at 6:24 AM, Christian Meesters wrote:
> Now, changing the figsize parameter has absolutely no effect on the 
> canvas size whatsoever. Does anybody know how to change the figure 
> size? Currently I only get a beautifully, tiny window every user needs 
> to expand by hand ...
I have been unable to reproduce this behavior using matplotlib 0.72 
under OS X 10.3.9 with wxPython 2.6.0.0. What version of wxPython are 
you running?
Ken
From: Christian M. <mee...@un...> - 2005年05月28日 11:24:14
Hi,
Thanks John and Ken for your detailed replies. They came almost 
immediately, but since I'm 6-7 hours ahead of you and the weekend was 
approaching this answer took a bit longer ...
Anyway, now everything is working - finally I've got it. In contrast to 
your advise, John, I rather don't change the rc-file, for this not such 
a good idea if one wants to distribute the software at some point among 
colleagues.
May I still add a different question? As you know I'm using the WXAgg 
backend (at least in some of my scripts) and embedded essentially 
everything like in the example scripts:
class SAXS_wx(wx.Frame):
	def __init__(self,parent,id,title):
		wx.Frame.__init__(self,None,-1,"SPlot")
<snip>
		self.fig = Figure(figsize=(5,4),dpi=100)
		self.axes = self.fig.add_subplot(111)
		self.canvas = FigureCanvas(self, -1, self.fig)
		self.parent = self.canvas.GetParent()
		self.canvas.mpl_connect('motion_notify_event',self.mouse_move)
		sizer = wx.BoxSizer(wx.VERTICAL)
		self.sizer = sizer
		sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW|wx.EXPAND)
		
		self.add_splot_toolbar()
		
		self.SetSizer(self.sizer)
		self.Fit()
Now, changing the figsize parameter has absolutely no effect on the 
canvas size whatsoever. Does anybody know how to change the figure 
size? Currently I only get a beautifully, tiny window every user needs 
to expand by hand ...
Once more for the record: I'm stuck with matplotlib 0.71 on Panther (OS 
X 10.3) with Apple's framework Python 2.3 for a while.
Thanks,
Christian
From: John H. <jdh...@ac...> - 2005年05月28日 03:50:49
>>>>> "Benyang" == Benyang Tang <ben...@jp...> writes:
 Benyang> I have a quick hack of basemap to allow it to draw a
 Benyang> great circle passing the map borders. It should work for
 Benyang> the cylinder project (i.e., no projection) and a map with
 Benyang> longitude -180 to 180.
 Benyang> Instruction:
 > - Add the following to the top of the file:
 > import Numeric as Num
 > import MA
I think basemap requires numarray, presumably because of it's
dependence on nd_image, so if I'm not mistaken you example should be
rewritten to use numarray versions of the modules above. Eg,
 import numarray as Num
 import numarray.ma as MA
and so on...
JDH
From: Benyang T. <ben...@jp...> - 2005年05月27日 21:09:46
I have a quick hack of basemap to allow it to draw a great circle passing the 
map borders. It should work for the cylinder project (i.e., no projection) 
and a map with longitude -180 to 180.
Instruction:
- Edit the file:
PythonInstallDirectory/lib/python2.4/site-packages/matplotlib/toolkits/basemap/basemap.py
- Insert the following line
 x,y = fixlon(x,y)
before this line 
 self.plot(x,y,**kwargs)
- Add the following to the top of the file:
import Numeric as Num
import MA
def fixlon(lon,lat):
 if type(lon) == type([1,]) or type(lon) == type((1,)):
 lon0 = Num.array(lon)
 lat0 = Num.array(lat)
 else:
 lon0 = lon
 lat0 = lat
# 
 n = len(lon0)
 temp1 = lon0[1:] - lon0[:-1]
 temp2 = temp1>0
 np = Num.sum(temp2)
#
 isIncrease = None
 if np<=2:
 isIncrease = 1
 elif n-np<=2:
 isIncrease = 0
 else:
 print 'n, np = ', n, np
 return
#
 if not isIncrease:
 temp2 = Num.logical_not(temp2)
 temp3 = Num.nonzero(temp2)
 i0 = Num.argmax( Num.take(Num.fabs(temp1), temp3) )
 i = temp3[i0]
 print 'n,i=', n, i
# 
 lon1 = 
MA.array(Num.zeros((n+1,)),mask=Num.zeros((n+1,))).astype(lon0.typecode())
 lat1 = 
MA.array(Num.zeros((n+1,)),mask=Num.zeros((n+1,))).astype(lon0.typecode())
 lon1[:i+1] = lon0[:i+1]
 lat1[:i+1] = lat0[:i+1]
 lon1[i+2:] = lon0[i+1:]
 lat1[i+2:] = lat0[i+1:]
 lon1.mask()[i+1] = 1
 lat1.mask()[i+1] = 1
#
 return lon1, lat1
From: John H. <jdh...@ac...> - 2005年05月27日 17:32:31
>>>>> "Meesters," == Meesters, Christian <mee...@un...> writes:
 Meesters> Hi, It's me again ... I still do not find my way out of
 Meesters> the problem on how I can apply a format to the
 Meesters> numbering of an axis. I am using the WXAgg backend and
 Meesters> this is my code:
To apply a "default font" for the entire figure, you can use the rc
params -- see http://matplotlib.sf.net/.matplotlibrc, especially the
font.*, axes.* and tick.* settings
 from matplotlib import rc
 from pylab import figure, show
 rc('font', weight='bold', style='italics')
 rc('axes', labelsize=25)
 rc('tick', labelsize=14)
 fig = figure()
 ax = fig.add_subplot(111)
 ax.plot(range(10))
 ax.set_xlabel('hi')
 ax.set_ylabel('bye')
 ax.set_title('easy as 1-2-3')
 show()
You can also customize the default tick labels sizes individually. I
already noted that for the xlabel, ylabel and title you can use
kwargs, eg
 ax.set_xlabel('hi', fontsize='smaller')
and so on.
For the tick labels, you will need to get a list of the tick label
Text instances you want to customize
 labels = ax.get_xticklabels()
You can call any of the text setter methods on these labels, which are
detailed here
http://matplotlib.sourceforge.net/matplotlib.text.html#Text
For example, you can set the fontsize or fontproperty with
for label in labels:
 label.set_fontsize(mysize)
for label in labels:
 label.set_fontproperties(fp)
A lot of the methods like set_fontsize are historical artifacts from
before we had font properties, and they just forward the call to the
property
If you want finer grained control over the major and minor ticks, or
different customizations for the top and bottom ticks (on the xaxis
the top ticks are normally off but you can turn them on) you can do
that too, but it is a little more work
 # ditto for get_minor_ticks
 ticks = ax.xaxis.get_major_ticks()
 majLabelsLower = [tick.label1 for tick in ticks]
 majLabelsUpper = [tick.label2 for tick in ticks]
and then call the setter methods on these as above.
Hope this helps,
JDH
From: Ken M. <mc...@ii...> - 2005年05月27日 17:29:02
Meesters, Christian wrote:
> It's me again ... I still do not find my way out of the problem on how I can
 > apply a format to the numbering of an axis. I am using the WXAgg backend and
 > this is my code:
It sounds like you tring to change the formatting of the tick labels of the 
axes. I believe that the RC parameter `tick.labelsize' will do the trick if 
this is all you need. There are doubtless a slew of other tick-related options.
If you're trying to do something more complicated, like setup complicated font 
properties for the labels, the following approach might work.
def fontify_ticks(axes, fp):
	xticks = axes.xaxis.get_major_ticks() + axes.xaxis.get_minor_ticks()
	yticks = axes.yaxis.get_major_ticks() + axes.yaxis.get_minor_ticks()
	for t in xticks + yticks:
		t.label1.set_fontproperties(fp) # outer/upper tick label
		t.label2.set_fontproperties(fp) # inner/lower tick label
I hope this helps.
Ken
From: Meesters, C. <mee...@un...> - 2005年05月27日 17:09:17
Attachments: test.jpg
Hi,=20
It's me again ... I still do not find my way out of the problem on how I =
can apply a format to the numbering of an axis. I am using the WXAgg =
backend and this is my code:
font =3D FontProperties()
self.font =3D font.copy()
self.font.set_size('x-small')
self.font.set_family('serif')
self.font.set_style('normal')
self.font.set_variant('normal')
self.font.set_weight('light')
<snip>and then a function plot_data:
def plot_data(self):
<snip>
			a =3D self.fig.add_subplot(111)
			a.grid(self.g)
	=09
		for x,y in zip(self.active_datasets,linestyles):
			if len(self.datasets)=3D=3D1: a.set_title('Spatial Distribution of =
%s' % x.attributes['name'], fontproperties=3Dself.font, =
horizontalalignment=3D'right')
			if self.log_intensity:
				a.semilogy(x.ichannel,x.intensity,'k',y)
				a.set_xlim([0,len(x.ichannel)])
				a.set_ylabel(r'$log_{10} \rm{(Intensity [counts])}$', =
fontproperties=3Dself.font) 				a.set_xlabel(r'$\rm{channels}$', =
fontproperties=3Dself.font)
<snip>
Now, how can I apply the font to the subplot? In order to illustrate the =
problem a little bit better, I attached a part of a screen shot.
Here, with just one single subplot there is actually no problem and the =
plot would look absolutely stunning witht the default font. But with =
more than one subplot in the panel there is just not enough space to =
display all labels and the numbering on my screen.
I guess the solution is not half as complicated than the things I've =
tried. But since it is not really obvious to me, I am willing to =
contribute an example to this topic if there is not already one. Are =
there guidelines on how to file examples?
Regards,
Christian
From: Jochen V. <vo...@se...> - 2005年05月27日 10:42:53
Hello,
On Thu, May 26, 2005 at 02:25:53AM +0200, Marek Szczypinski wrote:
> form matplotlib.pylab import *
> ^
> SyntaxError: invalid syntax
you typed "form" instead of "from".
I hope this helps,
Jochen
--=20
http://seehuhn.de/
From: Eric E. <ems...@ob...> - 2005年05月27日 07:20:17
Hi,
a short note of support for the implementation of the 'None' feature in 
the facecolor,+...
It is very important to a few of us around here to be able to make 
scatter plots using unfilled markers.
Thanks a lot
Eric
-- 
===============================================================
Observatoire de Lyon ems...@ob...
9 av. Charles-Andre tel: +33 4 78 86 83 84
69561 Saint-Genis Laval Cedex fax: +33 4 78 86 83 86
France http://www-obs.univ-lyon1.fr/eric.emsellem
===============================================================
From: John H. <jdh...@ac...> - 2005年05月27日 03:43:01
>>>>> "Chris" == Chris Barker <Chr...@no...> writes:
 Chris> Why use nx, rather than n? (or N, which is what I usually
 Chris> use). Actually, I usually use "import Numeric as N", I used
 Chris> Numeric long before I discovered matplotlib.
In my own scripts, I often use N to be the size of something. And I
eschew capital letters for ease of typing. I prefer nx since it
doesn't clash with many current scripts, is easy to type, and
resonates with the current name numerix which for better or worse is
the name mpl has used for Numeric/numarray integration. I'm not wed
to "nx" though.
 Chris> I'd say that this decision should be driven somewhat by
 Chris> what you want matplotlib to be. I see it as a plotting
 Chris> package, and I see Numeric (or SciPyBase?) as a numerical
 Chris> array package. Given that, option (1) is the way to go.
 Chris> However, I can see the strong appeal of an all in one
 Chris> package, al la Matlab. If we go this route (which is kind
 Chris> of the route at the moment), we'll see lot of questions on
 Chris> this list that have nothing to do with matplotlib, and
 Chris> everything to do with Numerix. WE have that already, of
 Chris> course.
 Chris> I really would like to see a nice, unified, set of packages
 Chris> for doing scientific/numeric work with Python. I think
 Chris> SciPy is the natural place for this, NOT matplotlib. My
 Chris> ideal version would have matplotlib as a sub-package of
 Chris> SciPy. It looks like we get to the grand-unification of
 Chris> Numeric, as SciPy Base, that that's a good start. I don't
 Chris> recall why you didn't make matplotlib a subpackage of SciPy
 Chris> in the first place, but I can understand that it happened
The historical reason was that scipy was considered hard to install.
matplotlib was pure python until 0.5 or something like that, and
depended only on Numeric and pygtk. Now mpl is fairly hard to install
and much more elaborate, and scipy is getting much easier to install.
If and when the time is right, and the powers that be want to integrate
mpl with scipy, I am happy to do it. I've also raised objections in
the past on the grounds that mpl release schedules are much faster
than scipy release schedules, but we're starting to get slow and
crotchety in our old age around here as well :-)
 Chris> that way, and honestly, there have been a lot of "plotting
 Chris> for SciPy" starts, and none of them has gotten to the
 Chris> usefulness of matplotlib, so you certainly did something
 Chris> right!
Thanks. I think the key is a relentless focus on making plots "look
good" and supporting all the reasonable features that people need.
That's what drove me away from other alternatives, at least. I mean,
as a self respecting open source/scientific python zealot, you're
nowhere if your plots look like crap.
 Chris> I just looked in the class docs, and I still can't see how
 Chris> to set something in an OO way, like the facecolor, for
 Chris> example:
 Chris> x.set('facecolor', 'r') maybe?
 Chris> I know I'd rather x.SetFaceColor('r') or something like
 Chris> that, but the above is OK too.
Use 
 x.set_facecolor('r')
All matplotlib properties work this way:
 OBJECT.set_PROPNAME(VAL). 
You should also be sure get your hands on a recent version of ipython;
TAB completion is your friend. In mpl CVS, in response to this
thread, I also added support for
 x.set(facecolor='r')
which has the advantage of supporting multiple property names
 x.set(facecolor='red', linewidth=2, alpha=0.5)
 Chris> Well, yes, for embedded use, but for quick scripts and
 Chris> interactive use, there should gbe an OO way to have your
 Chris> figure windows managed.
This sounds like what I call "pythonic matplotlib": using the pylab
interface to manage the GUI windows and such, while retaining a
pythonic coding style; eg, not relying on the current figure and axes
state. See examples/pythonic_matplotlib.py
 Chris> It's probably time for me to put up or shut up...I hope
 Chris> I'll get a chance to put up soon.
 Chris> Maybe a good start would be to go through the tutorial and
 Chris> users guide, and try to re-write all the examples in an OO
 Chris> manner, and see what happens.
Sounds like as good an idea as any.
JDH
From: John H. <jdh...@ac...> - 2005年05月27日 03:18:26
>>>>> "Gavin" == Gavin Huttley <gav...@an...> writes:
 Gavin> Hi, I want to produce a scatter plot with markers that are
 Gavin> not filled (empty markers). I note the following response
 Gavin> to an earlier query regarding line2D
There is no easy way to do this well. You can set the facecolor of
the scatter RegularPolyCollection -- note that the property names
follow the standard names of matplotlib.patches, not matplotlib.lines
(eg facecolor, not markerfacecolor). To make the face colors
"invisible" you need to set the facecolor to be the same as the Axes
background color (eg "white") -- but this will not always deliver the
desired results. As you suggest, you need a way of saying "do not
draw the facecolor at all", eg facecolor=None, which is different that
drawing a facecolor as the background. 
Unfortunately, None is overloaded in matplotlib, since it can mean
"use the default", which is a typical python idiom. But we often want
it to also mean "do not draw anything". As a result, some parts of
matplotlib have the ugly hack someprop=None to mean default and
someprop='None' to mean do nothing. This is slated for destruction,
when we implement a proper RC class that can distinguish between None
meaning use a default at class initialization time (which is a little
harder than using a default a module load time) and None meaning do
nothing.
It would not be too hard in the short term to add the string 'None'
hack for the facecolor of regular polygon collections. If this is
sufficiently important to you, file a support request at the
sourceforge site and we'll add it to the list of things to do.
JDH
From: John H. <jdh...@ac...> - 2005年05月26日 19:52:38
>>>>> "Jeff" == Jeff Peery <jef...@se...> writes:
 Jeff> Hello, I am trying to learn how to plot using dates. In my
 Jeff> code I'm basically trying to do the following:
 Jeff> t1 = ['05/05/2005', '05/06/2005', '05/07/2005',
 Jeff> '05/08/2005']
 Jeff> t3 = [1,2,3,4]
 Jeff> #plot data self.axes.plot_date(t1, t3, 'bo')
 Jeff> this doesn't work for me. What does the input for plot_date
 Jeff> need to look like? Thanks.
From the plot_date help
plot_date(self, d, y, fmt='bo', tz=None, **kwargs)
 PLOT_DATE(d, y, converter, fmt='bo', tz=None, **kwargs)
 
 d is a sequence of dates represented as float days since
 0001年01月01日 UTC and y are the y values at those dates. fmt is
 a plot format string. kwargs are passed on to plot. See plot
 for more information.
 
 See matplotlib.dates for helper functions date2num, num2date
 and drange for help on creating the required floating point dates
 
 tz is the timezone - defaults to rc value
The snippet below should get you started...
 from matplotlib.dates import date2num
 from datetime import datetime
 def ymd(s):
 m,d,y = [int(num) for num in s.split('/')]
 return y,m,d
 t1 = ['05/05/2005', '05/06/2005', '05/07/2005', '05/08/2005']
 datenums = date2num([datetime(*ymd(s)) for s in t1])
See also examples/date_demo*.py in the matplotlib src distro or zipped
up here
http://matplotlib.sourceforge.net/matplotlib_examples_0.80.zip
JDH
From: Jeff P. <jef...@se...> - 2005年05月26日 19:35:36
Hello, I am trying to learn how to plot using dates. In my code I'm
basically trying to do the following:
t1 = ['05/05/2005', '05/06/2005', '05/07/2005', '05/08/2005'] 
t3 = [1,2,3,4]
#plot data
self.axes.plot_date(t1, t3, 'bo')
this doesn't work for me. What does the input for plot_date need to look
like? Thanks.
Jeff
From: Fernando P. <Fer...@co...> - 2005年05月26日 18:00:17
John Hunter wrote:
>>>>>>"Chris" == Chris Barker <Chr...@no...> writes:
> 
> 
> Chris> Fernando Perez wrote:
> 
> >> I'd also suggest removing from all example code 'from pylab
> >> import *' statements.
> 
> Chris> Here here! (hear hear?). I'd really like to see all those
> Chris> "import *"'s go away.
> 
> 
> I have no problem with this. I think we should agree on a standard
> way of writing examples. I'm of two minds about how we should do this
> vis-a-vis numerix symbols. 
> 
> Approach 1: Help educate newbies about where symbols are coming from
> 
> import pylab as p
Very minor suggestion: I prefer using capitals for these single-letter 
shortcuts for common modules, as in
import pylab as P
import scipy as S
it's just that it makes them stand out more in the body of code, where a 
single little s or p easily gets lost.
Just a little comment,
f
From: Darren D. <dd...@co...> - 2005年05月26日 16:03:48
On Wednesday 25 May 2005 9:28 pm, Marek Szczypinski wrote:
> You were right, Darren, it was the problem. from matplotlib.matlab import
> * works just fine:)
> Thanks very much.
> Marek
>
> On 2005年5月25日, Darren Dale wrote:
> > Try
> > ~> locate matplotlib
> >
> > I think you have version 0.64, which did not include the change from
> > matplotlib.matlab to matplotlib.pylab. I'll try to find someone to mark
> > the most recent version as stable in the gentoo tree. I can almost
> > guarantee this to be the source of your problem.
Well, that was quick. Matplotlib-0.71 has been marked stable in the gentoo=
=20
tree, version 0.64 and 0.65 have been removed.
From: Gavin H. <gav...@an...> - 2005年05月26日 04:36:16
Hi,
I want to produce a scatter plot with markers that are not filled (empty
markers). I note the following response to an earlier query regarding line2D
> danny> Howdy, Another stupid problem. Before .61 when I plotted
> danny> with symbols, the symbols were unfilled, now they are
> danny> filled. How do I control this? I can"t find any
> danny> markerfilled property in the Line2D class.
>
> You can override the markerfacecolor as a kwarg
>
> >>> plot(arange(10), "ro", markerfacecolor=None)
>
> You can also use the abbreviation "mfc"
>
> >>> plot(arange(10), "ro", mfc=None)
> 
When I attempt this with scatter I get an error, reflecting the fact (after
minor digging) that RegularPolyCollection doesn't have a set_markerfacecolor
method.
Any suggestions on how to solve this much appreciated.
Cheers,
Gavin
From: Alan G I. <ai...@am...> - 2005年05月26日 01:58:30
On 2005年5月25日, Darren Dale apparently wrote: 
>>> import matplotlib
>>> form matplotlib.pylab import * 
>> File "<stdin>", line 1 
>> form matplotlib.pylab import *
>> ^
>> SyntaxError: invalid syntax 
You won't know until you address the syntax error
('form').
Cheers,
Alan Isaac
From: Marek S. <ma...@as...> - 2005年05月26日 01:32:20
You were right, Darren, it was the problem. from matplotlib.matlab import 
* works just fine:)
Thanks very much.
Marek
On 2005年5月25日, Darren Dale wrote:
> Try
> ~> locate matplotlib
>
> I think you have version 0.64, which did not include the change from
> matplotlib.matlab to matplotlib.pylab. I'll try to find someone to mark the
> most recent version as stable in the gentoo tree. I can almost guarantee this
> to be the source of your problem.
>
> Darren
>
From: Darren D. <dd...@co...> - 2005年05月26日 00:55:42
On Wednesday 25 May 2005 8:25 pm, Marek Szczypinski wrote:
> I have also tried this:
> markacy@sun:~>python
> Python 2.3.5 (#1, Apr 28 2005, 10:18:07)
> [GCC 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1, ssp-3.3.5.20050130-1,
> pie- on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> from matplotlib.pylab import *
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> ImportError: No module named pylab
>
> >>> from matplotlib import *
> >>> from matplotlib.pylab import *
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> ImportError: No module named pylab
>
> >>> import matplotlib
> >>> form matplotlib.pylab import *
>
> File "<stdin>", line 1
> form matplotlib.pylab import *
> ^
> SyntaxError: invalid syntax
>
> markacy@sun:~>locate pylab
> markacy@sun:~>
>
> Still nothing... :( Please help.
> Marek
Try=20
~> locate matplotlib
I think you have version 0.64, which did not include the change from=20
matplotlib.matlab to matplotlib.pylab. I'll try to find someone to mark the=
=20
most recent version as stable in the gentoo tree. I can almost guarantee th=
is=20
to be the source of your problem.
Darren
From: Marek S. <ma...@as...> - 2005年05月26日 00:30:02
I have also tried this:
markacy@sun:~>python
Python 2.3.5 (#1, Apr 28 2005, 10:18:07)
[GCC 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, 
pie- on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from matplotlib.pylab import *
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
ImportError: No module named pylab
>>> from matplotlib import *
>>> from matplotlib.pylab import *
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
ImportError: No module named pylab
>>> import matplotlib
>>> form matplotlib.pylab import *
 File "<stdin>", line 1
 form matplotlib.pylab import *
 ^
SyntaxError: invalid syntax
>>>
markacy@sun:~>locate pylab
markacy@sun:~>
Still nothing... :( Please help.
Marek
Homo sum, humani nihil a me alienum puto.
On 2005年5月25日, Robert Kern wrote:
> Marek Szczypinski wrote:
>> Hello,
>> I am new to matplotlib. My system administrator installed matplotlib
>> (using gentoo's emerge command). There were no errors while installation,
>> but wen i try to import pylab i get an error:
>>
>> markacy@sun:~>python
>> Python 2.3.5 (#1, Apr 28 2005, 10:18:07)
>> [GCC 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1, ssp-3.3.5.20050130-1,
>> pie- on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> 
>> > > > from pylab import *
>>
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in ?
>> ImportError: No module named pylab
>
>> > > from matplotlib.pylab import *
>
> or, better:
>
> $ ipython -pylab
>
> -- 
> Robert Kern
> rk...@uc...
>
> "In the fields of hell where the grass grows high
> Are the graves of dreams allowed to die."
> -- Richard Harter
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
> online with coworkers and clients while avoiding the high cost of travel and
> communications. There is no equipment to buy and you can meet as often as
> you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
5 messages has been excluded from this view by a project administrator.

Showing results of 315

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