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) |
|
|
|
|
|
|
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: Wed, 23 Jan 2008 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 Tue, 11 Mar 2008, 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 |
|
From: Steve S. <el...@gm...> - 2008-03-11 21:35:01
|
On Tue, Mar 11, 2008 at 01:23:55PM -0700, eliss wrote:
> On 3/11/08, Steve Schmerler <el...@gm...> wrote:
> >
> > On Tue, Mar 11, 2008 at 12:45:21PM -0700, eliss wrote:
> > > The API for the plot function states that the line thickness can only be
> > a
> > > single floating point number.
> > >
> >
> > Really? Try
> >
> > plot([1,2,3], lw=math.pi)
> >
> > cheers,
> > steve
>
>
> Sorry, I don't get your point. math.pi is just a single floating point
> number. How can I use that to create lines with variable thickness?
Ah sorry for the noise, I didn't read your message well. I somehow thought you
ment an *integer* rather than a float.
So, I'm not sure whether you want a single line that changes width and color or
several lines that change. In the latter case you could of course just loop over
your properties. Something like
x = linspace(0,3,50)
for w in [0,1,2,3,4,5]:
plot(x, sin(x*w), lw=w, color=(w/5.0,0,(5-w)/5.0));
If you don't want that, then the example from Troels Kofoed Jacobsen will be
a nice way to go. Didn't know about mlab.poly_between. Didn't find it in the
CHANGELOG.
cheers,
steve
|
|
From: Rich S. <rsh...@ap...> - 2008-03-11 21:25:27
|
On Tue, 11 Mar 2008, Michael Droettboom wrote:
> I suspect there is an .afm font file on your new system that is untested with
> matplotlib and exhibiting something "new".
>
> 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.
Mike,
I'm not sure that I know which font file is the problem. Here's the output
from trying to run my application on python-2.5 (the top two lines are
repeated many times before we get to the traceback):
Found an unknown keyword in AFM header (was Underline)
Found an unknown keyword in AFM header (was Underline)
Traceback (most recent call last):
File "eikos.py", line 3, in <module>
import wx, serial, os, config, functions
File "/home/rshepard/projects/eikos/functions.py", line 7, in <module>
import pylab as p
File "/usr/lib/python2.5/site-packages/pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "/usr/lib/python2.5/site-packages/matplotlib/pylab.py", line 208, in <module>
from matplotlib import mpl # pulls in most modules
File "/usr/lib/python2.5/site-packages/matplotlib/mpl.py", line 3, in <module>
from matplotlib import axis
File "/usr/lib/python2.5/site-packages/matplotlib/axis.py", line 20, in <module>
from font_manager import FontProperties
File "/usr/lib/python2.5/site-packages/matplotlib/font_manager.py", line 1132, in <module>
_rebuild()
File "/usr/lib/python2.5/site-packages/matplotlib/font_manager.py", line 1123, in _rebuild
fontManager = FontManager()
File "/usr/lib/python2.5/site-packages/matplotlib/font_manager.py", line 913, in __init__
self.afmdict = createFontDict(self.afmfiles, fontext='afm')
File "/usr/lib/python2.5/site-packages/matplotlib/font_manager.py", line 512, in createFontDict
font = afm.AFM(fh)
File "/usr/lib/python2.5/site-packages/matplotlib/afm.py", line 294, in __init__
parse_afm(fh)
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
If it's relevant to the issue, I no longer have ~/.matplotlib/fonts.cache as someone
suggested yesterday that I delete it, and it's not been regenerated.
Thanks,
Rich
--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
|
|
From: eliss <eli...@gm...> - 2008-03-11 21:22:24
|
On 3/11/08, Troels Kofoed Jacobsen <tkj...@gm...> wrote: > > On Tue, Mar 11, 2008 at 01:23:04PM -0700, eliss wrote: > > > > On 3/11/08, Troels Kofoed Jacobsen <[1]tkj...@gm...> wrote: > > > > On Tue, Mar 11, 2008 at 12:45:21PM -0700, eliss wrote: > > > > > > Hi, does anyone know of a way to create lines with variable > > thickness > > > and color when doing a plot? > > > Basically, I'd like to have a third dimension represented > using > > > thickness. The API for the plot function states that the line > > thickness > > > can only be a single floating point number. > > > Thanks > > I don't know if this is the easiest way, but it can be done with > > clever use of fill: > > from pylab import * > > x = linspace(0,10,101) > > y = cos(x) > > z = sin(3*x)+2 > > zn = 0.05*z > > xs, ys = mlab.poly_between(x, y-zn, y+zn) > > fill(xs, ys) > > show() > > Best Regards > > > > > > Thanks for the reply. I couldn't find the "poly_between" function in > > mlab. I imported my mlab, and did dir(mlab) but that method doesn't > > show up in there. I tried redownloading the latest version of > > matplotlib as well. Am I missing a library? > > > > References > > > > 1. mailto:tkj...@gm... > > > > ------------------------------------------------------------------------- > > 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 > > I have version 0.91.2 of matplotlib and for me the function is there. > > (I found it in the fill_between.py example) Ah, my os did not have the latest package in the repository so I had to build it. Works now. Thanks! |
|
From: Troels K. J. <tkj...@gm...> - 2008-03-11 20:55:20
|
On Tue, Mar 11, 2008 at 01:23:04PM -0700, eliss wrote: > > On 3/11/08, Troels Kofoed Jacobsen <[1]tkj...@gm...> wrote: > > On Tue, Mar 11, 2008 at 12:45:21PM -0700, eliss wrote: > > > > Hi, does anyone know of a way to create lines with variable > thickness > > and color when doing a plot? > > Basically, I'd like to have a third dimension represented using > > thickness. The API for the plot function states that the line > thickness > > can only be a single floating point number. > > Thanks > I don't know if this is the easiest way, but it can be done with > clever use of fill: > from pylab import * > x = linspace(0,10,101) > y = cos(x) > z = sin(3*x)+2 > zn = 0.05*z > xs, ys = mlab.poly_between(x, y-zn, y+zn) > fill(xs, ys) > show() > Best Regards > > > Thanks for the reply. I couldn't find the "poly_between" function in > mlab. I imported my mlab, and did dir(mlab) but that method doesn't > show up in there. I tried redownloading the latest version of > matplotlib as well. Am I missing a library? > > References > > 1. mailto:tkj...@gm... > ------------------------------------------------------------------------- > 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 I have version 0.91.2 of matplotlib and for me the function is there. (I found it in the fill_between.py example) -- Troels Kofoed Jacobsen tkj...@gm... tel: +45 20880798 |
|
From: eliss <eli...@gm...> - 2008-03-11 20:23:09
|
On 3/11/08, Troels Kofoed Jacobsen <tkj...@gm...> wrote: > > On Tue, Mar 11, 2008 at 12:45:21PM -0700, eliss wrote: > > > > Hi, does anyone know of a way to create lines with variable thickness > > and color when doing a plot? > > Basically, I'd like to have a third dimension represented using > > thickness. The API for the plot function states that the line > thickness > > can only be a single floating point number. > > Thanks > > I don't know if this is the easiest way, but it can be done with clever > use of fill: > > from pylab import * > > x = linspace(0,10,101) > y = cos(x) > z = sin(3*x)+2 > zn = 0.05*z > > xs, ys = mlab.poly_between(x, y-zn, y+zn) > fill(xs, ys) > show() > > Best Regards Thanks for the reply. I couldn't find the "poly_between" function in mlab. I imported my mlab, and did dir(mlab) but that method doesn't show up in there. I tried redownloading the latest version of matplotlib as well. Am I missing a library? |
|
From: Steve S. <el...@gm...> - 2008-03-11 20:11:46
|
On Tue, Mar 11, 2008 at 12:45:21PM -0700, eliss wrote:
> The API for the plot function states that the line thickness can only be a
> single floating point number.
>
Really? Try
plot([1,2,3], lw=math.pi)
cheers,
steve
|
|
From: Troels K. J. <tkj...@gm...> - 2008-03-11 20:08:26
|
On Tue, Mar 11, 2008 at 12:45:21PM -0700, eliss wrote: > > Hi, does anyone know of a way to create lines with variable thickness > and color when doing a plot? > Basically, I'd like to have a third dimension represented using > thickness. The API for the plot function states that the line thickness > can only be a single floating point number. > Thanks > ------------------------------------------------------------------------- > 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 I don't know if this is the easiest way, but it can be done with clever use of fill: from pylab import * x = linspace(0,10,101) y = cos(x) z = sin(3*x)+2 zn = 0.05*z xs, ys = mlab.poly_between(x, y-zn, y+zn) fill(xs, ys) show() Best Regards -- Troels Kofoed Jacobsen tkj...@gm... tel: +45 20880798 |
|
From: eliss <eli...@gm...> - 2008-03-11 19:45:23
|
Hi, does anyone know of a way to create lines with variable thickness and color when doing a plot? Basically, I'd like to have a third dimension represented using thickness. The API for the plot function states that the line thickness can only be a single floating point number. Thanks |
|
From: Chris W. <ch...@si...> - 2008-03-11 18:37:42
|
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?
- 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?
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
|
|
From: Jeff W. <js...@fa...> - 2008-03-11 18:29:45
|
mbauer wrote:
> Matplotlib users,
>
> I've been using pcolor and pcolormesh to plot results from the NCEP
> Reanalysis. I've noticed that the plotted values are slightly offset.
> Googling around I see that matlab has this quality, which I assume
> matplotlib inherited.
>
> # If your georeferenced image is in lat/long coordinates (i.e.
> each data row is along a line of
> constant latitude, each column a line of equal longitude), ...
> you MUST remember to offset your
> coordinates by one-half of the pixel spacing. This is because
> of the different behaviors of
> p_color and image when given the same data.
> 1. image will center the drawn (i,j) pixel on the (i,j)th entry of
> the X/Y matrices.
> 2. p_color with shading flat will draw a panel between the (i,j),
> (i+1,j),(i+1,j+1),(i,j+1)
> coordinates of the X/Y matrices with a color corresponding to
> the data value at (i,j). Thus
> everything will appear shifted by one half a pixel spacing.
>
> and
> % Since the grid is rectangluar in lat/long (i.e. not
> % really a projection at all, althouhg it is included in
> % m_map under the name 'equidistant cyldindrical'), we
> % don't want to use the 'image' technique. Instead...
> % Create a grid, offsetting by half a grid point to account
> % for the flat pcolor
> [Plg,Plt]=meshgrid(Plon-0.25,Plat+0.25);
>
> The data I'm using uses polar grids centered on +-90.0 which give a
> latitude array as such
> [-90. -87.5 -85. -82.5 -80. -77.5 -75. -72.5 -70. -67.5 -65. -62.5
> -60. -57.5 -55. -52.5 -50. -47.5 -45. -42.5 -40. -37.5 -35.
> -32.5
> -30. -27.5 -25. -22.5 -20. -17.5 -15. -12.5 -10. -7.5 -5.
> -2.5
> 0. 2.5 5. 7.5 10. 12.5 15. 17.5 20. 22.5 25.
> 27.5
> 30. 32.5 35. 37.5 40. 42.5 45. 47.5 50. 52.5 55.
> 57.5
> 60. 62.5 65. 67.5 70. 72.5 75. 77.5 80. 82.5 85.
> 87.5
> 90. ]
>
> Is there a simple way to "shift" this data so my global plots look
> correct? So far my results result in an "empty" line along the south
> pole or I end up with an extra latitude which pcolor doesn't like.
>
> Thanks,
>
> Mike
>
>
Mike: From the pcolor docstring:
X and Y, if given, specify the (x,y) coordinates of the colored
quadrilaterals; the quadrilateral for C[i,j] has corners at
(X[i,j],Y[i,j]), (X[i,j+1],Y[i,j+1]), (X[i+1,j],Y[i+1,j]),
(X[i+1,j+1],Y[i+1,j+1]). Ideally the dimensions of X and Y
should be one greater than those of C; if the dimensions are the
same, then the last row and column of C will be ignored.
So it may be easier to modify your data (by averaging adjacent values to
they reflect the mid-point of each grid box) than to modify the vertices.
-Jeff
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
|
|
From: mbauer <mb...@gi...> - 2008-03-11 17:22:00
|
Matplotlib users,
I've been using pcolor and pcolormesh to plot results from the NCEP
Reanalysis. I've noticed that the plotted values are slightly offset.
Googling around I see that matlab has this quality, which I assume
matplotlib inherited.
# If your georeferenced image is in lat/long coordinates (i.e.
each data row is along a line of
constant latitude, each column a line of equal longitude), ...
you MUST remember to offset your
coordinates by one-half of the pixel spacing. This is because
of the different behaviors of
p_color and image when given the same data.
1. image will center the drawn (i,j) pixel on the (i,j)th entry of
the X/Y matrices.
2. p_color with shading flat will draw a panel between the (i,j),
(i+1,j),(i+1,j+1),(i,j+1)
coordinates of the X/Y matrices with a color corresponding to
the data value at (i,j). Thus
everything will appear shifted by one half a pixel spacing.
and
% Since the grid is rectangluar in lat/long (i.e. not
% really a projection at all, althouhg it is included in
% m_map under the name 'equidistant cyldindrical'), we
% don't want to use the 'image' technique. Instead...
% Create a grid, offsetting by half a grid point to account
% for the flat pcolor
[Plg,Plt]=meshgrid(Plon-0.25,Plat+0.25);
The data I'm using uses polar grids centered on +-90.0 which give a
latitude array as such
[-90. -87.5 -85. -82.5 -80. -77.5 -75. -72.5 -70. -67.5 -65. -62.5
-60. -57.5 -55. -52.5 -50. -47.5 -45. -42.5 -40. -37.5 -35.
-32.5
-30. -27.5 -25. -22.5 -20. -17.5 -15. -12.5 -10. -7.5 -5.
-2.5
0. 2.5 5. 7.5 10. 12.5 15. 17.5 20. 22.5 25.
27.5
30. 32.5 35. 37.5 40. 42.5 45. 47.5 50. 52.5 55.
57.5
60. 62.5 65. 67.5 70. 72.5 75. 77.5 80. 82.5 85.
87.5
90. ]
Is there a simple way to "shift" this data so my global plots look
correct? So far my results result in an "empty" line along the south
pole or I end up with an extra latitude which pcolor doesn't like.
Thanks,
Mike
|
|
From: Rich F. <wha...@fs...> - 2008-03-11 16:56:24
|
> Rich: What are X and Y set to? They should be the map projection > coorindates of the grid. If they are latitudes and longitudes, this > will work for 'cyl' but not 'merc'. For 'merc', you must convert the > lats and lons to x and y using > > x, y = mp(lon, lat) > > -Jeff > Thanks Jeff, that did the trick ... I am working with lats/longs and I assumed that the conversion would be automatic for some reason. Rich |
|
From: Jeff W. <js...@fa...> - 2008-03-11 16:29:29
|
Rich Fought wrote: > Hi, > > I've successfully plotted gridded data on a basemap "cyl" projection > using pcolor: > > mp = Basemap(projection="cyl", resolution="l", llcrnrlon=0.0, > urcrnrlon=30.0, llcrnrlat=-5.0, urcrnrlat=5.0) > pc = mp.pcolor(X, Y, zvalsm, cmap=cm.jet) > > However, if I simply I change the projection type to merc, adding > appropriate lat_ts, I get the projection but the pcolor fails to plot on > it: > > mp = Basemap(projection="merc", lat_ts=0.0, resolution="l", > llcrnrlon=0.0, urcrnrlon=30.0, llcrnrlat=-5.0, urcrnrlat=5.0)' > pc = mp.pcolor(X, Y, zvalsm, cmap=cm.jet) > > Any ideas? I am using matplotlib 0.91.2 and basemap 0.9.9 on CentOS 4.0 > with Python 2.3. > > Thanks, > Rich > > Rich: What are X and Y set to? They should be the map projection coorindates of the grid. If they are latitudes and longitudes, this will work for 'cyl' but not 'merc'. For 'merc', you must convert the lats and lons to x and y using x, y = mp(lon, lat) -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-124 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: Michael D. <md...@st...> - 2008-03-11 16:17:11
|
.get_paths() returns a list of Path objects. (See path.py). For each Path object, you can get an Nx2 array of vertices from its "vertices" member. You can also use the "iter_segments" method to iterate through each of its vertices, but that's primarily only useful when there may be bezier curves in the path, which there won't be in the case of contours. Missing docstrings is definitely a problem that will need to be worked on. Cheers, Mike hu...@ya... wrote: > Hello, > > I'm using a svn version of matplotlib and the API changed for contour. I want > to have the coordinate of the contour. Before Eric Firing (I think) gave a > solution to do it: > > val = contour(xRange,yRange,delchi2,[1]) > t = asarray(val.collections[0].get_verts()) > > but now get_verts doesn't exist anymore. > > I tried to do: > > cs = contour(a) > path = cs.collections[0].get_paths() > > but I don't know how to use it. Basically I think that I have the contour > coordinate but I don't know how to recuperate them. I need it to export them > in a data file so it's the reason I want to recuperate them. > > Thank you for any help > > N. > > ps: It's a little bit difficult to access to the help for a method now some, > perhaps most, of them are missing a docstring. So it's difficult to > understand what it is the meaning of each of them. > > example: > > col.get_paths? > Type: instancemethod > Base Class: <type 'instancemethod'> > String Form: <bound method LineCollection.get_paths of > <matplotlib.collections.LineCollection object at 0x9038a4c>> > Namespace: Interactive > File: /usr/lib/python2.5/site-packages/matplotlib/collections.py > Definition: col.get_paths(self) > Docstring: > <no docstring> > > > > > > ------------------------------------------------------------------------- > 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 > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Rich F. <wha...@fs...> - 2008-03-11 15:53:04
|
Hi, I've successfully plotted gridded data on a basemap "cyl" projection using pcolor: mp = Basemap(projection="cyl", resolution="l", llcrnrlon=0.0, urcrnrlon=30.0, llcrnrlat=-5.0, urcrnrlat=5.0) pc = mp.pcolor(X, Y, zvalsm, cmap=cm.jet) However, if I simply I change the projection type to merc, adding appropriate lat_ts, I get the projection but the pcolor fails to plot on it: mp = Basemap(projection="merc", lat_ts=0.0, resolution="l", llcrnrlon=0.0, urcrnrlon=30.0, llcrnrlat=-5.0, urcrnrlat=5.0)' pc = mp.pcolor(X, Y, zvalsm, cmap=cm.jet) Any ideas? I am using matplotlib 0.91.2 and basemap 0.9.9 on CentOS 4.0 with Python 2.3. Thanks, Rich |
|
From: <hu...@ya...> - 2008-03-11 15:44:26
|
Hello,
I'm using a svn version of matplotlib and the API changed for contour. I want
to have the coordinate of the contour. Before Eric Firing (I think) gave a
solution to do it:
val = contour(xRange,yRange,delchi2,[1])
t = asarray(val.collections[0].get_verts())
but now get_verts doesn't exist anymore.
I tried to do:
cs = contour(a)
path = cs.collections[0].get_paths()
but I don't know how to use it. Basically I think that I have the contour
coordinate but I don't know how to recuperate them. I need it to export them
in a data file so it's the reason I want to recuperate them.
Thank you for any help
N.
ps: It's a little bit difficult to access to the help for a method now some,
perhaps most, of them are missing a docstring. So it's difficult to
understand what it is the meaning of each of them.
example:
col.get_paths?
Type: instancemethod
Base Class: <type 'instancemethod'>
String Form: <bound method LineCollection.get_paths of
<matplotlib.collections.LineCollection object at 0x9038a4c>>
Namespace: Interactive
File: /usr/lib/python2.5/site-packages/matplotlib/collections.py
Definition: col.get_paths(self)
Docstring:
<no docstring>
|