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
(9) |
2
(11) |
3
(2) |
|
4
|
5
(6) |
6
(1) |
7
(6) |
8
(7) |
9
(16) |
10
(6) |
|
11
(2) |
12
(13) |
13
(3) |
14
(6) |
15
(6) |
16
(19) |
17
(2) |
|
18
(1) |
19
(1) |
20
(11) |
21
(5) |
22
(4) |
23
(7) |
24
(14) |
|
25
(15) |
26
(27) |
27
(26) |
28
(7) |
29
(2) |
30
(7) |
|
|
From: Rich S. <rsh...@ap...> - 2007-11-27 18:13:20
|
On Tue, 27 Nov 2007, Eric Firing wrote: > Or just keep track of the axes object when it is created. In > embedding_in_wx.py: > > def plot_data(self): > # Use ths line if using a toolbar > a = self.fig.add_subplot(111) > > "a" is the axes instance. Eric, Thanks. I had not picked that up. 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: Rich S. <rsh...@ap...> - 2007-11-27 18:12:08
|
On Tue, 27 Nov 2007, Michael Droettboom wrote: > You can get the axes through the Figure instance. (I don't know how you have > your embedding set up, but if it's something like embedding_in_wx.py, there's > the line "self.fig = Figure((9, 8), 75)", so self.fig is a Figure instance). Thanks, Mike. As I'm just starting with matplotlib I need to climb the learning curve as quickly as I can. Thanks for the pointers, 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: J.D. H. <jot...@gm...> - 2007-11-27 18:10:34
|
Hello, I'm using boost python to run python embedded in a C++ application on windows. I would like to be able to have the scripts that run in this embedded environment be able to display matplotlib plots. I have searched in vain for information on the nuances of running matplotlib pylab plots in an embedded c++ environment and am hoping someone can help me out. My C++ application has an event handler to run a python script when the use= r so chooses. From this main message thread I execute a script file (using boost::python::exec_file() ) and if that script does a pylab plot of data the first time through everything works fine. An example script would be something like: fig =3D pylab.figure() pylab.imshow( myImage ) pylab.show() I am able to interact with the plot window just fine and close it from the upper right window controls. However, if I run the same script again from my app the figure window comes up with my data but the window is now dead. I am unable to interact or even close the figure window. When I try to mov= e the window my app crashes. I want the plotting to behave synchronously so that control is not returned to my app until the plot is dismissed. However, after the first show it seems that interactivity is automatically enabled for matplotlib. I've tried explicitly turning interactivity off in the script ( pylab.ioff() ) but show seems to automatically turn it back on. I'm just not sure of all I need to do to get this working so that I can bring up the plot over and over. BTW I've configured my matplotlib with a wxAgg backend. Can anyone help me out here or point me to information on embedding matplotlib in c++? Thanks in advance=85. J.D. |
|
From: Anthony F. <ant...@gm...> - 2007-11-27 18:06:53
|
> Ah, now I see the syntax for using axes(). However, if I'm embedding the > plots in a wxPython panel, I'm not using pylab. In this environment I also > haven't yet figured out how to add axis labels or specify the range of each > axis. Within pylab on stand-alone test apps it works fine. Check the class library documentation for the axes() object. http://matplotlib.sourceforge.net/matplotlib.axes.html I've also been known to use epydoc to generate my own local version of the class library (since the sourceforge site is ... tempermental at best). To enable gridlines, try something like: axes.xaxis.grid(b=True,which='major') and variations with xaxis/yaxis and major/minor. To add labels, try something like: axes.set_ylabel(string, fontproperties) To set ranges, try something like: axes.set_xlim(range). Your best bet is really to explore the object set in the class reference docs. A> |
|
From: Eric F. <ef...@ha...> - 2007-11-27 18:06:08
|
Michael Droettboom wrote:
>
> You can get the axes through the Figure instance. (I don't know how you
> have your embedding set up, but if it's something like
> embedding_in_wx.py, there's the line "self.fig = Figure((9, 8), 75)", so
> self.fig is a Figure instance).
>
> self.fig.gca() # gets the current axes
> self.fig.axes # is a Python list of axes -- useful if you have more
> than one and you need to access a particular one of them
Or just keep track of the axes object when it is created. In
embedding_in_wx.py:
def plot_data(self):
# Use ths line if using a toolbar
a = self.fig.add_subplot(111)
....
"a" is the axes instance.
Eric
|
|
From: Michael D. <md...@st...> - 2007-11-27 17:59:37
|
Rich Shepard wrote:
> On Tue, 27 Nov 2007, Michael Droettboom wrote:
>
>> Yes. You can do
>>
>> from pylab import *
>> ...
>> axes().grid(True) # For both axes
>> axes().xaxis.grid(True) # Just x
>> axes().yaxis.grid(True) # Just y
>>
>> Rather than just an on/off boolean, you can also provide line styles:
>>
>> axes().grid(color='r', linestyle='-', linewidth=2)
>
> Mike,
>
> Ah, now I see the syntax for using axes(). However, if I'm embedding the
> plots in a wxPython panel, I'm not using pylab. In this environment I also
> haven't yet figured out how to add axis labels or specify the range of each
> axis. Within pylab on stand-alone test apps it works fine.
You can get the axes through the Figure instance. (I don't know how you
have your embedding set up, but if it's something like
embedding_in_wx.py, there's the line "self.fig = Figure((9, 8), 75)", so
self.fig is a Figure instance).
self.fig.gca() # gets the current axes
self.fig.axes # is a Python list of axes -- useful if you have more
than one and you need to access a particular one of them
So, to do stuff with the grid:
self.fig.gca().grid(True)
To answer your other questions:
axes = self.fig.gca()
axes.set_xlabel("This is the x-axis label")
axes.set_ylabel("This is the y-axis label")
axes.set_xlim((-1.25, 1.25))
axes.set_ylim((-2.0, 2.0))
Cheers,
Mike
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
|
|
From: Eric F. <ef...@ha...> - 2007-11-27 17:51:50
|
Tom, Have you looked at line_collection2.py in the examples directory of the distribution (or svn)? I think it illustrates what you want to do. Eric Tom Johnson wrote: > I would like to plot a set of lines where the color of each line is > parametrized. Then I want to add a colorbar to the plot. > > For example, suppose I plot y=x+b for various values of b. For each > line, I would like to set the color to a particular value of b. When > plotting, all b values are normalized and applied to a colormap. The > colormap will show all colors... > > I can create a LineCollection containing all my lines...but I must > specify the colors as RGB tuples....and I haven't figured out how to > add a colorbar such that the scale on the colorbar will match the > parametrized b values. > > Ideas? > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Rich S. <rsh...@ap...> - 2007-11-27 17:51:07
|
On Tue, 27 Nov 2007, Michael Droettboom wrote: > Yes. You can do > > from pylab import * > ... > axes().grid(True) # For both axes > axes().xaxis.grid(True) # Just x > axes().yaxis.grid(True) # Just y > > Rather than just an on/off boolean, you can also provide line styles: > > axes().grid(color='r', linestyle='-', linewidth=2) Mike, Ah, now I see the syntax for using axes(). However, if I'm embedding the plots in a wxPython panel, I'm not using pylab. In this environment I also haven't yet figured out how to add axis labels or specify the range of each axis. Within pylab on stand-alone test apps it works fine. 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: Michael D. <md...@st...> - 2007-11-27 17:46:19
|
Yes. You can do from pylab import * ... axes().grid(True) # For both axes axes().xaxis.grid(True) # Just x axes().yaxis.grid(True) # Just y Rather than just an on/off boolean, you can also provide line styles: axes().grid(color='r', linestyle='-', linewidth=2) Cheers, Mike Rich Shepard wrote: > Two questions relating to the display of grid lines in a plot: > > 1) Can this be controlled programmatically rather than from within > ~/.matplotlib/matplotlibrc? > > 2) Is there a way to display horizontal grid lines without vertical grid > lines? > > Pointers to the docs where these questions are answered would be adequate. > > Rich > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Rich S. <rsh...@ap...> - 2007-11-27 17:40:49
|
Two questions relating to the display of grid lines in a plot: 1) Can this be controlled programmatically rather than from within ~/.matplotlib/matplotlibrc? 2) Is there a way to display horizontal grid lines without vertical grid lines? Pointers to the docs where these questions are answered would be adequate. 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: C M <cmp...@gm...> - 2007-11-27 17:06:31
|
On Nov 27, 2007 11:27 AM, Rich Shepard <rsh...@ap...> wrote: > On Mon, 26 Nov 2007, C M wrote: > > > Basically what I did (sorry if this is too basic, but I'm pretty new to > > this and this may jog others to correct deficiencies in this simple > > approach) was to: > > This is all straightforward and clear. The one statement I've not yet > understood is this: > > > self.graph = matplotFrame3.PlotPanel(self.panel1,xpoints, > ypoints) > > I assume that matplotFrame3 is the name of the module in which you've > written PlotPanel(). Is this assumption correct? > Exactly. That is the module which I mention importing in step 4. > > I'm modifying your approach to suit our application but it seems to be > the > most parsimonious and elegant solution for simple display of plots in a > wxPython panel. > > Thanks, > Glad it will help your application. |
|
From: Rich S. <rsh...@ap...> - 2007-11-27 16:27:52
|
On Mon, 26 Nov 2007, C M wrote: > Basically what I did (sorry if this is too basic, but I'm pretty new to > this and this may jog others to correct deficiencies in this simple > approach) was to: This is all straightforward and clear. The one statement I've not yet understood is this: > self.graph = matplotFrame3.PlotPanel(self.panel1,xpoints, ypoints) I assume that matplotFrame3 is the name of the module in which you've written PlotPanel(). Is this assumption correct? I'm modifying your approach to suit our application but it seems to be the most parsimonious and elegant solution for simple display of plots in a wxPython panel. 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: Arnar F. <arn...@gm...> - 2007-11-27 10:19:53
|
Thanks, Mark and John, I will look into a trunk version of matplotlib when I get to a chance. BTW, as far as I recall, I had the same troubles with Ubuntu Gutsy (runs v. 0.90.1). Arnar On Nov 24, 2007 4:25 PM, John Hunter <jd...@gm...> wrote: > On Nov 23, 2007 2:00 PM, Mark Bakker <ma...@gm...> wrote: > > Arnar - > > > > I presume you are using Tk. > > This is a known bug under Tk, that is apparently difficult to solve. > > John Hunter looked into it a year back or so, but couldn't find help > > from Tk experts that may know the solution. > > Oddly enough, I have written my own GUI in Tk, where I modified the > > toolbar, and I don't have the problem. > > > > If this could be solved, I would be very happy, > > I'm pretty sure this is bug w/ tkagg is fixed in svn, because we > reverted to the old file save dialog that was causing it. I am > surprised to hear that it is on gtk or gtkagg, since I've never hear > any reports of this. In any case 0.87 is over a year old now, so I > wonder if Arnar could upgrade. > > JDH > |
|
From: Werner F. B. <wer...@fr...> - 2007-11-27 10:07:32
|
Hi Jeff,
Jeff Peery wrote:
> Hello,
> I've been using matplotlib 0.87 and I upgraded to 0.91. I ran my setup
> script for py2exe which had been working flawlessly and now I get an
> error stating that the .../mpl-data/fonts is not a regular file or
> doesn't exist. I checked the filename path and it does actually exist.
> I'm using the matplotlib function get_py2exe_datafiles() to get the
> matplotlib data files. how might I correct this issue (I pasted a
> small sample code below)? thanks.
The folder structure in matplotlib has changed.
Attached is a sample setup.py for the "embedding_in_wx.py" matplotlib
example which has a "hack" to deal with this. I haven't found a better
way to deal with this new folder structure, but for me this works.
Werner
>
> Jeff
>
> # arguments for the setup() call
> app = dict(
> script = "App.py",
> other_resources = [(RT_MANIFEST, 1, manifest_template %
> dict(prog="App"))],
> icon_resources = [(1,'Figures/my_icon.ico')]
> )
> packages = ['numpy',
> 'matplotlib',
> 'pytz']
> excludes = [
> '_gtkagg',
> '_tkagg',
> 'tcl',
> 'Tkconstants',
> 'Tkinter',
> 'tcl',
> 'pywin.debugger',
> 'pywin.debugger.dbgcon',
> 'pywin.dialogs',
> 'bsddb',
> 'curses',
> 'email',
> 'distutil',
> 'logging',
> 'readline',
> 'setuptools']
> dll_excludes = [
> 'libgdk_pixbuf-2.0-0.dll',
> 'libgobject-2.0-0.dll',
> 'libgdk-win32-2.0-0.dll']
>
> Options = {"py2exe": {"skip_archive" : 1,
> "packages" : packages,
> "excludes" : excludes,
> "dll_excludes" : dll_excludes}}
> ## MATPLOTLIB DATA
> data_Files=[(".",
> ["matplotlibrc", "config.txt", "user_agreement.rtf",
> "main.css"]),
> ("Figures",glob.glob("Figures\\*")),
> ("Documents",glob.glob("Documents\\*")),
> ("images",glob.glob("images\\*")),
> matplotlib.get_py2exe_datafiles()]
>
> ------------------------------------------------------------------------
> Be a better sports nut! Let your teams follow you with Yahoo Mobile.
> Try it now.
> <http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Tom J. <tj...@gm...> - 2007-11-27 07:53:41
|
I would like to plot a set of lines where the color of each line is parametrized. Then I want to add a colorbar to the plot. For example, suppose I plot y=x+b for various values of b. For each line, I would like to set the color to a particular value of b. When plotting, all b values are normalized and applied to a colormap. The colormap will show all colors... I can create a LineCollection containing all my lines...but I must specify the colors as RGB tuples....and I haven't figured out how to add a colorbar such that the scale on the colorbar will match the parametrized b values. Ideas? |
|
From: Bryan F. <bry...@gm...> - 2007-11-27 00:53:20
|
Thank You! It works great. On Nov 26, 2007 7:02 PM, Eric Firing <ef...@ha...> wrote: > Bryan Fodness wrote: > > Could someone give me an idea how to get started with this so it > > coincides with my array of values. I took a look at the quadmesh_demo > > in the examples and do not see a straightforward way to do this > > Maybe the docstrings make it sound more complicated than it really is. > In your case you have an array of rectangles, not general > quadrilaterals. All you need are two 1-D arrays, one each for the x and > y grid boundaries. Something like this: > > Z =3D numpy.random.rand(60,4000) > X =3D numpy.arange(4001) > Y =3D numpy.array([0, 1.4] + [1.0]*9 + [0.5]*40 + [1]*9 + [1.4]).cumsum() > pcolor(X, Y, Z) > > pcolormesh should work the same, but when I try it now with svn it > doesn't; I don't know what is going on with it. If you are using a > release version of mpl, I expect it will work. > > Eric > > > > > > On Nov 26, 2007 7:52 AM, Michael Droettboom <md...@st...> wrote: > >> You can provide mesh coordinates to the pcolor command: > >> > >> 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. > >> > >> Actually generating the mesh is up to you (wink), but hopefully that > >> allows for what you need to do. > >> > >> Cheers, > >> Mike > >> > >> > >> Bryan Fodness wrote: > >>> I am wondering if there is a way to view my data with respect to the > >>> physical size of what my array element is suppose to be. > >>> > >>> I have an array that is 60 x 4000 where, > >>> the first row has a height of 1.4 > >>> the next nine has a height of 1 > >>> the next forty has a height of 0.5 > >>> the next nine has a height of 1 > >>> and the last one has a height of 1.4 > >>> > >>> When viewing this with contourf or pcolor, the image is more narrow > >>> than it should be. Is there an easy way to view this properly. > >>> > >>> Bryan > >>> > >> -- > >> Michael Droettboom > >> Science Software Branch > >> Operations and Engineering Division > >> Space Telescope Science Institute > >> Operated by AURA for NASA > >> > > > > > > > > --=20 "The game of science can accurately be described as a never-ending insult to human intelligence."=09- Jo=E3o Magueijo |
|
From: Eric F. <ef...@ha...> - 2007-11-27 00:02:51
|
Bryan Fodness wrote: > Could someone give me an idea how to get started with this so it > coincides with my array of values. I took a look at the quadmesh_demo > in the examples and do not see a straightforward way to do this Maybe the docstrings make it sound more complicated than it really is. In your case you have an array of rectangles, not general quadrilaterals. All you need are two 1-D arrays, one each for the x and y grid boundaries. Something like this: Z = numpy.random.rand(60,4000) X = numpy.arange(4001) Y = numpy.array([0, 1.4] + [1.0]*9 + [0.5]*40 + [1]*9 + [1.4]).cumsum() pcolor(X, Y, Z) pcolormesh should work the same, but when I try it now with svn it doesn't; I don't know what is going on with it. If you are using a release version of mpl, I expect it will work. Eric > > On Nov 26, 2007 7:52 AM, Michael Droettboom <md...@st...> wrote: >> You can provide mesh coordinates to the pcolor command: >> >> 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. >> >> Actually generating the mesh is up to you (wink), but hopefully that >> allows for what you need to do. >> >> Cheers, >> Mike >> >> >> Bryan Fodness wrote: >>> I am wondering if there is a way to view my data with respect to the >>> physical size of what my array element is suppose to be. >>> >>> I have an array that is 60 x 4000 where, >>> the first row has a height of 1.4 >>> the next nine has a height of 1 >>> the next forty has a height of 0.5 >>> the next nine has a height of 1 >>> and the last one has a height of 1.4 >>> >>> When viewing this with contourf or pcolor, the image is more narrow >>> than it should be. Is there an easy way to view this properly. >>> >>> Bryan >>> >> -- >> Michael Droettboom >> Science Software Branch >> Operations and Engineering Division >> Space Telescope Science Institute >> Operated by AURA for NASA >> > > > |
|
From: Christopher B. <Chr...@no...> - 2007-11-26 23:39:42
|
> 1) We kluged a fix by manually adding get_xdata and get_ydata methods to
> our derived class, but a) this seems like it shouldn't be necessary, and
> b) it wasn't necessary before;
> 2) Chris' hypothesis is that it has something to do w/ the work being
> done on matplotlib to add units to data objects (please correct me if
> I'm wrong, Chris) but is uncertain of precisely how or why, and wasn't
> readily able to pin it down more than that;
The traceback gave me this hint (see below):
The error comes when axis.clear() is called, inside:
self.set_units(None)
so I thought it might have to do with the unit stuff. The error is really:
in set_units
self.callbacks.process('units finalize')
in process
func(*args, **kwargs)
in relim
self._update_line_limits(line)
and that's where it wants the LineCollection to have get_xdata
What's really odd about this is that we're clearing the axis - the
LineCollection should be irrelevant then!
I do remember something with the auto-limits and LineCollections when I
first started messing with this, but I don't remember what.
Sorry we haven't been able to duplicate this in a small sample yet.
Anyone have any ideas?
-Chris
Here's the whole traceback:
Traceback (most recent call last):
File "/Users/cbarker/HAZMAT/3d/TABS/TabsDataPanels.py", line 688, in
PlotProfile
int(self.DataSelector.BotBin) )
File "/Users/cbarker/HAZMAT/3d/TABS/TabsDataPanels.py", line 351, in
PlotProfile
ax.clear()
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axes.py",
line 725, in clear
self.cla()
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axes.py",
line 670, in cla
self.xaxis.cla()
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axis.py",
line 563, in cla
self.set_units(None)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axis.py",
line 859, in set_units
self.callbacks.process('units finalize')
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/cbook.py",
line 83, in process
func(*args, **kwargs)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axes.py",
line 1104, in relim
self._update_line_limits(line)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axes.py",
line 1064, in _update_line_limits
xdata = line.get_xdata(orig=False)
AttributeError: VectorLineCollection instance has no attribute 'get_xdata'
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: C M <cmp...@gm...> - 2007-11-26 23:35:25
|
> > There is a link on that page to this > > example<http://www.scipy.org/Matplotlib_figure_in_a_wx_panel>of direct > > embedding with wx. I was able to start with this and adapt it to my > needs. > > I've looked closely at this, and need to figure out how to translate it > from a stand-alone example to working in my application. > Basically what I did (sorry if this is too basic, but I'm pretty new to this and this may jog others to correct deficiencies in this simple approach) was to: 1. Save the two graphing classes from that example (NoRepaintCanvas and PlotPanel) in their own module for conceptual simplicity and use by various apps I might make. 2. change the draw() method in PlotPanel to a simpler: def draw(self): if not hasattr(self, 'subplot'): self.subplot = self.figure.add_subplot(111) self.subplot.plot(self.xpoints, self.ypoints, marker='o', ms=8, fc='white', mec='blue', mew=1) this isn't great because you cannot change plot characteristics from the GUI yet, but it gets things started (and you may not care). 3. Now the class PlotPanel needs a place to get fed those xpoints and ypoints, so I added it in the __init__, along with a call to draw(). def __init__(self,parent, xpoints=[],ypoints=[] ,id = -1, color = None,\ dpi = None, style = wx.NO_FULL_REPAINT_ON_RESIZE, **kwargs): wx.Panel.__init__(self, parent, id = id, style = style, **kwargs) self.figure = Figure(None, dpi) self.xpoints = xpoints self.ypoints = ypoints self.canvas = NoRepaintCanvas(self, -1, self.figure) self.SetColor(color) self.Bind(wx.EVT_IDLE, self._onIdle) self.Bind(wx.EVT_SIZE, self._onSize) self._resizeflag = True self._SetSize() self.draw() 4. The classes in the module are set. Then in my main app, I made sure to at the top of the app import matplotFrame3 and then just reference this class from there in this method called add_graph... def add_graph(self): if self.graphstate == 1: self.graph.Destroy() ypoints = (10,20,20,33,73) #you'll take this from a list somewhere in your app xpoints = (1,2,3,4,5) #you'll take this from a list somewhere in your app self.graph = matplotFrame3.PlotPanel(self.panel1,xpoints, ypoints) self.boxSizer1.Insert(4, self.graph, 2, border=5, flag=wx.LEFT | wx.TOP |wx.EXPAND) self.boxSizer1.Layout() self.graphstate = 1 This bit about destroying based on the graphstate (exists or doesn't) was just a quick way to prevent adding multiple graphs to the sizer, but I'll clean that up with a better approach later. Hope this gets you further along. > > There's also a reference on that SciPy cookbook page to links to the OO > API on the matplotlib FAQ page, but I've not found that link(s). I have > the > api.pdf but is that the OO one? > That I don't know. |
|
From: Rich S. <rsh...@ap...> - 2007-11-26 23:24:10
|
On Mon, 26 Nov 2007, Rich Shepard wrote: > A screen shot of this tab is attached. Ah, rats! I forgot to attach it. Here it is. 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: Bryan F. <bry...@gm...> - 2007-11-26 23:21:51
|
Could someone give me an idea how to get started with this so it coincides with my array of values. I took a look at the quadmesh_demo in the examples and do not see a straightforward way to do this On Nov 26, 2007 7:52 AM, Michael Droettboom <md...@st...> wrote: > You can provide mesh coordinates to the pcolor command: > > 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. > > Actually generating the mesh is up to you (wink), but hopefully that > allows for what you need to do. > > Cheers, > Mike > > > Bryan Fodness wrote: > > I am wondering if there is a way to view my data with respect to the > > physical size of what my array element is suppose to be. > > > > I have an array that is 60 x 4000 where, > > the first row has a height of 1.4 > > the next nine has a height of 1 > > the next forty has a height of 0.5 > > the next nine has a height of 1 > > and the last one has a height of 1.4 > > > > When viewing this with contourf or pcolor, the image is more narrow > > than it should be. Is there an easy way to view this properly. > > > > Bryan > > > > -- > Michael Droettboom > Science Software Branch > Operations and Engineering Division > Space Telescope Science Institute > Operated by AURA for NASA > --=20 "The game of science can accurately be described as a never-ending insult to human intelligence."=09- Jo=E3o Magueijo |
|
From: Rich S. <rsh...@ap...> - 2007-11-26 22:53:40
|
On Mon, 26 Nov 2007, C M wrote: > So far in my experience, and as I was recommended, the "simplest, > easiest, most pragmatic approach" has been to forgo MPlot or WxMpl and > just embed directly in wxPython. That is the insight I seek. I've looked at the examples and the cookbook page ... > This page <http://www.scipy.org/Cookbook/Matplotlib/EmbeddingInWx> > discusses the difference between direct embedding and using an embedding > library, the key difference for you being this sentence: "An *embedding > library* saves you a lot of time and effort by providing plotting widgets > that already support user interactions and other bells and whistles." But > you don't want such bells and whistles. No, I don't need bells or whistles. > There is a link on that page to this > example<http://www.scipy.org/Matplotlib_figure_in_a_wx_panel>of direct > embedding with wx. I was able to start with this and adapt it to my needs. I've looked closely at this, and need to figure out how to translate it from a stand-alone example to working in my application. There's also a reference on that SciPy cookbook page to links to the OO API on the matplotlib FAQ page, but I've not found that link(s). I have the api.pdf but is that the OO one? 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: C M <cmp...@gm...> - 2007-11-26 22:47:46
|
> > The wiki suggests either MPlot or WxMpl for embedding. Which might be > preferable for a display-only use? In other words, what would be the > simpliest, easiest, most pragmatic approach? > So far in my experience, and as I was recommended, the "simpliest, easiest, most pragmatic approach" has been to forgo MPlot or WxMpl and just embed directly in wxPython. This page <http://www.scipy.org/Cookbook/Matplotlib/EmbeddingInWx> discusses the difference between direct embedding and using an embedding library, the key difference for you being this sentence: "An *embedding library* saves you a lot of time and effort by providing plotting widgets that already support user interactions and other bells and whistles." But you don't want such bells and whistles. There is a link on that page to this example<http://www.scipy.org/Matplotlib_figure_in_a_wx_panel>of direct embedding with wx. I was able to start with this and adapt it to my needs. |
|
From: Rich S. <rsh...@ap...> - 2007-11-26 22:45:48
|
On Mon, 26 Nov 2007, Christopher Barker wrote: > I think wxMPL is a good option. I think MPlot gives you nifty tools for > editing the figure with a GUI, but I don't think you want that. Chris, Thank you. I'll go read about wxMPL then. 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: Rich S. <rsh...@ap...> - 2007-11-26 22:45:23
|
On Mon, 26 Nov 2007, Christopher Barker wrote: > or better yet -- work with numpy arrays from the beginning: Chris, These values are retrieved from widgets on a notebook page and the plot will be used to display them on that tab. It would take more code to convert those values to a numpy array. 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 |