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





Showing 14 results of 14

From: Cheng-Kong Wu <che...@ya...> - 2008年03月12日 22:41:41
Dear all,
I created several plots and want to export them to a
Word file sequentially, how can I do that?
Thanks!
Cheng-kong
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
From: Ryan M. <rm...@gm...> - 2008年03月12日 21:49:57
Auré Gourrier wrote:
> Dear all,
> 
> I've been trying to plot a 'pixel' image of data contained in an array 
> with a given shape. The imshow() func is perfect for this however, the 
> image is usually displayed with margins within a figure. I tried to get 
> rid of this margin to get the axes in full view. However, I never 
> properly got my way around this: the outermost pixels are only partly 
> displayed or there is always a remaining border. I put some code below 
> to show this. Could anyone give me a hint on what I'm doing wrong ? What 
> I need to do, in the end is 'simply' to shift the axes by half a pixel 
> left, right and top... I tried doing so by using the axes.set_position() 
> but couldn't figure out proper values for this.
> 
> 
> #build array containing data and set correct shape
> data = np.asarray(datalist)
> data = np.reshape(data,(9,41))
> 
> #set figure to correct shape
> initsize = 10.
> width2heightratio = 9./41.
> figwidth = initsize
> figheight = initsize*width2heightratio
> fig = Figure(figwidth ,figheight )
> 
> #create axes
> axes = fig .gca()
> 
> #set to 0,0 pos to get rid of margins
> axes1.set_position((0.,0.,1.,1.))
> 
> axes.imshow(data,origin='upper')
> 
You might try fiddling with fig.subplots_adjust()
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Ryan M. <rm...@gm...> - 2008年03月12日 21:49:09
Michael Hearne wrote:
> I'm trying to understand the usage of Colormaps, 
> and LinearSegmentedColormaps in particular.
> 
> I can create segmentdata that looks like the example at the bottom of 
> this message. Each color has a 3x9 list of values.
> 
> I can then construct a LinearSegmentedColormap as follows:
> palette = LinearSegmentedColormap('my_colormap',cdict)
> 
> the 'N' attribute of my palette object reports that the length of the 
> colormap is 256. However, when I try to retrieve the color tuple for 
> any value above 50, I get black:
> 
> palette(51) => (0.0, 0.0, 0.0, 1.0)
> 
> Why aren't there 256 different colors in my colormap?
Because your color values state that for any normalized value between .2 
and 1, the color should be RGB = (0.0,0.0,0.0). In your color 
dictionary, the first number of each tuple/list specifies a value 
between 0 and 1 to go with that color level. You probably instead want 
to assign each color level to a level between 0 and 1. ie. For 5 
levels, you want 0, .25, 0.5, 0.75, 1.0.
Ryan
> --Mike
> 
> cdict = {'blue': [[0.0, 1.0, 1.0],
> [9.99999974738e-05, 0.749019622803, 0.749019622803],
> [0.0010000000475, 0.623529434204, 0.623529434204],
> [0.00200000009499, 0.498039215803, 0.498039215803],
> [0.00999999977648, 0.372549027205, 0.372549027205],
> [0.019999999553, 0.247058823705, 0.247058823705],
> [0.10000000149, 0.121568627656, 0.121568627656],
> [0.20000000298, 0.0, 0.0],
> [1.0, 0.0, 0.0]],
> 'green': [[0.0, 1.0, 1.0],
> [9.99999974738e-05, 0.749019622803, 0.749019622803],
> [0.0010000000475, 0.623529434204, 0.623529434204],
> [0.00200000009499, 0.498039215803, 0.498039215803],
> [0.00999999977648, 0.372549027205, 0.372549027205],
> [0.019999999553, 0.247058823705, 0.247058823705],
> [0.10000000149, 0.121568627656, 0.121568627656],
> [0.20000000298, 0.0, 0.0],
> [1.0, 0.0, 0.0]],
> 'red': [[0.0, 1.0, 1.0],
> [9.99999974738e-05, 0.749019622803, 0.749019622803],
> [0.0010000000475, 0.623529434204, 0.623529434204],
> [0.00200000009499, 0.498039215803, 0.498039215803],
> [0.00999999977648, 0.372549027205, 0.372549027205],
> [0.019999999553, 0.247058823705, 0.247058823705],
> [0.10000000149, 0.121568627656, 0.121568627656],
> [0.20000000298, 0.0, 0.0],
> [1.0, 0.0, 0.0]]}
> 
> 
> 
> 
> 
> ------------------------------------------------------
> Michael Hearne
> mh...@us... <mailto:mh...@us...>
> (303) 273-8620
> USGS National Earthquake Information Center
> 1711 Illinois St. Golden CO 80401
> Senior Software Engineer
> Synergetics, Inc.
> ------------------------------------------------------
> 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Michael H. <mh...@us...> - 2008年03月12日 21:22:33
I'm trying to understand the usage of Colormaps, and 
LinearSegmentedColormaps in particular.
I can create segmentdata that looks like the example at the bottom of 
this message. Each color has a 3x9 list of values.
I can then construct a LinearSegmentedColormap as follows:
palette = LinearSegmentedColormap('my_colormap',cdict)
the 'N' attribute of my palette object reports that the length of the 
colormap is 256. However, when I try to retrieve the color tuple for 
any value above 50, I get black:
palette(51) => (0.0, 0.0, 0.0, 1.0)
Why aren't there 256 different colors in my colormap?
--Mike
cdict = {'blue': [[0.0, 1.0, 1.0],
 [9.99999974738e-05, 0.749019622803, 0.749019622803],
 [0.0010000000475, 0.623529434204, 0.623529434204],
 [0.00200000009499, 0.498039215803, 0.498039215803],
 [0.00999999977648, 0.372549027205, 0.372549027205],
 [0.019999999553, 0.247058823705, 0.247058823705],
 [0.10000000149, 0.121568627656, 0.121568627656],
 [0.20000000298, 0.0, 0.0],
 [1.0, 0.0, 0.0]],
 'green': [[0.0, 1.0, 1.0],
 [9.99999974738e-05, 0.749019622803, 0.749019622803],
 [0.0010000000475, 0.623529434204, 0.623529434204],
 [0.00200000009499, 0.498039215803, 0.498039215803],
 [0.00999999977648, 0.372549027205, 0.372549027205],
 [0.019999999553, 0.247058823705, 0.247058823705],
 [0.10000000149, 0.121568627656, 0.121568627656],
 [0.20000000298, 0.0, 0.0],
 [1.0, 0.0, 0.0]],
 'red': [[0.0, 1.0, 1.0],
 [9.99999974738e-05, 0.749019622803, 0.749019622803],
 [0.0010000000475, 0.623529434204, 0.623529434204],
 [0.00200000009499, 0.498039215803, 0.498039215803],
 [0.00999999977648, 0.372549027205, 0.372549027205],
 [0.019999999553, 0.247058823705, 0.247058823705],
 [0.10000000149, 0.121568627656, 0.121568627656],
 [0.20000000298, 0.0, 0.0],
 [1.0, 0.0, 0.0]]}
------------------------------------------------------
Michael Hearne
mh...@us...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------
From: Auré G. <aur...@ya...> - 2008年03月12日 20:45:47
Dear all,
I've been trying to plot a 'pixel' image of data contained in an array with a given shape. The imshow() func is perfect for this however, the image is usually displayed with margins within a figure. I tried to get rid of this margin to get the axes in full view. However, I never properly got my way around this: the outermost pixels are only partly displayed or there is always a remaining border. I put some code below to show this. Could anyone give me a hint on what I'm doing wrong ? What I need to do, in the end is 'simply' to shift the axes by half a pixel left, right and top... I tried doing so by using the axes.set_position() but couldn't figure out proper values for this.
#build array containing data and set correct shape
data = np.asarray(datalist)
data = np.reshape(data,(9,41))
#set figure to correct shape
initsize = 10.
width2heightratio = 9./41.
figwidth = initsize
figheight = initsize*width2heightratio
fig = Figure(figwidth ,figheight )
#create axes
axes = fig .gca()
#set to 0,0 pos to get rid of margins
axes1.set_position((0.,0.,1.,1.)) 
axes.imshow(data,origin='upper')
 _____________________________________________________________________________ 
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr 
From: Robin <ro...@gm...> - 2008年03月12日 19:50:32
On Wed, Mar 12, 2008 at 7:37 PM, Christiaan Putter
<cep...@go...> wrote:
>
> Look for a thread titled 'subplots from existing figures' (5th March) or
> something similar. I posted a function there that takes in a list of
> figures and spits out a new one containing those. There is still a bug in
> it though. For some reason copying axes from one figure to another seems to
> be broken. ie. the axes can't be resized properly after being copied.
I had tried a similar thing, only less general (I only had two plots
to add to the same figure). I hit the same problem - the axes wouldn't
resize when the window was resized, and also some of my axes tick
labels were lost (oddly the first xticklabel was there but the others
were missing).
I found a way round it by getting the individual plotting functions to
accept an optional axes argument that they plot to...
def make_one_fig(ax=None):
 fig = None
 if ax is None:
 fig = figure() ...
 ax = fig.add_subplot(111)
 ax.plot (..)
 return fig
Then if called without ax set this plots as before, but if you want to
build up a set of plots:
fig = figure()
ax = fig.subplot(211)
make_one_plot(ax=ax)
etc
Robin
From: Christiaan P. <cep...@go...> - 2008年03月12日 19:37:17
Dear Mr. Zickermann,
Look for a thread titled 'subplots from existing figures' (5th March) or
something similar. I posted a function there that takes in a list of
figures and spits out a new one containing those. There is still a bug in
it though. For some reason copying axes from one figure to another seems to
be broken. ie. the axes can't be resized properly after being copied.
I'm still waiting for a developer to comment on that. I don't know if my
function is doing the copying wrong or if there is some other underlying
error.
Regards,
cputter
On 12/03/2008, Dirk Zickermann <dir...@go...> wrote:
>
> Dear usegroup,
> for the generation of measurement reports I look for a possibility to
> merge multiple plots to one.
> My plan (not the best one I think..):
>
> I generate a figure in an external functions and receive a list of
> figures like
>
> def make_one_fig():
> thisfig = figure() ...
> plot (..)
> return thisfig
> ..
> onefig = make_one_fig()
> figurelist.append(onefig)
> ..
> merge_figurelist_to_one_plot(figurelist)
>
> show()
>
> This does not work and I believe my strategy is bad. Has anybody an idea,
> how to merge a list of figures to one plot?
> Thanks a lot,
> Dirk
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Chris W. <ch...@si...> - 2008年03月12日 16:02:45
Hi All,
I hope this isn't considered off topic here, but this has been bugging 
me for a while and I reckon you guys may be able to help. To boot, I'd 
like to use matplotlib to make it happen, so I figure this list is fair 
game ;-)
So, I have a series of measurements at points in time, eg:
2007年09月01日 - 5000
2008年01月01日 - 8000
2008年02月01日 - 9000
...and I'm looking to create some type of visualisation that indicates 
usage over time.
The import point is that the gaps between point measurements are not 
constant, so a straight bar chart won't be right.
The points also won't necessarilly be as convenient as those above, but 
hopefully they'll work as an example: What I'd expect to see would 
indicate that the monthly usage between September 1st and January 1st 
was, on average, the same as that between January 1st and February 1st.
I'm having trouble expressing myself clearly, but hopefully I'm making 
some kind of sense.
Any ideas very greatfully recieved!
cheers,
Chris
-- 
Simplistix - Content Management, Zope & Python Consulting
 - http://www.simplistix.co.uk
From: Ryan M. <rm...@gm...> - 2008年03月12日 13:42:58
Matthias Michler wrote:
> Hello Chris,
> 
> maybe I don't know exactly what you want to do - let me try once more:
> You try to plot a line where point need to be added, isn't it?
> My first idea was that there should be independent points.
> 
> maybe something like the following helps you:
> -----------------------------------------------------------------------------------------
> from pylab import *
> from time import sleep
> 
> ion() # interactive mode 'on'
> figure()
> ax = subplot(111, autoscale_on=True)
> 
> x, y = [0], [0]
> line = plot(x, y, label="my_data")[0] 
> # get the line-object as the first element 
> # of the tuple returned by plot
> legend()
> for i in arange(10):
> x.append(i) # append new values
> y.append(i**2)
> line.set_data(x,y) # reset data
> ax.relim() # reset axes limits
> ax.autoscale_view() # rescale axes
> draw() # redraw current figure
> sleep(0.5) # wait 0.5 seconds
> 
> ioff()
> show()
> --------------------------------------------------------------------------------
> 
> I don't know how to make this somehow interactive concerning the data input. 
> but maybe you save the data to a file and read them every 15 or 20 minutes.
You could combine this with the stuff in dynamic_demo* and 
dynamic_image* in the examples directory. Basically, you write some 
kind of handler that the gui mainloop repeatedly calls, which would 
handle reading the data and updating the plot like you did above.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Dirk Z. <dir...@go...> - 2008年03月12日 10:57:56
Dear usegroup,
for the generation of measurement reports I look for a possibility to merge
multiple plots to one.
My plan (not the best one I think..):
I generate a figure in an external functions and receive a list of figures
like
def make_one_fig():
 thisfig = figure() ...
 plot (..)
 return thisfig
..
onefig = make_one_fig()
figurelist.append(onefig)
..
merge_figurelist_to_one_plot(figurelist)
show()
This does not work and I believe my strategy is bad. Has anybody an idea,
how to merge a list of figures to one plot?
Thanks a lot,
Dirk
From: Mark B. <ma...@gm...> - 2008年03月12日 10:33:46
Hello -
I recently upgraded to 0.91.2, and export of mathtext to eps files seems
broken (at least with the default matplotlibrc file).
Figure looks great on the screen (interactive mode). Exporting to png still
works fine.
But writing to eps file, the greek symbols (I tried \theta and
\lambda) don't show up at all, while the latin symbols (a,b,c,etc) look very
ugly (different font than used to). Any suggestions?
Thanks, Mark
From: Matthias M. <Mat...@gm...> - 2008年03月12日 10:24:45
Hello Chris,
maybe I don't know exactly what you want to do - let me try once more:
You try to plot a line where point need to be added, isn't it?
My first idea was that there should be independent points.
maybe something like the following helps you:
-----------------------------------------------------------------------------------------
from pylab import *
from time import sleep
ion() # interactive mode 'on'
figure()
ax = subplot(111, autoscale_on=True)
x, y = [0], [0]
line = plot(x, y, label="my_data")[0] 
 # get the line-object as the first element 
 # of the tuple returned by plot
legend()
for i in arange(10):
 x.append(i) # append new values
 y.append(i**2)
 line.set_data(x,y) # reset data
 ax.relim() # reset axes limits
 ax.autoscale_view() # rescale axes
 draw() # redraw current figure
 sleep(0.5) # wait 0.5 seconds
ioff()
show()
--------------------------------------------------------------------------------
I don't know how to make this somehow interactive concerning the data input. 
but maybe you save the data to a file and read them every 15 or 20 minutes.
best regards 
Matthias
On Tuesday 11 March 2008 19:37, Chris Withers wrote:
> Chris Withers wrote:
> > Matthias Michler wrote:
> >> plot([x1], [y1], "bo", [x2], [y2], "r+")
> >
> > This didn't work :-S
> >
> > - the first time I call show(), execution never comes back to my script
> > so the code never gets to plot any further points
>
> Okay, thanks to Ryan, I now have this point fixed, however, with the
> following code:
>
> ion()
> i = 1
> while i < 5:
> plot([i],[i],'go',[i],[i+2],'ro')
> print i
> i+=1
> sleep(0.5)
> draw()
>
> - there are no lines between the points, how do I get the lines to show?
see above - please
> - how would I pass keyword parameters such as "label" or use other
> methods such as plot_date?
>
> Also, when the above script finishes, I get:
>
> Fatal Python error: PyEval_RestoreThread: NULL tstate
>
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
>
> What does that mean?
Sorry I have no idea why that happens on your system
> cheers,
>
> Chris
From: Jae-Joon L. <lee...@gm...> - 2008年03月12日 06:55:58
Hi,
I often do this with ds9 and funtools.
ds9 is an astronomy-oriented image viewer (http://hea-www.harvard.edu/RD/ds9/)
but you can also use it with numpy array.
Within ds9, you can define regions (ellipse, polynomial, etc) easily
with a mouse.
After you define a region (and save it as a file), you can convert it
to a mask image
with funtools (funtools is a name of an astronomy-oriented image
utility pacakge).
funtools only support fits file (image format in astronomy) so this
can be a bit tricky, but if you're
interested i'll send my python wrapper code for it.
So, take a look at ds9 and see it fits your need.
To view numpy array in ds9,
 *. From python, save the array as a file (tofile method, better use
"arr" as an extension)
 * in ds9, file-> open others -> open array. You need to select
array dimension, type and endianness of the array.
Regards,
-JJ
On Sat, Mar 8, 2008 at 11:17 AM, Chiara Caronna
<chi...@ho...> wrote:
>
> Hello,
> I am also interested in masking polygons and defining the polygon by
> 'clicking' on the image... but I do not know anything about GUI.... does
> anyone can help? Is there already something implemented?
> Thanks!
> Chiara
>
> > Date: 2008年1月23日 13:50:15 +1300
> > From: am...@gm...
> > To: mat...@li...
> > Subject: Re: [Matplotlib-users] Polygon masking possible?
>
>
> >
> > Hi Søren,
> >
> > I've put this back on the list in case it's useful to anyone else, or
> > if there are better suggestions or improvements around. Hope you don't
> > mind.
> >
> > On 22/01/2008, Søren Nielsen <sor...@gm...> wrote:
> > > Yeah i'd like to see your code if I can..
> >
> > import numpy as n
> >
> > def get_poly_pts(x, y, shape):
> > """Creates convex polygon mask from list of corners.
> >
> > Parameters
> > ----------
> > x : array_like
> > x co-ordinates of corners
> > y : array_like
> > y co-ordinates of corners, in order corresponding to x
> > shape : array_like
> > dimension sizes of result
> >
> > Returns
> > -------
> > build : ndarray
> > 2-D array of shape shape with values True inside polygon
> >
> > Notes
> > -----
> > Code is constrained to convex polygons by "inside"
> > assessment criterion.
> >
> > """
> > x = n.asarray(x)
> > y = n.asarray(y)
> > shape = n.asarray(shape)
> > npts = x.size # should probably assert x.size == y.size
> > inds = n.indices( shape )
> > xs = inds[0]
> > ys = inds[1]
> > xav = n.round(x.mean()).astype(int)
> > yav = n.round(y.mean()).astype(int)
> > for i in xrange(npts): # iterate over pairs of co-ordinates
> > j = (i + 1) % npts
> > m = (y[j] - y[i])/(x[j] - x[i])
> > c = (x[j] * y[i] - x[i] * y[j])/(x[j] - x[i])
> > thisone = ( ys > m * xs + c )
> > if thisone[xav, yav] == False:
> > thisone = ~thisone
> > if i == 0:
> > build = thisone
> > else:
> > build &= thisone
> > return build
> >
> > (released under BSD licence)
> >
> > > I just needed the push over the edge to know how to draw on the canvas,
> > > mapping clicks etc. since i'm still fairly new to matplotlib, so I think
> > > your code will be helpfull.
> >
> > I hope so. As you can see this code doesn't do any of the drawing or
> > click collecting, but the cookbook page should be able to guide you
> > there. Ask again on the list if you have any further questions and
> > we'll see if we can help.
> >
> > Also, the code assumes that the average co-ordinate is inside the
> > shape - that's true for convex polygons, but not necessarily for
> > arbitrary ones. I use if after taking a convex hull of a greater list
> > of points (using the delaunay module in scipy (now in scikits, I
> > hear)), which ensures convexity. You just need to be aware of that
> > limitation.
> >
> > Cheers,
> >
> > A.
> > --
> > AJC McMorland, PhD candidate
> > Physiology, University of Auckland
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> ________________________________
> Express yourself instantly with MSN Messenger! MSN Messenger
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: <Jou...@xt...> - 2008年03月12日 05:41:16
Rich Shepard <rsh...@ap...> writes:
> On 2008年3月11日, Michael Droettboom wrote:
>> I would first try to track down which font file it is, and then send it to me 
>> off list and I'll have a look at what might be tripping up matplotlib.
>
> I'm not sure that I know which font file is the problem. 
[...]
> File "/usr/lib/python2.5/site-packages/matplotlib/afm.py", line 282, in parse_afm
> dcmetrics_ascii, dcmetrics_name = _parse_char_metrics(fh)
> File "/usr/lib/python2.5/site-packages/matplotlib/afm.py", line 166, in _parse_char_metrics
> name = vals[2].split()[1]
> IndexError: list index out of range
Try this to debug the problem:
python -i your-script.py
 (wait for the traceback)
>>> from pdb import pm
>>> pm()
(Pdb) p vals
(Pdb) up
(Pdb) p fh
The command "p fh" should show the name of the font file. You can exit
the debugger with Ctrl-D, or type "help" to see all the commands if you
wish to explore the problem further.
You need to write the "from pdb import pm" and "pm()" lines carefully,
because if any typo causes another traceback, the previous one is
forgotten.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks

Showing 14 results of 14

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