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
(4) |
2
(20) |
3
(8) |
4
(10) |
5
(4) |
6
(8) |
7
(4) |
8
(9) |
9
(11) |
10
(12) |
11
(13) |
12
(3) |
13
(17) |
14
(4) |
15
|
16
(10) |
17
(9) |
18
(11) |
19
(4) |
20
(17) |
21
(6) |
22
(9) |
23
(35) |
24
(17) |
25
(9) |
26
(16) |
27
(17) |
28
(14) |
From: Michael D. <md...@st...> - 2009-02-27 13:34:56
|
It seems the Freetype rendering backend wasn't doing subpixel alignment on the text, but was being rounded to the nearest pixels. Taking the fractional part into account seems to resolve this. Fixed on branch and trunk. Mike Ryan May wrote: > And here's the image I promised. > > On Wed, Feb 25, 2009 at 3:13 PM, Ryan May <rm...@gm... > <mailto:rm...@gm...>> wrote: > > Hi, > > When I combine mathtext with the stixsans fonts while > mathtext.default is set to 'regular', horizontal text is not > vertically aligned properly, like the baseline is moving. I've > attached an image of what I see when I run the following code. It > should be noted that I don't see anything like this on the > vertical axis, and it all goes away if I stop using mathtext. > > import matplotlib.pyplot as plt > from matplotlib import rcParams > rcParams['font.size'] = 12.0 > rcParams['mathtext.default'] = 'regular' > rcParams['mathtext.fontset'] = 'stixsans' > > fig = plt.figure() > > plt.xlabel('ItLooksToMeLikeTheBaselineMoves $(g m^{-3})$') > plt.ylabel('ItLooksToMeLikeTheBaselineMoves $(db km^{-1})$') > plt.show() > > > Thoughts? Am I doing something bad? Can anyone else reproduce this? > > Ryan > > -- > Ryan May > Graduate Research Assistant > School of Meteorology > University of Oklahoma > Sent from: Norman Oklahoma United States. > > > > > -- > Ryan May > Graduate Research Assistant > School of Meteorology > University of Oklahoma > Sent from: Norman Oklahoma United States. > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > ------------------------------------------------------------------------ > > _______________________________________________ > 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: mochuk <to...@gm...> - 2009-02-27 12:52:12
|
Hi all, Johan Ekh-2 wrote: > > > What is the most convenient way to get Matplotlib to use the same fonts as > my main document and also to quickly switch between the > different document types? > > Take a look at: http://dtrx.de/od/tex/sfmath.html You have to load the package in the preambel of LaTeX. For matplotlib this can be done by adding "text.latex.preamble : \usepackage{sfmath}" to your matplotlibrc. Best regards, Tobias -- View this message in context: http://www.nabble.com/Switching-between-different-font-settings-tp21279388p22245329.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: mochuk <to...@gm...> - 2009-02-27 12:48:55
|
Hi all, Johan Ekh-2 wrote: > > > What is the most convenient way to get Matplotlib to use the same fonts as > my main document and also to quickly switch between the > different document types? > > Take a look at: http://dtrx.de/od/tex/sfmath.html Best regards, Tobias -- View this message in context: http://www.nabble.com/Switching-between-different-font-settings-tp21279388p22245251.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Søren N. <sor...@gm...> - 2009-02-27 09:27:02
|
Hi, When I save a plot using the toolbar save function, and I save to a different directory than the one where my program is, my program can no longer locate the icons (used in my GUI) that I am using in my .\ressources directory. So saving the plot changed the working directory of my program? How do I change it back? Isn't this an error in matplotlib? Thanks Soren |
From: Søren N. <sor...@gm...> - 2009-02-27 07:29:49
|
Thanks JJ! It does, and you are exactly right, letting the legend "grow" downward while holding the value of the lower left corner doesn't make sense.. I tried calculating an offset, but the patch is a much nicer fix! Soren On Thu, Feb 26, 2009 at 9:27 PM, Jae-Joon Lee <lee...@gm...> wrote: > On Thu, Feb 26, 2009 at 4:51 AM, Søren Nielsen > <sor...@gm...> wrote: > > I've tried placing a legend using the loc = (x,y) .. and the legend is > moved > > where I want it. the problem is, when I add new lines to the plot.. the > > legend grows, but upwards.. so the lower left point of the legend box is > > constant.. but that's not the logical way for a legend box to grow.. > > shouldn't it grow downwards, just like when I use the standard loc = 1 > > (upper right position) . > > Well, technically, legend never grows. Whenever you call legend(), a > new legend instance is created and the old one is just destroyed. > Anyhow, as far as I can tell, the (x,y) coordinates given to the *loc* > parameter has been the coordinate of the lower left corner of the > legend (but I don't think this is clearly specified in the > documentation). Therefore, I don't think it is a good idea to make the > legend grow(?) downward while you're supplying a fixed coordinate of > the lower left corner. This is hardly possible and it seems to make > little sense to me. > > Anyhow, I just submitted a patch to the svn that add an optional > *bbox_to_anchor* argument for the legend class. This lets you specify > the bbox that the legend will be anchored (the default is the bbox of > the parent). > > For example, > > legend(loc="upper left", bbox_to_anchor=[0.0, 0.5]) > > will create an legend with its upper left corner at (0.0, 0.5), and it > will grow downward. Note that when len(bbox_to_anchor)==2, a bbox with > zero width and zero height is created. > > I hope this suits your need. > > -JJ > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: bubye <joe...@gm...> - 2009-02-26 22:00:43
|
I made a little more progress, but i'm not sure i'm doing this the right way. Suggestions? from pylab import * import numpy as np #generate random temperature data snp=[] for i in range(0,65): snp.append(np.random.randint(35,122)) #hide the labels. I don't want them. rc('xtick', labelsize=0) rc('ytick', labelsize=0) fig=figure(figsize=(8,8),facecolor='0.0') ax = fig.add_subplot(111,polar=True,frameon=False) tempTuple=array(snp) r = tempTuple/10 theta = ((tempTuple*2.9508)*pi)/180 area = r**2*(tempTuple/5.4) colors = theta #this is the fancy green,yellow,red background #it's actually a scatter plot that sits behind (zorder) #of the rest of the scatter plots. #radius r1 = 0.7 # 20% r2 = r1 + 0.2 # 40% # define some sizes of the scatter marker sizes = [55000] x = [0] + np.cos(np.linspace(0, 2*math.pi*r1, 100)).tolist() y = [0] + np.sin(np.linspace(0, 2*math.pi*r1, 100)).tolist() xy1 = zip(x,y) x = [0] + np.cos(np.linspace(2*math.pi*r1, 2*math.pi*r2, 100)).tolist() y = [0] + np.sin(np.linspace(2*math.pi*r1, 2*math.pi*r2, 100)).tolist() xy2 = zip(x,y) x = [0] + np.cos(np.linspace(2*math.pi*r2, 2*math.pi, 100)).tolist() y = [0] + np.sin(np.linspace(2*math.pi*r2, 2*math.pi, 100)).tolist() xy3 = zip(x,y) ax.scatter([0,0,0], [0,0,0], marker=(xy1,0), s=sizes, facecolor='green',alpha=.25,zorder=1) ax.scatter([0,0,0], [0,0,0], marker=(xy2,0), s=sizes, facecolor='yellow' ,alpha=.25,zorder=1) ax.scatter([0,0,0], [0,0,0], marker=(xy3,0), s=sizes, facecolor='red',alpha=.25,zorder=1) ax.scatter(theta, r, c=colors, s=area,zorder=2) ax.grid(False) show() -- View this message in context: http://www.nabble.com/polar-graph-tp22230232p22234721.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Jouni K. S. <jk...@ik...> - 2009-02-26 20:29:27
|
Haibao Tang <tan...@gm...> writes: > Any ideas? Yes, image clipping was unimplemented in the pdf backend. I added an implementation (both on the trunk and on the 0.98.5 branch) that at least gets this example and the dolphin right - please test it if you have some other use case. -- Jouni K. Seppänen http://www.iki.fi/jks |
From: Jae-Joon L. <lee...@gm...> - 2009-02-26 20:28:32
|
On Thu, Feb 26, 2009 at 4:51 AM, Søren Nielsen <sor...@gm...> wrote: > I've tried placing a legend using the loc = (x,y) .. and the legend is moved > where I want it. the problem is, when I add new lines to the plot.. the > legend grows, but upwards.. so the lower left point of the legend box is > constant.. but that's not the logical way for a legend box to grow.. > shouldn't it grow downwards, just like when I use the standard loc = 1 > (upper right position) . Well, technically, legend never grows. Whenever you call legend(), a new legend instance is created and the old one is just destroyed. Anyhow, as far as I can tell, the (x,y) coordinates given to the *loc* parameter has been the coordinate of the lower left corner of the legend (but I don't think this is clearly specified in the documentation). Therefore, I don't think it is a good idea to make the legend grow(?) downward while you're supplying a fixed coordinate of the lower left corner. This is hardly possible and it seems to make little sense to me. Anyhow, I just submitted a patch to the svn that add an optional *bbox_to_anchor* argument for the legend class. This lets you specify the bbox that the legend will be anchored (the default is the bbox of the parent). For example, legend(loc="upper left", bbox_to_anchor=[0.0, 0.5]) will create an legend with its upper left corner at (0.0, 0.5), and it will grow downward. Note that when len(bbox_to_anchor)==2, a bbox with zero width and zero height is created. I hope this suits your need. -JJ |
From: Christopher B. <c-...@as...> - 2009-02-26 19:52:33
|
Hi, If I have a figure: h = pp.figure(num=14) What is the best way to check to see if Figure 14 exists? I'm writing a function that adds plots to a figure window. I want the function to check if the figure exists, and if so, turn off autoscaling (using Eric's suggested axes.set_autoscale_on(False)) in case the user has zoomed. -- Christopher Brown, Ph.D. Department of Speech and Hearing Science Arizona State University |
From: Eric F. <ef...@ha...> - 2009-02-26 19:28:33
|
Aaron R> wrote: > I have an app which adds data to a plot. Everything is working, but > when I add data to a plot that was zoomed in, it switches the display > to a zoomed out view. > > def addData(self, xdata, ydata): > # Need to save off current zoom level before adding new plot data > # But don't know how Try this: self.axes.set_autoscale_on(False) Eric > self.axes.plot(xdata, ydata) > > # Restore view here, then redraw > self.canvas.draw() > |
From: Ryan W. <rw...@vn...> - 2009-02-26 19:05:53
|
Just a follow-up: I managed to interpolate this problem away... interpolated = [] iinds = [] for i in range(len(stockData.rinds)-1): interpolated.append(s[stockData.rinds[i]]) iinds.append(stockData.inds[i]) interpolated.append((s[stockData.rinds[i]]*3. + s[stockData.rinds[i]+1])/4) iinds.append(stockData.inds[i] + 0.25) interpolated.append((s[stockData.rinds[i]] + s[stockData.rinds[i]+1])/2) iinds.append(stockData.inds[i] + 0.5) interpolated.append((s[stockData.rinds[i]] + 3.* s[stockData.rinds[i]+1])/4) iinds.append(stockData.inds[i] + 0.75) interpolated.append(s[stockData.rinds[len(stockData.rinds)-1]]) iinds.append(stockData.inds[len(stockData.inds)-1]) interpolated = array(interpolated) ax.fill_between(iinds, interpolated, 50-thresh, where=interpolated<50-thresh, color=color, alpha=0.3 ) It would be nice to see this taken care of intelligently inside the fill_between routine, but I wouldn't know how to do it for the general case. Maybe this post will allow future users with a similar problem to find their answer. -Ryan From: Ryan Wagner Sent: Wednesday, February 25, 2009 5:06 PM To: 'mat...@li...' Subject: Bug in Fill_Between? Is this a bug in fill_between, or is there a known workaround? In the attached picture, I'm calling fill_between as follows, and I can't fill the entire area between the line (50+thresh) and the signal, s. I realize that the areas that aren't filled are boundary conditions, but there should be some sort of interpolation I can do to fix this I would think... ax.fill_between(stockData.inds, s[stockData.rinds], 50+thresh, where=s[stockData.rinds]>50+thresh, color=color, alpha=0.3 ) So for example: stockData.inds = range(6), s[stockData.rinds] = [20,30,70,80,40,20] and thresh = 0. I need the areas filled with color where stockData.rinds is greater than 50. It does fully fill in the xrange(2,3), but the border conditions xrange(1,2) and xrange(3,4) are not fully filled under the line. I had the same problem with fill_over and was hoping it would be resolved with the move to fill_between. Any ideas? -Ryan |
From: bubye <joe...@gm...> - 2009-02-26 18:14:32
|
Hi, i'm wondering if there is an easy way to fill the background in a polar graph with a specific color. If I were making a pie graph, it'd be something like: pie([70,20,10]), where the first 70% is green, the next 20, yellow, and the last 10, red. I've been experimenting with polar graphs using some random data and i've gotten close to what I want, but it'd be neat to have a color in the background. Here's what I have now. it's a polar scatter plot, much like what is found in the gallery, but with a few changes. from pylab import * import numpy as np snp=[] for i in range(0,65): snp.append(np.random.randint(35,122)) tempTuple=array(snp) r = tempTuple/10 theta = ((tempTuple*2.9508)*pi)/180 area = r**2*(tempTuple/5.4) colors = theta ax = subplot(111, polar=True) c = scatter(theta, r, c=colors, s=area) c.set_alpha(0.75) show() -- View this message in context: http://www.nabble.com/polar-graph-tp22230232p22230232.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Aaron R> <ant...@gm...> - 2009-02-26 16:12:11
|
I have an app which adds data to a plot. Everything is working, but when I add data to a plot that was zoomed in, it switches the display to a zoomed out view. Here's a code snippet: class MyPlotFrame(Frame): def __init__(self): Frame.__init__(self,None,-1, 'My Super Frame',size=(550,350)) self.SetBackgroundColour(NamedColor("WHITE")) self.figure = Figure() self.axes = self.figure.add_subplot(111) t = arange(0.0,3.0,0.01) s = sin(2*pi*t) self.axes.plot(t,s) self.axes.grid() self.canvas = FigureCanvas(self, -1, self.figure) self.sizer = BoxSizer(VERTICAL) self.sizer.Add(self.canvas, 1, LEFT | TOP | GROW) self.SetSizer(self.sizer) self.Fit() self.add_toolbar() # comment this out for no toolbar def addData(self, xdata, ydata): # Need to save off current zoom level before adding new plot data # But don't know how self.axes.plot(xdata, ydata) # Restore view here, then redraw self.canvas.draw() def add_toolbar(self): self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() # Snipped some stuff for checking if on a Mac or Windows self.toolbar.update() def OnPaint(self, event): self.canvas.draw() I can't find any examples or docs on maintaining my zoom of the plot. In matlab, I know how to do this, but I'm not sure what to do here. Can someone please advise? Thanks, Aaron R> |
From: Haibao T. <tan...@gm...> - 2009-02-26 14:49:38
|
See http://matplotlib.sourceforge.net/examples/pylab_examples/image_clip_path.html ... and click on pdf Any ideas? Haibao |
From: Søren N. <sor...@gm...> - 2009-02-26 09:51:31
|
Hi, I've tried placing a legend using the loc = (x,y) .. and the legend is moved where I want it. the problem is, when I add new lines to the plot.. the legend grows, but upwards.. so the lower left point of the legend box is constant.. but that's not the logical way for a legend box to grow.. shouldn't it grow downwards, just like when I use the standard loc = 1 (upper right position) . Is there a way to change this behaviour? |
From: Scott G. <sco...@h4...> - 2009-02-26 05:01:54
|
Hi I'm trying to draw something like http://en.wikipedia.org/wiki/File:Cartesian-coordinate-system.svg Below is my current attempt. Four questions: 1. The y-axis label is vertical: how do I make it horizontal? 2. How can I move the axis numbering to be in the centre of the graph, rather than around the outside? 3. Most of the mess below is to try to get the arrow heads not to be stretched. Is there a better way to draw those in "screen space" rather than "graph space"? 4. The axis label positioning is ugly too, is there a better way to align that text's midpoint? Answers to any of these will be greatfully received. :) Or, if I'm going about this all wrong and I missed an easy helper function, that'd be even better! thanks, scott ------------- from __future__ import division import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np def cartesian(w,h): fig = plt.figure(figsize=(5,5)) ax = plt.axes() arrowExtraW = w/6 arrowExtraH = h/6 box = dict(edgecolor='white', facecolor='white', pad=5) plt.xlabel("$x$", bbox=box) ax.xaxis.set_label_coords(1.03, 0.515) plt.ylabel("$y$", bbox=box) ax.yaxis.set_label_coords(0.515, 1.03) plt.axis([-w-arrowExtraW, w+arrowExtraW, -h-arrowExtraH, h+arrowExtraH]) plt.arrow(-w, 0, w*2, 0, head_width=arrowExtraH/1.5, head_length=arrowExtraW, edgecolor="black", facecolor="black", label="$x$") plt.arrow(w, 0, -w*2, 0, head_width=arrowExtraH/1.5, head_length=arrowExtraW, edgecolor="black", facecolor="black") plt.arrow(0, -h, 0, h*2, head_width=arrowExtraW/1.5, head_length=arrowExtraH, edgecolor="black", facecolor="black", label="$y$") plt.arrow(0, h, 0, -h*2, head_width=arrowExtraW/1.5, head_length=arrowExtraH, edgecolor="black", facecolor="black") plt.grid(True) plt.savefig("a.png") cartesian(20, 6) -- View this message in context: http://www.nabble.com/plotting-cartesian-%22high-school%22-style-axes-tp22217764p22217764.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Jae-Joon L. <lee...@gm...> - 2009-02-26 04:04:45
|
I don't use wx so i'm not sure if this could be helpful, but you may check the figimage command. http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.figimage Note that it draws the image directly into the figure, thus no axes is needed. -JJ On Wed, Feb 25, 2009 at 6:09 PM, lionel keene <lio...@gm...> wrote: > Hello all, I've been trying for days but I can't seem to get the > result I'm looking for. I have a 2d array of type "numpy.ndarray" > which I'd like to plot as a simple color map. I'd like to plot it in > the upper-lefthand corner of the client area in a wxPython frame. The > plotting needs to be a very simple 1:1 ratio, for example if the numpy > array has 400 rows and 500 columns, I would like to plot it so that it > assumes 400x500 pixels in the wxPython frame. I do not need axis ticks > and labels, just the colormap plot itself. I can get my figure to plot > (with tick marks and labels since I haven't figured out how to turn > those off) but I cannot size it properly. I've copied a tutorial > example I found and modify it and through tedious trial and error have > gotten half-way to where I need: > > > # First attempt to render data to a window: > > import matplotlib > matplotlib.use('WXAgg') > > from matplotlib import rcParams > import numpy > > import matplotlib.cm as cm > > from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg > > > #from matplotlib.figure import Figure > > from wx import * > > import DataFileTypes as DFT > > > class DataFrame(Frame): > > def __init__(self): > > Frame.__init__(self, None, -1, "Data filename here", > size=DisplaySize()) > > def displayData(self): > > data = None > > # Load data into "data" object using my custom IntData(...) class: > try: > data = DFT.INTData("C:\SAR Test files\Tibet2008.int") > > except DFT.DataFileError: > print("Error opening data file") > > except DFT.ResourceFileError: > print("Error opening resource file") > > > if data: > > # Assume a screen dpi of 96...seems very flakey to me: > ScreenDPI = 96.0 > > > # compute the width and height of figure using this dpi > # and the rows and columns of the data for a 1:1 display ratio: > FigureWidthInInches = (data.numcolumns / ScreenDPI) > FigureHeightInInches = (data.numrows / ScreenDPI) > print(FigureWidthInInches, FigureHeightInInches) > > # Instantiate Figure based on these parameters: > self.fig = > matplotlib.figure.Figur((FigureWidthInInches,FigureHeightInInches), > dpi = ScreenDPI) > self.canvas = FigureCanvasWxAgg(self, -1, self.fig) > > # Put everything into a sizer: > sizer = BoxSizer(VERTICAL) > #sizer.Add(self.canvas, 1, LEFT | TOP | GROW) > sizer.Add(self.canvas, 0, LEFT | TOP) > self.SetSizer(sizer) > # self.Fit() > > a = self.fig.add_axes([0.075, 0.1, 0.75, 0.85]) > self.im = a.imshow(data.getNumpyArray(), > interpolation=None, cmap = data.getCustomColorMap()) > > > > > if __name__ == '__main__': > > app = PySimpleApp() > frame = DataFrame() > frame.displayData() > > frame.Show() > app.MainLoop() > > > It displays but the plot is inside the figure i.e. the colormap of the > data is within the figure that I've sized. matplotlib does this by > design, of course, but I cannot figure out how to defeat it. For one > thing, I don't think I'm sizing the figure correctly by setting > (guessing at) the dpi and computing the inches...just seems wrong, but > I can't find any tutorials or examples that show anything that sizes > figures using pixels or screen coords. > > I always know the dimensions of my data a priori, so let's assume the > following very simple situation: > > - I have a numpy.ndarray of data with 350 rows and 500 columns. How do > I display it in the upper-left hand corner of the frame client with no > tick marks/labels, etc...just the colormap at screen > coords(0,0)->(349,499) (rows,columns)? Could someone post a few lines > to do this? Thanks so much in advance! > > -L > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Tom K. <tp...@kr...> - 2009-02-26 02:41:46
|
LKeene wrote: > > > - I have a numpy.ndarray of data with 350 rows and 500 columns. How do > I display it in the upper-left hand corner of the frame client with no > tick marks/labels, etc...just the colormap at screen > coords(0,0)->(349,499) (rows,columns)? Could someone post a few lines > to do this? Thanks so much in advance! > > -L > Hmm... interesting problem... Here's a simple example where the image fills the frame - note the properties such as xticks, yticks = [], position=[0,0,1,1], and the size of the Frame itself... on my platform (Mac OS X) the height of the frame should be 22 pixels more than the image (discovered by trial and error). The border of the axes is still visible in black - obscuring the outer pixels of the image - does anyone know how to shut that off? import matplotlib matplotlib.interactive(False) matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg from matplotlib.figure import Figure from matplotlib.pyplot import setp import numpy as np import wx class MatplotlibFrame(wx.Frame): def __init__(self, *args, **kwargs): wx.Frame.__init__(self, *args, **kwargs) self.figure = Figure() print self.figure self.canvas = FigureCanvasWxAgg(self, -1, self.figure) self.subplot = self.figure.add_subplot(111) #cdata = np.random.rand(351, 501) cdata = np.zeros((351, 501)) cdata[::50, ::50] = 1 self.subplot.imshow(cdata, aspect='equal', interpolation='nearest') setp(self.subplot, xticks=[], yticks=[], position=[0,0,1,1]) def repaint(self): self.canvas.draw() class App(wx.App): def OnInit(self): frame = MatplotlibFrame(parent=None, title="an image", size=(501, 351+22)) frame.Show() return True app = App() app.MainLoop() -- View this message in context: http://www.nabble.com/Help-with-simply-plotting-2d-array%2C-please-tp22214482p22216497.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Gökhan S. <gok...@gm...> - 2009-02-26 00:37:38
|
Hello, My first message in the list. I would like to mention a few things about the matplotlib PDF document. Firstly, the download link for the pdf document (@ http://matplotlib.sourceforge.net/contents.html) is for release 0.98.5.1, compiled on December 17, instead of 0.98.5.2, on Dec-18. Next, is there a way to get functions separately listed under each bookmark listing in the pdf file? For example if I go IV Matplotlib API section from the bookmarks menu and click the matplotlib.pyplot seb-menu I would like to see the function names listed. In addition to module indexing (where keywords highlighted back to original names) this would be a nice feature to add the pdf documentation. If this needs a manual configuration, I am volunteering to spend time to add this functionality. Regards, Gökhan SEVER |
From: Daniel S. <ds...@st...> - 2009-02-26 00:07:39
|
does anyone know how to upgrade the matplotlib package that ships with the enthought python distribution? the current enthought release matplotlib is 0.98.3 and i'd like to upgrade to 0.98.5. i'm on an os x intel platform running leopard. thank you, daniel soto |
From: lionel k. <lio...@gm...> - 2009-02-25 23:30:49
|
Hello all, I've been trying for days but I can't seem to get the result I'm looking for. I have a 2d array of type "numpy.ndarray" which I'd like to plot as a simple color map. I'd like to plot it in the upper-lefthand corner of the client area in a wxPython frame. The plotting needs to be a very simple 1:1 ratio, for example if the numpy array has 400 rows and 500 columns, I would like to plot it so that it assumes 400x500 pixels in the wxPython frame. I do not need axis ticks and labels, just the colormap plot itself. I can get my figure to plot (with tick marks and labels since I haven't figured out how to turn those off) but I cannot size it properly. I've copied a tutorial example I found and modify it and through tedious trial and error have gotten half-way to where I need: # First attempt to render data to a window: import matplotlib matplotlib.use('WXAgg') from matplotlib import rcParams import numpy import matplotlib.cm as cm from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg #from matplotlib.figure import Figure from wx import * import DataFileTypes as DFT class DataFrame(Frame): def __init__(self): Frame.__init__(self, None, -1, "Data filename here", size=DisplaySize()) def displayData(self): data = None # Load data into "data" object using my custom IntData(...) class: try: data = DFT.INTData("C:\SAR Test files\Tibet2008.int") except DFT.DataFileError: print("Error opening data file") except DFT.ResourceFileError: print("Error opening resource file") if data: # Assume a screen dpi of 96...seems very flakey to me: ScreenDPI = 96.0 # compute the width and height of figure using this dpi # and the rows and columns of the data for a 1:1 display ratio: FigureWidthInInches = (data.numcolumns / ScreenDPI) FigureHeightInInches = (data.numrows / ScreenDPI) print(FigureWidthInInches, FigureHeightInInches) # Instantiate Figure based on these parameters: self.fig = matplotlib.figure.Figur((FigureWidthInInches,FigureHeightInInches), dpi = ScreenDPI) self.canvas = FigureCanvasWxAgg(self, -1, self.fig) # Put everything into a sizer: sizer = BoxSizer(VERTICAL) #sizer.Add(self.canvas, 1, LEFT | TOP | GROW) sizer.Add(self.canvas, 0, LEFT | TOP) self.SetSizer(sizer) # self.Fit() a = self.fig.add_axes([0.075, 0.1, 0.75, 0.85]) self.im = a.imshow(data.getNumpyArray(), interpolation=None, cmap = data.getCustomColorMap()) if __name__ == '__main__': app = PySimpleApp() frame = DataFrame() frame.displayData() frame.Show() app.MainLoop() It displays but the plot is inside the figure i.e. the colormap of the data is within the figure that I've sized. matplotlib does this by design, of course, but I cannot figure out how to defeat it. For one thing, I don't think I'm sizing the figure correctly by setting (guessing at) the dpi and computing the inches...just seems wrong, but I can't find any tutorials or examples that show anything that sizes figures using pixels or screen coords. I always know the dimensions of my data a priori, so let's assume the following very simple situation: - I have a numpy.ndarray of data with 350 rows and 500 columns. How do I display it in the upper-left hand corner of the frame client with no tick marks/labels, etc...just the colormap at screen coords(0,0)->(349,499) (rows,columns)? Could someone post a few lines to do this? Thanks so much in advance! -L |
From: Eric F. <ef...@ha...> - 2009-02-25 23:26:19
|
If you have any intention of continuing to install updated versions of matplotlib as they come along, then please start now to eliminate the use of the matplotlib.numerix subpackage, if you have not already done so. It has not been used internally in matplotlib, or made available via pylab, for well over a year. In the next release of matplotlib based on the svn trunk, importing numerix will trigger a warning. In some later release, numerix will be removed entirely. Note that the sole present function of numerix is essentially to make numpy behave like the old Numeric. Eric |
From: Ryan M. <rm...@gm...> - 2009-02-25 21:13:48
|
Hi, When I combine mathtext with the stixsans fonts while mathtext.default is set to 'regular', horizontal text is not vertically aligned properly, like the baseline is moving. I've attached an image of what I see when I run the following code. It should be noted that I don't see anything like this on the vertical axis, and it all goes away if I stop using mathtext. import matplotlib.pyplot as plt from matplotlib import rcParams rcParams['font.size'] = 12.0 rcParams['mathtext.default'] = 'regular' rcParams['mathtext.fontset'] = 'stixsans' fig = plt.figure() plt.xlabel('ItLooksToMeLikeTheBaselineMoves $(g m^{-3})$') plt.ylabel('ItLooksToMeLikeTheBaselineMoves $(db km^{-1})$') plt.show() Thoughts? Am I doing something bad? Can anyone else reproduce this? Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Sent from: Norman Oklahoma United States. |
From: rlp_GMC <rp...@re...> - 2009-02-25 17:06:20
|
Here is some additional information regarding this problem OS -- Linux 2.6.22-16-generic #1 SMP Mon Jan 26 00:07:52 GMT 2009 i686 GNU/Linux Moved matplotlibrc to "os.environ['HOME'] = '/tmp/matlibconfig'" because of write permission problems with apache child processes. No customizations to matplotlibrc Ubuntu Gutsy Python-matplotlib 0.90.1-2ubuntu1 Python-matplotlib-data 0.90.1-2ubuntu1 Python-matplotlib-doc 0.90.1-2ubuntu1 Code # This code is called by another python script # and I am not even using the parameters that # are passed # Code works from python idle import sys, math import matplotlib_config_path # this sets configpath as described above import matplotlib matplotlib.use('Agg') # use non gui backend from matplotlib import pylab as plt import numpy as np import os,sys def VT(batt_v, batt_temp0, batt_temp1, batt_ts, plotfile, dur): t =[] for x in batt_ts: # time axis to 0 based t.append((x - batt_ts[0])/divsor[dur]) fig = plt.figure() ax1 = fig.add_subplot(111) # subplot 1 col x 1 row ax1.plot([1,2,3]) fig.savefig('test.png') Error returned is the same rlp_GMC wrote: > > When I try to save a fig to a file I get the error > > TclError Couldn't Connect to display ":0.0" > > I looked in the Maplotlib users manual (latest version pg 144-146) and > tried the following with no luck. BTW why is the same module named > differently Linux/Win ? > > import matplotlib > matplotlib.use('Agg') > import matplotlib.pylab as plt (linux ) or, import matplotlib.pyplot as > plt (Windows) > fig = plt.figure() > ax = fig.add_subplot(111) > ax.plot([1,2,3]) > fig.savefig('test.png') > > Is Matplotlib trying to display a plot to the monitor? > > rlp > -- View this message in context: http://www.nabble.com/TclError-Couldn%27t-Connect-to-display-%22%3A0.0%22-tp22176192p22207062.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: david.froger <dav...@gm...> - 2009-02-25 06:54:26
|
I think the new version of matplotlib corrected the bug. I have the problem with version 0.91.2, and there is no problem with the version 0.98.3. david.froger wrote: > > Hi, I have the same problem, I have joined examples. > > > > http://www.nabble.com/file/p22180990/example.py example.py > http://www.nabble.com/file/p22180990/example.pdf example.pdf > http://www.nabble.com/file/p22180990/example.pdf example.pdf > > Zack 24 wrote: >> >> Hi Richard, what exactly wrong here? >> I didn't found anything... >> >> On 4 May 2007, Richard Vernhes wrote: >>> Here is attached the eps file with misaligned labels and grid. >>> Richard >> >> >> >> -- >> Zack >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > -- View this message in context: http://www.nabble.com/Problem-with-the-position-of-tick-labels-in-postscript-file-tp10324639p22197268.html Sent from the matplotlib - users mailing list archive at Nabble.com. |