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
(1) |
2
(4) |
3
(12) |
4
(5) |
5
(30) |
6
(21) |
7
(20) |
8
(11) |
9
(9) |
10
(12) |
11
(11) |
12
(22) |
13
(22) |
14
(38) |
15
(25) |
16
(23) |
17
(20) |
18
(7) |
19
(13) |
20
(13) |
21
(18) |
22
(6) |
23
(7) |
24
(4) |
25
(9) |
26
(35) |
27
(37) |
28
(22) |
29
(27) |
30
(12) |
31
(4) |
Unless I'm mistaken the following should give you the results you're looking for: cmap = mpl.cm.jet ##I set colomap to 'jet' norm = mpl.colors.Normalize(vmin=5, vmax=15) exampleInt = 7 exampleColor = cmap( norm(7) ) poly = Polygon(seq,facecolor=exampleColor) ax.add_path(poly) Cheers, -Jonathan Helmus AlsCdz wrote: > I have something like (only the important bits of code): > > cmap = mpl.cm.jet ##I set colomap to 'jet' > norm = mpl.colors.Normalize(vmin=5, vmax=15) > > exampleInt = 7 > ##Here i would need a color value of 7 (in 5-15 range of jet colormap) > poly = Polygon(seg,facecolor=exampleInt(as color value)) > ax.add_patch(poly) > > > > Thank you for your help! >
Simson Garfinkel wrote: > Hi! > > Below is a sample program. It demonstrates two bugs when plotting date/ > time histograms. > > 1. When the y scale is made "log", the histogram points plot as > lines, but when the y scale is not log, they histogram plots as bars. > I do not think that the look of the bars should change depending on > whether or not the Y scale is logarithmic. Simson, I verified the strange behavior with log and/or date, but looking at the code did not yield any understanding of what the problems are. I hope someone who has worked on the bar code recently will sort this one out. Definitely, there is at least one major bug that needs to be fixed. > > 2. When the "agg.pdf" is removed, specifying "log" for the yscale > produces a TypeError on the mac (see below) This is mac-specific, and I don't have a mac, so I can't help with this, either. Eric > > > I would really like to know how to plot a histogram with real > bars ,rather than little lines. > > Thanks! > > import matplotlib > matplotlib.use('agg.pdf') > > if __name__=="__main__": > import datetime > import numpy as np > import matplotlib > import matplotlib.pyplot as pyplot > import matplotlib.dates as mdates > import matplotlib.mlab as mlab > > dates_and_counts = [[datetime.datetime(90,i,1), i*10] for i in > range(1,13)] > > dates, counts = zip(*dates_and_counts) > > years = mdates.YearLocator() # every year > months = mdates.MonthLocator() # every month > yearsFmt = mdates.DateFormatter('%Y') > > fig = pyplot.figure() > ax = fig.add_subplot(111) > ax.bar(dates,counts) > > ax.set_ylabel('file count') > ax.set_xlabel('file modification time (mtime)') > > ax.set_yscale('log') > > ax.xaxis.set_major_locator(years) > ax.xaxis.set_major_formatter(yearsFmt) > > datemin = datetime.date(min(dates).year, 1, 1) > datemax = datetime.date(max(dates).year, 1, 1) > ax.set_xlim(datemin, datemax) > ax.set_ylim(0,max(counts)) > > # format the coords message box > def price(x): return '$%1.2f'%x > ax.format_xdata = mdates.DateFormatter('%Y-%m-%d') > ax.format_ydata = price > ax.grid(True) > > # rotates and right aligns the x labels, and moves the bottom of the > # axes up to make room for them > fig.autofmt_xdate() > pyplot.savefig("hist.pdf",format='pdf') > > > > 12:12 PM m:~$ python f.py > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/matplotlib/figure.py", line 772, in draw > for a in self.axes: a.draw(renderer) > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/matplotlib/axes.py", line 1601, in draw > a.draw(renderer) > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/matplotlib/axis.py", line 710, in draw > tick.draw(renderer) > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/matplotlib/axis.py", line 193, in draw > self.label1.draw(renderer) > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/matplotlib/text.py", line 502, in draw > ismath=ismath) > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/matplotlib/backends/backend_macosx.py", line > 120, in draw_text > self._draw_mathtext(gc, x, y, s, prop, angle) > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/matplotlib/backends/backend_macosx.py", line > 112, in _draw_mathtext > gc.draw_mathtext(x, y, angle, 255 - image.as_array()) > TypeError: image has incorrect type (should be uint8) > 12:12 PM m:~$ % > V/r, > > > Simson Garfinkel > > > > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On Thu, Jan 8, 2009 at 3:53 PM, AlsCdz <cad...@si...> wrote: > > I have something like (only the important bits of code): > > cmap = mpl.cm.jet ##I set colomap to 'jet' > norm = mpl.colors.Normalize(vmin=5, vmax=15) > > exampleInt = 7 > ##Here i would need a color value of 7 (in 5-15 range of jet colormap) > poly = Polygon(seg,facecolor=exampleInt(as color value)) > ax.add_patch(poly) Almost there!In [9]: cmap = mpl.cm.jet In [10]: norm = mpl.colors.Normalize(vmin=5, vmax=15) In [11]: cmap(norm(7)) Out[11]: (0.0, 0.29999999999999999, 1.0, 1.0)
I have something like (only the important bits of code): cmap = mpl.cm.jet ##I set colomap to 'jet' norm = mpl.colors.Normalize(vmin=5, vmax=15) exampleInt = 7 ##Here i would need a color value of 7 (in 5-15 range of jet colormap) poly = Polygon(seg,facecolor=exampleInt(as color value)) ax.add_patch(poly) Thank you for your help! -- View this message in context: http://www.nabble.com/Integer-to-colormap-color-value-tp21360533p21360533.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hello, I am having some problems with the PS backend. I used the following script to create a PostScript file #!/usr/bin/env python import matplotlib matplotlib.use('PS') import matplotlib.pyplot as plt import numpy x1 = numpy.arange(0,5) y1 = x1 plt.plot(x1, y1) plt.savefig('image.ps') plt.show() When I tried to open the PostScript file in GSview, there is the following warning, and the file does not render properly. I have attached the PostScript file and a screenshot of the incorrect rendering. DSC Error At line 233: %%Page: 1 1 This %%Page: line occurred in the trailer, which is not legal. EPS files should be encapsulated in %%BeginDocument / %%EndDocument. If is possible that an EPS file was incorrectly encapsulated, and that we have been confused by the %%Trailer in an EPS file. The error can be eliminated by removing the line with %%EOF at line 230, and adding %%Trailer after line 1024, but I don't know anything about PostScript or if those changes would have any other effects. I only found this solution after comparing with the output from the Cairo backend. The same change to PostScript output can be achieved with the following diff (from svn diff), but again, I don't know if it is appropriate. Index: lib/matplotlib/backends/backend_ps.py =================================================================== --- lib/matplotlib/backends/backend_ps.py (revision 6760) +++ lib/matplotlib/backends/backend_ps.py (working copy) @@ -1006,6 +1006,7 @@ #print >>fh, "grestore" print >>fh, "end" print >>fh, "showpage" + print >>fh, "%%Trailer" if not isEPSF: print >>fh, "%%EOF" fh.close() Index: ttconv/pprdrv_tt.cpp =================================================================== --- ttconv/pprdrv_tt.cpp (revision 6760) +++ ttconv/pprdrv_tt.cpp (working copy) @@ -1070,7 +1070,6 @@ } /* end of if Type 42 not understood. */ stream.putline("FontName currentdict end definefont pop"); - stream.putline("%%EOF"); } /* end of ttfont_trailer() */ /*------------------------------------------------------------------ Paul Novak
I am sure this is a well know issue, so please feel free to just give a link if the answer and solution are long. I have a newly installed matplotlib installations running on Windows XP using Python 2.5.4. When I execute a simple 4 line example (copied directly from the PyPlot tutorial) in either PythonWin or IDLE, , it works fine and I terminate by right clicking on the generated figure and doing a Close. However, when I rerun the code from the IDE (makes no difference if I use PythonWin or IDLE) the figure hangs and eventually I get an abnormal exit and crash out of the IDE (in PythonWin there is a dialogue box that says "Runtime Error" in pythonwin.exe. This makes debugging in an IDE very clumsy, because I need to exit and restart it every time I run python code. The test code is simply: import matplotlib.pyplot as plt plt.plot([1,2,3]) plt.ylabel('Some Numbers') plt.show() Thanks in advance, David Lees
Thanks for the quick reply John...I got it working. To test the data file, I wrote a small script to display it outside of a wxPython GUI. I slightly modified the "image_demo.py" example to read from my data file and convert the data. This example reads in a file of complex values and displays them as an image: import numpy as np import matplotlib.cm as cm import matplotlib.mlab as mlab import matplotlib.pyplot as plt from scipy.fftpack import fftshift datatype = np.complex64 shape = (64,8800) fd = open('C:\\asp\\aspGui\\testData\\chan_output.bin', 'rb') read_data = np.fromfile(file=fd, dtype=datatype).reshape(shape) x = abs(fftshift(read_data)) im = plt.imshow(x,aspect='auto') plt.show() Next, as suggested, I wrote a small wxPython GUI that updates an image based on user selections. In this example, the image is updated when the user clicks on a button. The image will alternate between random values and zeros: import numpy as np import matplotlib.cm as cm import matplotlib.mlab as mlab import matplotlib.pyplot as plt from scipy.fftpack import fftshift from wx import * from matplotlib.figure import Figure from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from numpy.random import randn class PlotFigure(Frame): def __init__(self): Frame.__init__(self, None, -1, "Test embedded wxFigure") # make some random data... x = np.clip(randn(64,8800), -1, 1) # make the image... self.figure = Figure() self.axes = self.figure.add_subplot(111) self.canvas = FigureCanvas(self, -1, self.figure) self.myImage = self.axes.imshow(x,aspect='auto') # add button to change the image... self.myButton = Button(self,-1,'change data') self.myButton.Bind(wx.EVT_BUTTON, self.OnButtonClick) # add the image to the display... sizer = BoxSizer(VERTICAL) sizer.Add(self.canvas, 1, LEFT|TOP|GROW) sizer.Add(self.myButton) self.SetSizer(sizer) self.Fit() self.myFlag = 0 def OnButtonClick(self,event): if self.myFlag == 1: x = np.clip(randn(64,8800), -1, 1) self.myFlag = 0 else: x = np.zeros((64,8800),float) self.myFlag = 1 self.myImage.set_array(x) self.canvas.draw() if __name__ == '__main__': app = PySimpleApp() frame = PlotFigure() frame.Show() app.MainLoop() -----Original Message----- From: John Hunter [mailto:jd...@gm...] Sent: Wednesday, January 07, 2009 9:23 AM To: Lewis, Ambrose J. Cc: mat...@li... Subject: Re: [Matplotlib-users] updating image in wxpython gui... On Wed, Jan 7, 2009 at 7:57 AM, Lewis, Ambrose J. <AMB...@sa...> wrote: > Hi All: > > I'm very new to matplotlib, but it seems like a very powerful tool! > > I'm trying to write a wxpython GUI that displays an image from a data file > that the user selected. I've looked at a bunch of examples, but can't seem > to get it quite right. I've initialized the image to a buffer of zeros, but > can never get it to display the new data! > > Any/all help & suggestions are greatly appreciated!!! You might try simplifying the problem to see if it is matplotlib, your image data, your use of animation or wx. Ie, with *your* image data, can you get the image to update in the pylab shell In [1]: ax = subplot(111) In [2]: data = np.random.rand(10,5) In [3]: im = ax.imshow(data) In [4]: ax.figure.canvas.draw() In [5]: data2 = np.random.rand(10,5) In [6]: im.set_array(data2) In [7]: ax.figure.canvas.draw() If not, perhaps there is some massaging of the raw data that is needed. If that works, try taking the animation calls out of the loop (don't set the animated property, don't use draw_artist, don't use blit) but just set the image data and call canvas.draw() I did a quick read through of the code and did not find anything glaringly wrong, so you need to start simplifying the problem and reducing it to hone in on where the problem is occurring. If you post a free standing script that we can run , with the data, in all likelihood we can find the problem. You might even find it yourself in the process of developing a minimal script <wink> JDH
Again, I know little about the current state of Windows-land, but I can explain how the other backends have played out, and I assume the basics are the same. You have basically two choices -- a) write a backend that converts all the matplotlib drawing calls to WPF gc calls or b) write a backend that uses Agg to draw, and transfers the image buffer to a window. b) will be significantly less work, and give you *identical* results which have already been heavily tuned for high quality, but it *may* be theoretically less-efficient than a). Probably not enough so to worry about. So what you need to figure out is, given an image buffer (2D array of rgba pixels), which .net/WPF API call(s) you need to blit that to the screen, and how can you make those API calls from IronPython? Try to make a simple IronPython script that fills a Numpy array with image data, creates a window and draw the image in it (just leave matplotlib out of it for your experiments). Given that, you could use one of the backends that takes the (b) approach (such as backend_tkagg.py) as a guide to write one for .net. Mike V Srikanth wrote: > Looks like I am not making much progress. I have no problems using > IronPython - this is a C# application running on Vista, so it is > platform dependent. I also realized that any Windows Forms control can > be used in WPF, so if any one knows how to integrate matplotlib with > Windows Forms, please tell me how to do it. > > From what I understand matplotlib needs a graphics context to plot its > graph. If I can create the gc in Windows Forms and pass it to > matplotlib perhaps I can do what I want - but how do I do this using > IronPython? > > Solving this problem will be a great relief - the charting packages on > WPF are terrible and the licensing/pricing is ridiculous (see > http://www.softwarefx.com/sfxNetProducts/ChartFX/wpf/licensing.aspx) > > > ------------------------------------------------------------------------ > Get easy photo sharing with Windows LiveTM Photos. Drag n’ drop > <http://www.microsoft.com/windows/windowslive/photos.aspx> > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > ------------------------------------------------------------------------ > > _______________________________________________ > 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
Looks like I am not making much progress. I have no problems using IronPython - this is a C# application running on Vista, so it is platform dependent. I also realized that any Windows Forms control can be used in WPF, so if any one knows how to integrate matplotlib with Windows Forms, please tell me how to do it. >From what I understand matplotlib needs a graphics context to plot its graph. If I can create the gc in Windows Forms and pass it to matplotlib perhaps I can do what I want - but how do I do this using IronPython? Solving this problem will be a great relief - the charting packages on WPF are terrible and the licensing/pricing is ridiculous (see http://www.softwarefx.com/sfxNetProducts/ChartFX/wpf/licensing.aspx) _________________________________________________________________ Drag n’ drop—Get easy photo sharing with Windows LiveTM Photos. http://www.microsoft.com/windows/windowslive/photos.aspx
OK, Thanks for your help. // Johan On Wed, Jan 7, 2009 at 7:36 PM, Jouni K. Seppänen <jk...@ik...> wrote: > "Johan Ekh" <ekh...@gm...> writes: > > > I am trying to use helvetica and yes, text(r'1ドル+2+3={}1ドル+2+3') gives me > > helvetica for the non math mode case. > > But how do I get math mode to use the same font? > > You can't. The problem is that while Helvetica contains all the usual > letters and numbers, TeX math fonts must include Greek letters and a > variety of symbols. (There exists a commercial Helvetica-like math font > called HV Math from Micropress Inc.) > > Instead of getting math mode to use Helvetica, you want to make the tick > labels use text mode. I don't think there is existing support for that > in Matplotlib, but take a look at the Formatter classes in ticker.py - > if the functionality of OldScalarFormatter is enough for you, use that, > otherwise you'll have to hack ScalarFormatter to do what you want. If > you want the labels to look like they do right now except for the font > of the numbers, I think you could just wrap every number in > \textsf{...}, but there could be problems with spacing. > > > I've tried to set 'mathtext.rm': 'sans-serif' in my params dict > > The mathtext options have no effect in usetex mode - everything gets > rendered by TeX. > > -- > Jouni K. Seppänen > http://www.iki.fi/jks > > > > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Eric, Thanks for addressing the side-issue. If there were a simple way to list all of the backends, that might help? Any idea about the main point? On Jan 7, 2009, at 12:52 PM, Eric Firing wrote: > Simson Garfinkel wrote: > >> import matplotlib >> matplotlib.use('agg.pdf') > > Simson, > > Sorry to be addressing a side point, not your real questions, but > your example shows up a bug in matplotlib.use, which I will fix > shortly. There is an agg backend, and there is a pdf backend, but > there is no agg.pdf. You are simply getting the agg backend, and > when you save the figure you are using the pdf backend, which is > fine. Only the cairo backend has "sub-backends" or versions, like > "cairo.pdf" or "cairo.png" or "cairo.ps" or "cairo.svg". > > Eric >