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
(13) |
2
(3) |
3
(4) |
4
(24) |
5
(12) |
6
(11) |
7
(14) |
8
(17) |
9
(3) |
10
(5) |
11
(23) |
12
(7) |
13
(9) |
14
(17) |
15
(1) |
16
(2) |
17
(2) |
18
(11) |
19
(14) |
20
(9) |
21
(13) |
22
(12) |
23
(1) |
24
|
25
(7) |
26
(11) |
27
(20) |
28
(19) |
29
(11) |
30
(1) |
Hi, My issue is quite simple: I reload several times an image with the colorbar enabled, and thus, I have several colorbars, not only one. How can I disable this, and thus, get only one colorbar ? Cheers, -- http://scipy.org/FredericPetit
Hi Just installed numpy, numarray, scipy and matplotlib. All work fine execpt pylab. When I try to import I get the following error message: >>> from pylab import * Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packag es/pylab.py", line 1, in <module> from matplotlib.pylab import * File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packag es/matplotlib/pylab.py", line 199, in <module> import cm File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packag es/matplotlib/cm.py", line 5, in <module> import colors File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packag es/matplotlib/colors.py", line 38, in <module> from numerix import array, arange, take, put, Float, Int, putmask, \ File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packag es/matplotlib/numerix/__init__.py", line 20, in <module> from matplotlib import rcParams, verbose ImportError: cannot import name rcParams Any thoughts on why? Thanks mark -- Dr Mark G. Thomas Department of Biology University College London Wolfson House, 4 Stephenson Way, London, NW1 2HE Tel: ++44 (0) 207 679 7418 (int. 2-7418) Fax: ++44 (0) 207 679 5052 Mobile: 07973 725955 Email: m.t...@uc... Web: www.ucl.ac.uk/tcga/
Hi John, Ok- that makes sense. While on the subject of bar charts, can you tell me what I'm doing wrong here? def chart(request): from PIL import Image as PILImage from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from StringIO import StringIO fig = Figure() canvas = FigureCanvas(fig) ax = fig.add_subplot(111) from pylab import * N = 7 menMeans = (20, 35, 30, 35, 27, 21, 60) ind = arange(N) # the x locations for the groups width = 0.35 # the width of the bars p1 = bar(ind, menMeans, width, color='b') #ylabel('Time') title('Time In Minutes - Last 7 Days') xticks(ind+width, ('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', '*') ) canvas.draw() size = canvas.get_renderer().get_canvas_width_height() buf=canvas.tostring_rgb() im=PILImage.fromstring('RGB', size, buf, 'raw', 'RGB', 0, 1) imdata=StringIO() #ERROR LINE - 'module' object is not callable im.save(imdata, format='PNG') response = HttpResponse(imdata.getvalue(), mimetype='image/png') return response I keep getting an error saying 'module' object is not callable pointing to line 45 [imdata=StringIO()] This method worked fine for a pie chart. Thanks! Erik On 6/4/07, John Hunter <jd...@gm...> wrote: > On 6/4/07, Erik Wickstrom <er...@er...> wrote: > > > I'm trying to create a 3d bar chart like the one attached for use in a > > django site. I have no idea where to start. Is it even possible with > > matplotlib? > > Not really, and this is by design I've intentionally avoided all of > these power point style features which mostly detract from the > information in the graph. In a bar chart, once you've displayed the > height of the bar, there is no additional information to be had by > adding a gradient to it, or by making it look 3D. Those extra special > effects confuse the information that the graph actually contains. In > many cases, I think that's why people want to add them: if the data > are boring or don't say what you want, why not spice it up with some > sexy graph features so people won't look so hard at the data? > > The shadow on the pie chart was a nod to those who want "chart junk" > as Tufte calls these effects, but it was probably a mistake. > > http://www.edwardtufte.com/tufte > > I might accept a patch to add features like this if they remained off > by default, but I probably won't be adding it myself. > > JDH >
On 04.06.2007, at 23:19, Russell E. Owen wrote: > I've only checked WXAgg and TKAgg on my PPC Mac. If anyone could =20 > test it > on an Intel Mac I would be grateful. I have tested the MacPorts port of matplotlib 0.90.1 with GTKAgg on =20 OS X Intel -- that works. Greetings, Jochen --=20 Einigkeit und Recht und Freiheit http://www.Jochen-=20 Kuepper.de Libert=E9, =C9galit=E9, Fraternit=E9 GnuPG key: = CC1B0B4D Sex, drugs and rock-n-roll
I've built a binary installer for matplotlib 0.90.1 for Mac that includes support for: - TkAgg that works with a user-installed Aqua Tcl/Tk (unlike the standard build) or the standard old Tcl/Tk from Apple - WXAgg using wxPython 2.8. I've only checked WXAgg and TKAgg on my PPC Mac. If anyone could test it on an Intel Mac I would be grateful. For now you can get it here: <http://www.astro.washington.edu/rowen/pythonpackages/> In the long run it will be available here: <http://pythonmac.org/packages/py25-fat/index.html> -- Russell P.S. Build instructions are here: <http://www.astro.washington.edu/rowen/BuildingMatplotlibForMac.html>
On 6/4/07, Dave Baum <Dav...@mo...> wrote: > I have been looking at the problem of figures saved as EPS images not > printing correctly under from MS Word (an invalidrestore error is > generated). I believe that matplotlib is incorrectly creating the > EPS file. According to the DSC Spec (http://partners.adobe.com/ > public/developer/en/ps/5001.DSC_Spec.pdf), the Prolog section should > only contain procset definitions (which should also be enclosed in %% > BeginResource / %%EndResource pairs). It looks like the generated > EPS files contain an ordinary dictionary definition as well as font > information in the Prolog. I believe these commands should more > properly be moved to the Script section of the document (perhaps > within the %%BeginSetup/%%EndSetup sub-section). > > I manually edited an EPS file to make the prolog empty, and moved the > mpldict definition to the body of the file, and it then worked fine > with MS Word. This is great Dave -- could you send a patch against backend_ps for us? Thanks, JDH
On 6/4/07, Erik Wickstrom <er...@er...> wrote: > I'm trying to create a 3d bar chart like the one attached for use in a > django site. I have no idea where to start. Is it even possible with > matplotlib? Not really, and this is by design I've intentionally avoided all of these power point style features which mostly detract from the information in the graph. In a bar chart, once you've displayed the height of the bar, there is no additional information to be had by adding a gradient to it, or by making it look 3D. Those extra special effects confuse the information that the graph actually contains. In many cases, I think that's why people want to add them: if the data are boring or don't say what you want, why not spice it up with some sexy graph features so people won't look so hard at the data? The shadow on the pie chart was a nod to those who want "chart junk" as Tufte calls these effects, but it was probably a mistake. http://www.edwardtufte.com/tufte I might accept a patch to add features like this if they remained off by default, but I probably won't be adding it myself. JDH
I have been looking at the problem of figures saved as EPS images not printing correctly under from MS Word (an invalidrestore error is generated). I believe that matplotlib is incorrectly creating the EPS file. According to the DSC Spec (http://partners.adobe.com/ public/developer/en/ps/5001.DSC_Spec.pdf), the Prolog section should only contain procset definitions (which should also be enclosed in %% BeginResource / %%EndResource pairs). It looks like the generated EPS files contain an ordinary dictionary definition as well as font information in the Prolog. I believe these commands should more properly be moved to the Script section of the document (perhaps within the %%BeginSetup/%%EndSetup sub-section). I manually edited an EPS file to make the prolog empty, and moved the mpldict definition to the body of the file, and it then worked fine with MS Word. Dave Baum
Hi, I'm trying to create a 3d bar chart like the one attached for use in a django site. I have no idea where to start. Is it even possible with matplotlib? Thanks so much for your help! Erik
Hi John, I'm already using shadow=True - is it possible to increase the size of the shadow? I tried fig = figure(figsize=(6,6)) ax = fig.add_axes([0.05, 0.05, 0.9, 0.9], aspect='equal') figsize seems to change the size of the whole figure - I want a large chart, but less whitespace behind (tighter margins). When I use fig.add_axes() I get a grid around my pie chart. Also - how do I change the font used in the labels? I want to use something like Ariel. Thanks for your help!! Erik On 6/4/07, John Hunter <jd...@gm...> wrote: > On 6/4/07, Erik Wickstrom <er...@er...> wrote: > > I didn't see Eric answer your "oblong" part of the question. To make > it circular, use aspect='equal' > > ax = fig.add_subplot(111, aspect='equal') > > > -Can I give it more of a 3d look? Like the pie charts in MS Word? > > enable shadow=True, eg > > pie(...., shadow=True) > > > -How can I reduce the size of the canvas behind the chart? There is a > > lot of empty whitespace and I need to tighten up the margins as the > > graph will be displayed inline on an html page... > > Set your own axes dimensions, just make sure it is square > > fig = figure(figsize=(6,6)) > ax = fig.add_axes([0.05, 0.05, 0.9, 0.9], aspect='equal') > > > -for the colors, do I use numbers to customize the colors, or do I > > have to use colors from a built in pallet? > > You can do it either way, but if you want your colors to reflect the > magnitude of the percentage for a given slice, you will need to use a > colormap. See below > > > -lastly - is it possible to print the labels inside each slice of the > > chart, instead of outside? > > Unfortunately not, but there should be. I just added a new keyword > arg "labeldistance" which is a fraction of the radius at which to > print the label (default 1.1). Changes are in svn. > > > import matplotlib.cm as cm > > from pylab import figure, show > > # make a square figure and axes > fig = figure(figsize=(8,8)) > ax = fig.add_axes([0.05, 0.05, 0.90, 0.90], aspect='equal') > > labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' > fracs = [15,30,45, 10] > > jet = cm.get_cmap('RdYlGn', 256) > scalarmap = cm.ScalarMappable(cmap=jet) > scalarmap.set_clim(0, 100) > > colors = [scalarmap.to_rgba(frac) for frac in fracs] > > > ax.pie(fracs, labels=labels, colors=colors, > pctdistance=0.4, labeldistance=0.9, > autopct='%d%%', shadow=True) > > show() > >
Hello everybody, I think I really understand what Christopher expresses with 'you'll get a much better result, and probably less pain'. But because I couldn't find such a prompt and I'm not familiar with wxpython, I tried to build up my own one (using matplotlib.widgets.button) and run into two problems (already posted): a) When pressing for example 'g', 'l' or 'f' the button gets a grid, a log scale or gets full-screen. Can this be turned off? (subject: skip mpl-axes-interaction during key_press_event's) b) Some keys seem to be unaccessible: e.g. enter and backspace. The backend_(wx|gtk|tkagg).py might have to be modified to handle this. (subject: additional key events) Now my question is: Could a prompt be a useful part of matplotlib? Best regards and thanks in advance for any comments, Matthias Michler On Friday 25 May 2007 17:49, Christopher Barker wrote: > Matthias Michler wrote: > > I tried useing matplotlib as a GUI for my programs. I'd like to > > incorporate things like Buttons, Sliders, RadioButtons and so on from > > matplotlib.widgets, but missed a prompt (i.e. a field to input text > > and/or numbers). > > I'm going to advise you to not try to do that. MPL really isn't a GUI > toolkit, there there are a number of very nice and complete GUI toolkits > that MPL works just great with. It will require a bit of learning up > front, but you'll get a much better result, and probably less pain in > the process. My thoughts: > > For Cross platform (Windows, *nix, OS-X): wxPython or pyQT. Tk's OK too, > but at least until recently, not very native or robust on OS-X. > > For *nix only: PyGTK > > For OS-X only: Maybe pyObjC, but only if MPL is working OK with the > Cocoa back-end -- or has development stalled there? > > See the "embedding in ..." examples, and be sure to check out wxMPL if > you want to use wxPython. > > -Chris
On 6/4/07, Werner F. Bruhin <wer...@fr...> wrote: > John Hunter wrote: > > matplotlib 0.90.1 is out and available for download from the sourceforge site. > > > Just installed it. Works very nicely with the exception of some font > issue. > > I am getting this: > Could not match Bitstream Vera Serif, New Century Schoolbook, Century > Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times > New Roman, Times, Palatino, Charter, serif, normal, normal. Returning > C:\Python25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf make sure you are picking up the most recent matplotlibrc. We changed the font ordering some time ago. Then run with --verbose-helpful and post the output, maybe --verbose-debug, and we will see if we can figure out what is going on. I haven't run under windows for some time.
John Hunter wrote: > matplotlib 0.90.1 is out and available for download from the sourceforge site. > Just installed it. Works very nicely with the exception of some font issue. I am getting this: Could not match Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif, normal, normal. Returning C:\Python25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf The only font commands I use are FontProperties(size='smaller') or FontProperties(size=10) as far as I can see. What do I need to do to get read of this? I don't just want to change the verbose option. Any hints very appreciated. Werner P.S. John, sorry for the first mail sent to you instead of the list. > The 0.90 release is the last release in which we will continue to use > the numerix layer internally and build extensions for Numeric, > numarray and numpy. Goingin forward, we will continue to provide the > numerix compatibility layer for external scripts, and recent versions > of Numeric and numarray should continue to work when passed into mpl, > but we will be compiling extensions against numpy only and importing > it directly internally. > > Thanks Charlie Moad for handling the release and binary builds, and to > all the mpl developers who made contributions. See > http://matploltib.sf.net/whats_new.html for a summary of new features, > and the CHANGELOG included below for details. As always, be sure to > consult http://matplotlib.sf.net/API_CHANGES to read about any changes > to the API > > http://cheeseshop.python.org/pypi/matplotlib/ > > http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 > > =============================================================== > 2007年06月02日 Released 0.90.1 at revision 3352 > > 2007年06月02日 Display only meaningful labels when calling legend() > without args. - NN > > 2007年06月02日 Have errorbar follow the color cycle even if line is not plotted. > Suppress plotting of errorbar caps for capsize=0. - NN > > 2007年06月02日 Set markers to same alpha value as line. - NN > > 2007年06月02日 Fix mathtext position in svg backend. - NN > > 2007年06月01日 Deprecate Numeric and numarray for use as numerix. Props to > Travis -- job well done. - ADS > > 2007年05月18日 Added LaTeX unicode support. Enable with the > 'text.latex.unicode' rcParam. This requires the ucs and > inputenc LaTeX packages. - ADS > > 2007年04月23日 Fixed some problems with polar -- added general polygon > clipping to clip the lines a nd grids to the polar axes. > Added support for set_rmax to easily change the maximum > radial grid. Added support for polar legend - JDH > > 2007年04月16日 Added Figure.autofmt_xdate to handle adjusting the bottom > and rotating the tick labels for date plots when the ticks > often overlap - JDH > > 2007年04月09日 Beginnings of usetex support for pdf backend. -JKS > > 2007年04月07日 Fixed legend/LineCollection bug. Added label support > to collections. - EF > > 2007年04月06日 Removed deprecated support for a float value as a gray-scale; > now it must be a string, like '0.5'. Added alpha kwarg to > ColorConverter.to_rgba_list. - EF > > 2007年04月06日 Fixed rotation of ellipses in pdf backend > (sf bug #1690559) -JKS > > 2007年04月04日 More matshow tweaks; documentation updates; new method > set_bounds() for formatters and locators. - EF > > 2007年04月02日 Fixed problem with imshow and matshow of integer arrays; > fixed problems with changes to color autoscaling. - EF > > 2007年04月01日 Made image color autoscaling work correctly with > a tracking colorbar; norm.autoscale now scales > unconditionally, while norm.autoscale_None changes > only None-valued vmin, vmax. - EF > > 2007年03月31日 Added a qt-based subplot-adjustment dialog - DSD > > 2007年03月30日 Fixed a bug in backend_qt4, reported on mpl-dev - DSD > > 2007年03月26日 Removed colorbar_classic from figure.py; fixed bug in > Figure.clf() in which _axobservers was not getting > cleared. Modernization and cleanups. - EF > > 2007年03月26日 Refactored some of the units support -- units now live in > the respective x and y Axis instances. See also > API_CHANGES for some alterations to the conversion > interface. JDH > > 2007年03月25日 Fix masked array handling in quiver.py for numpy. (Numeric > and numarray support for masked arrays is broken in other > ways when using quiver. I didn't pursue that.) - ADS > > 2007年03月23日 Made font_manager.py close opened files. - JKS > > 2007年03月22日 Made imshow default extent match matshow - EF > > 2007年03月22日 Some more niceties for xcorr -- a maxlags option, normed > now works for xcorr as well as axorr, usevlines is > supported, and a zero correlation hline is added. See > examples/xcorr_demo.py. Thanks Sameer for the patch. - > JDH > > 2007年03月21日 Axes.vlines and Axes.hlines now create and returns a > LineCollection, not a list of lines. This is much faster. > The kwarg signature has changed, so consult the docs. > Modified Axes.errorbar which uses vlines and hlines. See > API_CHANGES; the return signature for these three functions > is now different > > 2007年03月20日 Refactored units support and added new examples - JDH > > 2007年03月19日 Added Mike's units patch - JDH > > 2007年03月18日 Matshow as an Axes method; test version matshow1() in > pylab; added 'integer' Boolean kwarg to MaxNLocator > initializer to force ticks at integer locations. - EF > > 2007年03月17日 Preliminary support for clipping to paths agg - JDH > > 2007年03月17日 Text.set_text() accepts anything convertible with '%s' - EF > > 2007年03月14日 Add masked-array support to hist. - EF > > 2007年03月03日 Change barh to take a kwargs dict and pass it to bar. > Fixes sf bug #1669506. > > 2007年03月02日 Add rc parameter pdf.inheritcolor, which disables all > color-setting operations in the pdf backend. The idea is > that you include the resulting file in another program and > set the colors (both stroke and fill color) there, so you > can use the same pdf file for e.g. a paper and a > presentation and have them in the surrounding color. You > will probably not want to draw figure and axis frames in > that case, since they would be filled in the same color. - JKS > > 2007年02月26日 Prevent building _wxagg.so with broken Mac OS X wxPython. - ADS > > 2007年02月23日 Require setuptools for Python 2.3 - ADS > > 2007年02月22日 WXAgg accelerator updates - KM > WXAgg's C++ accelerator has been fixed to use the correct wxBitmap > constructor. > > The backend has been updated to use new wxPython functionality to > provide fast blit() animation without the C++ accelerator. This > requires wxPython 2.8 or later. Previous versions of wxPython can > use the C++ acclerator or the old pure Python routines. > > setup.py no longer builds the C++ accelerator when wxPython >= 2.8 > is present. > > The blit() method is now faster regardless of which agg/wxPython > conversion routines are used. > > 2007年02月21日 Applied the PDF backend patch by Nicolas Grilly. > This impacts several files and directories in matplotlib: > > - Created the directory lib/matplotlib/mpl-data/fonts/pdfcorefonts, > holding AFM files for the 14 PDF core fonts. These fonts are > embedded in every PDF viewing application. > > - setup.py: Added the directory pdfcorefonts to package_data. > > - lib/matplotlib/__init__.py: Added the default parameter > 'pdf.use14corefonts'. When True, the PDF backend uses > only the 14 PDF core fonts. > > - lib/matplotlib/afm.py: Added some keywords found in > recent AFM files. Added a little workaround to handle > Euro symbol. > > - lib/matplotlib/fontmanager.py: Added support for the 14 > PDF core fonts. These fonts have a dedicated cache (file > pdfcorefont.cache), not the same as for other AFM files > (file .afmfont.cache). Also cleaned comments to conform > to CODING_GUIDE. > > - lib/matplotlib/backends/backend_pdf.py: > Added support for 14 PDF core fonts. > Fixed some issues with incorrect character widths and > encodings (works only for the most common encoding, > WinAnsiEncoding, defined by the official PDF Reference). > Removed parameter 'dpi' because it causes alignment issues. > > -JKS (patch by Nicolas Grilly) > > 2007年02月17日 Changed ft2font.get_charmap, and updated all the files where > get_charmap is mentioned - ES > > 2007年02月13日 Added barcode demo- JDH > > 2007年02月13日 Added binary colormap to cm - JDH > > 2007年02月13日 Added twiny to pylab - JDH > > 2007年02月12日 Moved data files into lib/matplotlib so that setuptools' > develop mode works. Re-organized the mpl-data layout so > that this source structure is maintained in the > installation. (I.e. the 'fonts' and 'images' > sub-directories are maintained in site-packages.) Suggest > removing site-packages/matplotlib/mpl-data and > ~/.matplotlib/ttffont.cache before installing - ADS > > 2007年02月07日 Committed Rob Hetland's patch for qt4: remove > references to text()/latin1(), plus some improvements > to the toolbar layout - DSD > > ------------------------------------------------------------------------- > 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 > > >
Hello darkside, maybe the following little examples helps you with disconnecting: >-------------------------------------------------------------------------------- from pylab import * def event_response(event): print event.name disconnect(cid) subplot(111) cid = connect('button_press_event', event_response) show() >----------------------------------------------------------------------------- concerning opening of figures: I think it is not possible to open a figure after the show() ( I asked some time ago with subject "open / close or set active figures during mainloop", but unfortunately without response). Maybe it would be sufficient for you to clean the figure or the axes (pylab.clf/cla), resetting labels and use the same connected event several times. best regards, Matthias On Monday 04 June 2007 04:28, darkside wrote: > I'm trying to use matplotlib to get an x point on some figures by mouse > clicking. > To do this I try the next example: > ------------------------- > datax=[] > datay =[] > def click(event): > x, y = event.x, event.y > if event.button == 1: > if event.inaxes: > print 'data coords: ', event.xdata, event.ydata > datax.append(event.xdata) > datay.append(event.ydata) > if event.button == 3: > pylab.close() > return datax,datay > fig = pylab.figure(figsize=(8,6)) > ax = fig.add_subplot(111) > > - Ignored: > ax.plot(pylab.arange(10)) > cursor = Cursor(ax, useblit=False, color='red', linewidth=2) > cursor.horizOn = False > > pylab.connect('button_press_event', click) > > pylab.show() > pylab.disconnect(click) > print 'los arrays de data son: ', datax,datay > ------------------------------------------------------ > > My problem is tha I want to only be able to click each figure once, then > lock the > figure (making it unclickable), close it and open another one. But I'm > not > able to > implement this. > Anyone have any suggestions?.
matplotlib 0.90.1 is out and available for download from the sourceforge site. The 0.90 release is the last release in which we will continue to use the numerix layer internally and build extensions for Numeric, numarray and numpy. Goingin forward, we will continue to provide the numerix compatibility layer for external scripts, and recent versions of Numeric and numarray should continue to work when passed into mpl, but we will be compiling extensions against numpy only and importing it directly internally. Thanks Charlie Moad for handling the release and binary builds, and to all the mpl developers who made contributions. See http://matploltib.sf.net/whats_new.html for a summary of new features, and the CHANGELOG included below for details. As always, be sure to consult http://matplotlib.sf.net/API_CHANGES to read about any changes to the API http://cheeseshop.python.org/pypi/matplotlib/ http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 =============================================================== 2007年06月02日 Released 0.90.1 at revision 3352 2007年06月02日 Display only meaningful labels when calling legend() without args. - NN 2007年06月02日 Have errorbar follow the color cycle even if line is not plotted. Suppress plotting of errorbar caps for capsize=0. - NN 2007年06月02日 Set markers to same alpha value as line. - NN 2007年06月02日 Fix mathtext position in svg backend. - NN 2007年06月01日 Deprecate Numeric and numarray for use as numerix. Props to Travis -- job well done. - ADS 2007年05月18日 Added LaTeX unicode support. Enable with the 'text.latex.unicode' rcParam. This requires the ucs and inputenc LaTeX packages. - ADS 2007年04月23日 Fixed some problems with polar -- added general polygon clipping to clip the lines a nd grids to the polar axes. Added support for set_rmax to easily change the maximum radial grid. Added support for polar legend - JDH 2007年04月16日 Added Figure.autofmt_xdate to handle adjusting the bottom and rotating the tick labels for date plots when the ticks often overlap - JDH 2007年04月09日 Beginnings of usetex support for pdf backend. -JKS 2007年04月07日 Fixed legend/LineCollection bug. Added label support to collections. - EF 2007年04月06日 Removed deprecated support for a float value as a gray-scale; now it must be a string, like '0.5'. Added alpha kwarg to ColorConverter.to_rgba_list. - EF 2007年04月06日 Fixed rotation of ellipses in pdf backend (sf bug #1690559) -JKS 2007年04月04日 More matshow tweaks; documentation updates; new method set_bounds() for formatters and locators. - EF 2007年04月02日 Fixed problem with imshow and matshow of integer arrays; fixed problems with changes to color autoscaling. - EF 2007年04月01日 Made image color autoscaling work correctly with a tracking colorbar; norm.autoscale now scales unconditionally, while norm.autoscale_None changes only None-valued vmin, vmax. - EF 2007年03月31日 Added a qt-based subplot-adjustment dialog - DSD 2007年03月30日 Fixed a bug in backend_qt4, reported on mpl-dev - DSD 2007年03月26日 Removed colorbar_classic from figure.py; fixed bug in Figure.clf() in which _axobservers was not getting cleared. Modernization and cleanups. - EF 2007年03月26日 Refactored some of the units support -- units now live in the respective x and y Axis instances. See also API_CHANGES for some alterations to the conversion interface. JDH 2007年03月25日 Fix masked array handling in quiver.py for numpy. (Numeric and numarray support for masked arrays is broken in other ways when using quiver. I didn't pursue that.) - ADS 2007年03月23日 Made font_manager.py close opened files. - JKS 2007年03月22日 Made imshow default extent match matshow - EF 2007年03月22日 Some more niceties for xcorr -- a maxlags option, normed now works for xcorr as well as axorr, usevlines is supported, and a zero correlation hline is added. See examples/xcorr_demo.py. Thanks Sameer for the patch. - JDH 2007年03月21日 Axes.vlines and Axes.hlines now create and returns a LineCollection, not a list of lines. This is much faster. The kwarg signature has changed, so consult the docs. Modified Axes.errorbar which uses vlines and hlines. See API_CHANGES; the return signature for these three functions is now different 2007年03月20日 Refactored units support and added new examples - JDH 2007年03月19日 Added Mike's units patch - JDH 2007年03月18日 Matshow as an Axes method; test version matshow1() in pylab; added 'integer' Boolean kwarg to MaxNLocator initializer to force ticks at integer locations. - EF 2007年03月17日 Preliminary support for clipping to paths agg - JDH 2007年03月17日 Text.set_text() accepts anything convertible with '%s' - EF 2007年03月14日 Add masked-array support to hist. - EF 2007年03月03日 Change barh to take a kwargs dict and pass it to bar. Fixes sf bug #1669506. 2007年03月02日 Add rc parameter pdf.inheritcolor, which disables all color-setting operations in the pdf backend. The idea is that you include the resulting file in another program and set the colors (both stroke and fill color) there, so you can use the same pdf file for e.g. a paper and a presentation and have them in the surrounding color. You will probably not want to draw figure and axis frames in that case, since they would be filled in the same color. - JKS 2007年02月26日 Prevent building _wxagg.so with broken Mac OS X wxPython. - ADS 2007年02月23日 Require setuptools for Python 2.3 - ADS 2007年02月22日 WXAgg accelerator updates - KM WXAgg's C++ accelerator has been fixed to use the correct wxBitmap constructor. The backend has been updated to use new wxPython functionality to provide fast blit() animation without the C++ accelerator. This requires wxPython 2.8 or later. Previous versions of wxPython can use the C++ acclerator or the old pure Python routines. setup.py no longer builds the C++ accelerator when wxPython >= 2.8 is present. The blit() method is now faster regardless of which agg/wxPython conversion routines are used. 2007年02月21日 Applied the PDF backend patch by Nicolas Grilly. This impacts several files and directories in matplotlib: - Created the directory lib/matplotlib/mpl-data/fonts/pdfcorefonts, holding AFM files for the 14 PDF core fonts. These fonts are embedded in every PDF viewing application. - setup.py: Added the directory pdfcorefonts to package_data. - lib/matplotlib/__init__.py: Added the default parameter 'pdf.use14corefonts'. When True, the PDF backend uses only the 14 PDF core fonts. - lib/matplotlib/afm.py: Added some keywords found in recent AFM files. Added a little workaround to handle Euro symbol. - lib/matplotlib/fontmanager.py: Added support for the 14 PDF core fonts. These fonts have a dedicated cache (file pdfcorefont.cache), not the same as for other AFM files (file .afmfont.cache). Also cleaned comments to conform to CODING_GUIDE. - lib/matplotlib/backends/backend_pdf.py: Added support for 14 PDF core fonts. Fixed some issues with incorrect character widths and encodings (works only for the most common encoding, WinAnsiEncoding, defined by the official PDF Reference). Removed parameter 'dpi' because it causes alignment issues. -JKS (patch by Nicolas Grilly) 2007年02月17日 Changed ft2font.get_charmap, and updated all the files where get_charmap is mentioned - ES 2007年02月13日 Added barcode demo- JDH 2007年02月13日 Added binary colormap to cm - JDH 2007年02月13日 Added twiny to pylab - JDH 2007年02月12日 Moved data files into lib/matplotlib so that setuptools' develop mode works. Re-organized the mpl-data layout so that this source structure is maintained in the installation. (I.e. the 'fonts' and 'images' sub-directories are maintained in site-packages.) Suggest removing site-packages/matplotlib/mpl-data and ~/.matplotlib/ttffont.cache before installing - ADS 2007年02月07日 Committed Rob Hetland's patch for qt4: remove references to text()/latin1(), plus some improvements to the toolbar layout - DSD
On 6/4/07, Erik Wickstrom <er...@er...> wrote: I didn't see Eric answer your "oblong" part of the question. To make it circular, use aspect='equal' ax = fig.add_subplot(111, aspect='equal') > -Can I give it more of a 3d look? Like the pie charts in MS Word? enable shadow=True, eg pie(...., shadow=True) > -How can I reduce the size of the canvas behind the chart? There is a > lot of empty whitespace and I need to tighten up the margins as the > graph will be displayed inline on an html page... Set your own axes dimensions, just make sure it is square fig = figure(figsize=(6,6)) ax = fig.add_axes([0.05, 0.05, 0.9, 0.9], aspect='equal') > -for the colors, do I use numbers to customize the colors, or do I > have to use colors from a built in pallet? You can do it either way, but if you want your colors to reflect the magnitude of the percentage for a given slice, you will need to use a colormap. See below > -lastly - is it possible to print the labels inside each slice of the > chart, instead of outside? Unfortunately not, but there should be. I just added a new keyword arg "labeldistance" which is a fraction of the radius at which to print the label (default 1.1). Changes are in svn. import matplotlib.cm as cm from pylab import figure, show # make a square figure and axes fig = figure(figsize=(8,8)) ax = fig.add_axes([0.05, 0.05, 0.90, 0.90], aspect='equal') labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' fracs = [15,30,45, 10] jet = cm.get_cmap('RdYlGn', 256) scalarmap = cm.ScalarMappable(cmap=jet) scalarmap.set_clim(0, 100) colors = [scalarmap.to_rgba(frac) for frac in fracs] ax.pie(fracs, labels=labels, colors=colors, pctdistance=0.4, labeldistance=0.9, autopct='%d%%', shadow=True) show()
Thanks Eric! Some followup questions. -Can I give it more of a 3d look? Like the pie charts in MS Word? -How can I reduce the size of the canvas behind the chart? There is a lot of empty whitespace and I need to tighten up the margins as the graph will be displayed inline on an html page... -for the colors, do I use numbers to customize the colors, or do I have to use colors from a built in pallet? -lastly - is it possible to print the labels inside each slice of the chart, instead of outside? Thanks! Erik On 6/3/07, Eric Firing <ef...@ha...> wrote: > Forgot "reply-to-all". > > Eric > > > ---------- Forwarded message ---------- > From: Eric Firing <ef...@ha...> > To: Erik Wickstrom <er...@er...> > Date: 2007年6月03日 16:19:20 -1000 > Subject: Re: [Matplotlib-users] Pie chart is "stretched" > Erik Wickstrom wrote: > > Hi all, > > > > I'm trying to generate a pie chart to use in my django web app. But > > it keeps rendering in a rectanuglar canvas instead of a square one, so > see inserted call to set_aspect method, below. > > the pie is oblong instead of circular. It also keeps rendering with a > > grey background, I need the background to be white. > see inserted call to set_facecolor method, below. > > > > I've attached a jpg of the chart - here is my source. > Do you really want jpeg? It is suitable for photos, but very inefficient > (and a bit fuzzy) for things like pie charts. I would use png format > instead, which is efficient for this sort of plot. > > > > > def chart(request): > > from PIL import Image as PILImage > > from matplotlib.backends.backend_agg import FigureCanvasAgg as > > FigureCanvas > > from matplotlib.figure import Figure > > from StringIO import StringIO > > fig = Figure() > > canvas = FigureCanvas(fig) > > ax = fig.add_subplot(111) > > #ax.plot([1,2,3]) > > labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' > > fracs = [15,30,45, 10] > > ax.pie(fracs, labels=labels, shadow=True) > > ax.set_aspect('equal', adjustable='box') > fig.set_facecolor('w') > > > #ax.set_title('hi mom') > > ax.grid(True) > > #ax.set_xlabel('time') > > #ax.set_ylabel('volts') > > canvas.draw() > > size = canvas.get_renderer().get_canvas_width_height() > > buf=canvas.tostring_rgb() > > im=PILImage.fromstring('RGB', size, buf, 'raw', 'RGB', 0, 1) > > imdata=StringIO() > > im.save(imdata, format='JPEG') > > response = HttpResponse(imdata.getvalue(), mimetype='image/jpeg') > > return response > > > > Also - can I choose my own colors for the slices? > > Yes, use the "colors" kwarg to specify your own list. From the docstring: > > PIE(x, explode=None, labels=None, > colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'), > autopct=None, pctdistance=0.6, shadow=False) > > Eric > > > ------------------------------------------------------------------------- > 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 > >
On Friday 01 June 2007 18:52, Jeff Whitaker wrote: > Jesper: Here's a better way, that allows you to label the meridians and > parallels. It will only work for projection='cyl', although a similar > solution could be worked up for 'merc' and 'mill'. <snip> Thanks, I have implemented that solution. The only issue I have discovered so far is that I also had to recalculate the aspect ratio of the map (since I use this to calculate the figure size): def resetmapbounds(map,llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat): map.llcrnrlat = llcrnrlat; map.llcrnrlon = llcrnrlon map.urcrnrlat = urcrnrlat; map.urcrnrlon = urcrnrlon map.llcrnry = map.llcrnrlat; map.llcrnrx=map.llcrnrlon map.urcrnry = map.urcrnrlat; map.urcrnrx=map.urcrnrlon map.aspect = (map.urcrnrlat-map.llcrnrlat)/(map.urcrnrlon-map.llcrnrlon) return map This only works for projection='cyl'. For other projections more work is needed (see basemap.py). - Jesper
Stefan Kueppers wrote: > Hi all, > > I am a matplotlib novice and am having problems with imported floats > generated by a Perl script using the Maxmind Geo::IP library. > > I keep getting CXX TypeErrors which I can not seem to eliminate. > Any pointers for this novice please? > > I write files that return longitude and latitude and then generate a > plot script with the data set. > > > Many Thanks! > > ____________________minimally altered example plot script_______________ > > > from matplotlib.toolkits.basemap import Basemap > import pylab as p > # set up orthographic map projection with > # perspective of satellite looking down at 50N, 100W. > # use low resolution coastlines. > # don' t plot features that are smaller than 1000 square km > map = Basemap( > projection = 'ortho', > lat_0 = 50, > lon_0 = -100, > resolution = 'c', > area_thresh = 1000. > ) > # draw coastlines, country boundaries, fill continents. > map.drawcoastlines(linewidth=0.4) > map.drawcountries(linewidth=0.2) > map.fillcontinents( color = 'coral' ) > # draw the edge of the map projection region (the projection limb) > map.drawmapboundary() > # draw lat/lon grid lines every 30 degrees. > map.drawmeridians( p . arange( 0, 360, 30 ) ) > map.drawparallels( p . arange( -90, 90, 30 ) ) > # lat/lon coordinates of five cities. > > > ##---------------------changes > #data [altered data set import from Maxmind Geo::IP lookups > lats=[-0.0000, 1096176317235200.0000, 31226649198326710000.0000, 0.0000, > 0.0000] > lons=[3.0542, 3.0423, 3.1635, 3.1523, 3.1523] > cities=['Vienna US', 'Mountain View US', 'Derby GB', 'London GB', > 'London GB'] > ##---------------------end chages > > # compute the native map projection coordinates for cities. > > > #map floats > x,y = map(lons,lats) > > > # plot filled circles at the locations of the cities. > map.plot(x,y,'bo') > > # plot the names of those five cities. > for name,xpt,ypt in zip(cities,x,y): > #p.text(xpt+50000,ypt+50000,name) > p.text(xpt,ypt,name) > p.show() > > Stefan: The lons and lats must be specified in degrees. I don't know what units you are getting from Geo::IP, but they sure aren't degrees. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328
Hi all, I am a matplotlib novice and am having problems with imported floats generated by a Perl script using the Maxmind Geo::IP library. I keep getting CXX TypeErrors which I can not seem to eliminate. Any pointers for this novice please? I write files that return longitude and latitude and then generate a plot script with the data set. Many Thanks! ____________________minimally altered example plot script_______________ from matplotlib.toolkits.basemap import Basemap import pylab as p # set up orthographic map projection with # perspective of satellite looking down at 50N, 100W. # use low resolution coastlines. # don' t plot features that are smaller than 1000 square km map = Basemap( projection = 'ortho', lat_0 = 50, lon_0 = -100, resolution = 'c', area_thresh = 1000. ) # draw coastlines, country boundaries, fill continents. map.drawcoastlines(linewidth=0.4) map.drawcountries(linewidth=0.2) map.fillcontinents( color = 'coral' ) # draw the edge of the map projection region (the projection limb) map.drawmapboundary() # draw lat/lon grid lines every 30 degrees. map.drawmeridians( p . arange( 0, 360, 30 ) ) map.drawparallels( p . arange( -90, 90, 30 ) ) # lat/lon coordinates of five cities. ##---------------------changes #data [altered data set import from Maxmind Geo::IP lookups lats=[-0.0000, 1096176317235200.0000, 31226649198326710000.0000, 0.0000, 0.0000] lons=[3.0542, 3.0423, 3.1635, 3.1523, 3.1523] cities=['Vienna US', 'Mountain View US', 'Derby GB', 'London GB', 'London GB'] ##---------------------end chages # compute the native map projection coordinates for cities. #map floats x,y = map(lons,lats) # plot filled circles at the locations of the cities. map.plot(x,y,'bo') # plot the names of those five cities. for name,xpt,ypt in zip(cities,x,y): #p.text(xpt+50000,ypt+50000,name) p.text(xpt,ypt,name) p.show() __________________________________________________ ##########error trace############################## Exception in Tkinter callback Traceback (most recent call last): File "c:\python25\lib\lib-tk\Tkinter.py", line 1403, in __call__ return self.func(*args) File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\backends\backend_tkagg.py", line 151, in resize self.show() File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\backends\backend_tkagg.py", line 154, in draw FigureCanvasAgg.draw(self) File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\backends\backend_agg.py", line 392, in draw self.figure.draw(renderer) File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\figure.py", line 569, in draw for a in self.axes: a.draw(renderer) File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\axes.py", line 1155, in draw a.draw(renderer) File "c:\python25\lib\site-packages\matplotlib-0.90.0-py2.5-win32.egg\matplotl ib\text.py", line 414, in draw for line, wh, x, y in info: TypeError: CXX: type error.
first of all sorry for cross posting As I wrote some time ago we are trying to write a book proposal about the use of python/scipy/numpy in chemometrics and analytical chemistry. Since now I've received positive answer from eight authors and the only "missing" chapter is one about the use of python in digital signal processing (I've contacted some possible authors but since now they are busy). The schedule will not too tight and the chapter doesnt' need to be too long. Hope to hear from you soon Giorgio
Forgot "reply-to-all". Eric
I'm trying to use matplotlib to get an x point on some figures by mouse clicking. To do this I try the next example: ------------------------- datax=[] datay =[] def click(event): x, y = event.x, event.y if event.button == 1: if event.inaxes: print 'data coords: ', event.xdata, event.ydata datax.append(event.xdata) datay.append(event.ydata) if event.button == 3: pylab.close() return datax,datay fig = pylab.figure(figsize=(8,6)) ax = fig.add_subplot(111) - Ignored: ax.plot(pylab.arange(10)) cursor = Cursor(ax, useblit=False, color='red', linewidth=2) cursor.horizOn = False pylab.connect('button_press_event', click) pylab.show() pylab.disconnect(click) print 'los arrays de data son: ', datax,datay ------------------------------------------------------ My problem is tha I want to only be able to click each figure once, then lock the figure (making it unclickable), close it and open another one. But I'm not able to implement this. Anyone have any suggestions?.
Hi all, I'm trying to generate a pie chart to use in my django web app. But it keeps rendering in a rectanuglar canvas instead of a square one, so the pie is oblong instead of circular. It also keeps rendering with a grey background, I need the background to be white. I've attached a jpg of the chart - here is my source. def chart(request): from PIL import Image as PILImage from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from StringIO import StringIO fig = Figure() canvas = FigureCanvas(fig) ax = fig.add_subplot(111) #ax.plot([1,2,3]) labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' fracs = [15,30,45, 10] ax.pie(fracs, labels=labels, shadow=True) #ax.set_title('hi mom') ax.grid(True) #ax.set_xlabel('time') #ax.set_ylabel('volts') canvas.draw() size = canvas.get_renderer().get_canvas_width_height() buf=canvas.tostring_rgb() im=PILImage.fromstring('RGB', size, buf, 'raw', 'RGB', 0, 1) imdata=StringIO() im.save(imdata, format='JPEG') response = HttpResponse(imdata.getvalue(), mimetype='image/jpeg') return response Also - can I choose my own colors for the slices? Thanks! Erik