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) |
|
From: Yang Z. <yan...@gm...> - 2009-01-16 23:37:28
|
I'm no good at choosing colors. Does matplotlib have a way to automatically assign colors (based on a theme), or provide a way to choose a color from a theme? (Excel 2007 opened my eyes to this.) Currently, when I do: bar(..., color = 'r', ...) bar(..., color = 'y', ...) bar(..., color = 'b', ...) I usually just choose one of the primary colors. It would be nice if I could instead write the following (or better if the colors could be assigned automagically), so I needn't worry about choosing colors: bar(..., color = themecolor(0), ...) bar(..., color = themecolor(1), ...) bar(..., color = themecolor(2), ...) I see these things called colormaps on the home page documentation, but I can't figure out how to use these (calling autumn() before plotting made no change to my plot) or whether they're even what I'm looking for. Or perhaps there's some Python package out there completely unrelated to matplotlib that I could use? Thanks in advance for any hints. -- Yang Zhang http://www.mit.edu/~y_z/ |
|
From: C M <cmp...@gm...> - 2009-01-16 22:46:04
|
Hi, this is somewhat of a wxPython issue, maybe, but in the end I think my confusion is in how the sizing of a mpl canvas vs. a figure ought to work, and so I am trying here first. The attached code (a wxPython frame which displays a mpl graph...what most here would call a plot) shows my problem. The bottom of the graph is cut off unless I resize the frame to be very tall. But one can see that this is wrong because you can resize it to make it not so tall, but then resize it again but not let go (don't let it go idle, so it won't yet call it's size method) and there is plenty of room for the x axis label and such. When you do let go it resizes it to cut off the bottom again. I think this is because in the _SetSize method of the PlotPanel class, it is getting the parent's client size, but this is not taking into account two ways in which some of that size is used up Maybe. Like: - In the case of a panel with other objects on it (like the two buttons), it doesn't subtract the height of those buttons. - In the case of a wx.AUINotebook, it doesn't subtract the height of the bar where the tabs are. I have played around with it but have wound up confusing myself, and I am unclear as to how the _SetSize method is working here, or if it is right for all circumstances (I guess it isn't, since my x I have a nagging sense that I just should RTFM more, but on the other hand I just wanted a reality check that the way I am thinking about this is about on target. Thanks, Che |
|
From: John H. <jd...@gm...> - 2009-01-16 21:22:13
|
On Fri, Jan 16, 2009 at 3:12 PM, <pel...@il...> wrote: > Hello everybody, > > I may have found a bug in the module image.py, class AxesImage, of > matplotlib 0.98.5. > > The method 'get_interpolation' has been defined twice. The first time > it returns the attribute '_interpolation' (the right one). A few lines later, > the second definition returns the attribute '_resample' (the wrong one ?). > > So, when you call 'get_interpolation' from an AxesImage instance such as > 'imshow' it returns False instead of the proper interpolation scheme. > > What do you think ? This is a bug, I'll fix it. Thanks for the report. Please do not post to matplotlib-announce. You should post to matplotlib-users instead. matplotlib-announce is just for releases, etc. JDH |
|
From: <pro...@cl...> - 2009-01-16 17:56:58
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<title>Flashmail</title>
<style type="text/css">
BODY, TABLE, TR, TD, P {margin:0;padding:0;}
BODY {background:#FFFFFF;}
</style>
</head>
<body>
<P>Thanks a lot. That's a real good example.</P>
<P> </P>
<P>Regards.</P>
<P>C.</P>
<P> </P>
<P><BR>>Take a look at the matplotlib widgets example referenced below. It <BR>>uses mpl widgets rather than qt widgets, but it should make clear the <BR>>logic of updating plot properties connected to callbacks <BR>> <BR>>http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/examples/widgets/radio_buttons.py?content-type=text%2Fplain</P></body></html>
|
|
From: Jeff W. <js...@fa...> - 2009-01-16 17:53:22
|
Stephane Raynaud wrote: > Hi, > > it seems that pyproj.Proj does not take into account the "towgs84" > optional parameter. > Here is what I simply tried: > > from mpl_toolkits.basemap import * > lonref = -3. > latref = 47. > > kwproj = dict(proj="lcc", a=6378249.2, b=6356515., x_0=600000., > y_0=200000., > lon_0="2d20'14.025", lat_0="46d48'", lat_1="45d53'56.108", > lat_2="47d41'45.652") > print pyproj.Proj(**kwproj)(lonref, latref) > > kwproj.update(towgs84="-168,-60,+320") > print pyproj.Proj(**kwproj)(lonref, latref) > > Both transforms give the same result. > > Try the same parameters with "cs2cs" changes the results as expected. > Did I miss something? > > -- > Stephane Raynaud Stephanie: All the arguments you pass to the Proj instance were used. I don't pretend to understand what's supposed to be happening here, but I guess you are mis-specifying or mis-interpreting some of the proj arguments. The command-line version of proj gives the same answer: echo "-3.0 47.0" | proj +proj='lcc' +units=m +a=6378249.2 +lon_0="2d20'14.025" +y_0=200000.0 +b=6356515.0 +x_0=600000.0 +lat_2="47d41'45.652" +lat_1="45d53'56.108" +lat_0="46d48'" 194411.84 236007.03 echo "-3.0 47.0" | proj +proj='lcc' +units=m +a=6378249.2 +lon_0="2d20'14.025" +y_0=200000.0 +b=6356515.0 +x_0=600000.0 +lat_2="47d41'45.652" +lat_1="45d53'56.108" +lat_0="46d48'" +towgs84="-168,-60,+320" 194411.84 236007.03 -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: Stephane R. <ste...@gm...> - 2009-01-16 17:31:54
|
Hi,
it seems that pyproj.Proj does not take into account the "towgs84" optional
parameter.
Here is what I simply tried:
from mpl_toolkits.basemap import *
lonref = -3.
latref = 47.
kwproj = dict(proj="lcc", a=6378249.2, b=6356515., x_0=600000.,
y_0=200000.,
lon_0="2d20'14.025", lat_0="46d48'", lat_1="45d53'56.108",
lat_2="47d41'45.652")
print pyproj.Proj(**kwproj)(lonref, latref)
kwproj.update(towgs84="-168,-60,+320")
print pyproj.Proj(**kwproj)(lonref, latref)
Both transforms give the same result.
Try the same parameters with "cs2cs" changes the results as expected.
Did I miss something?
--
Stephane Raynaud
|
|
From: John H. <jd...@gm...> - 2009-01-16 17:11:26
|
On Fri, Jan 16, 2009 at 10:33 AM, antonv <vas...@ya...> wrote: > > I have a series of 18 separate colors to create my cmap but I would like to > convert that to a continuous map which interpolates all the other values in > between my chosen colors. This should be really easy but I am not sure how > can it be solved. Any ideas? Although the logic of the LinearSegmentedColormap takes some time to get your head around, it is pretty easy. http://matplotlib.sourceforge.net/api/colors_api.html#matplotlib.colors.LinearSegmentedColormap Here is an example: import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as mcolors import matplotlib.cm as cm colors = 'red', 'green', 'blue', 'yellow', 'orange' ncolors = len(colors) vals = np.linspace(0., 1., ncolors) cdict = dict(red=[], green=[], blue=[]) for val, color in zip(vals, colors): r,g,b = mcolors.colorConverter.to_rgb(color) cdict['red'].append((val, r, r)) cdict['green'].append((val, g, g)) cdict['blue'].append((val, b, b)) cmap = mcolors.LinearSegmentedColormap('mycolors', cdict) x = np.arange(10000.).reshape((100,100)) plt.imshow(x, cmap=cmap) plt.show() See also http://matplotlib.sourceforge.net/examples/pylab_examples/custom_cmap.html. I just added a function to svn to support this, so with svn you can do colors = 'red', 'gray', 'green' cmap = mcolors.LinearSegmentedColormap.from_list('mycolors', colors) X, Y = np.meshgrid(np.arange(10), np.arange(10)) plt.imshow(X+Y, cmap=cmap) JDH |
|
From: antonv <vas...@ya...> - 2009-01-16 16:33:20
|
I have a series of 18 separate colors to create my cmap but I would like to convert that to a continuous map which interpolates all the other values in between my chosen colors. This should be really easy but I am not sure how can it be solved. Any ideas? Thanks, Anton -- View this message in context: http://www.nabble.com/cmap-from-sepparate-color-values-tp21503197p21503197.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jeff W. <js...@fa...> - 2009-01-16 16:01:03
|
David Trethewey wrote: > http://www.srcf.ucam.org/cukernow/par1851.shp > > It's a map of the historic parishes of England and Wales if you're > curious. > > David > David: You also need the corresponding .shx and .dbf files to open it - perhaps that is the problem? -Jeff > Jeff Whitaker wrote: >> David Trethewey wrote: >>> I've had problems trying to read shapefiles using the matplotlib >>> basemap toolkit >>> >>> I can import the shapelib module without error but when I try to >>> read a shapefile this happens: >>> >>> Traceback (most recent call last): >>> File "C:\Documents and >>> Settings\David\Desktop\cornwall\try_4828.py", line 44, in <module> >>> read_4828() >>> File "C:\Documents and >>> Settings\David\Desktop\cornwall\try_4828.py", line 7, in read_4828 >>> shp=shapelib.ShapeFile('4828/4828/package/shp/par1851.shp') >>> File >>> "c:\python25\lib\site-packages\basemap-0.99.1.0001-py2.5-win32.egg\shapelib\shapelib.py", >>> line 44, in __init__ >>> self.this = apply(shapelibc.new_ShapeFile,args) >>> IOError: new_ShapeFile failed >>> >>> Anyone know why this might be? >>> >>> I'm using basemap 0.99.1 on Windows XP >>> >>> David >> >> David Can you post your shapefile somewhere so I can try it here? >> >> -Jeff >> > -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: John H. <jd...@gm...> - 2009-01-16 15:52:37
|
On Fri, Jan 16, 2009 at 9:47 AM, Zoho Vignochi <zoh...@gm...> wrote: > Hello: > > I would like to place the x label and y label to be placed above lines > running through the origin (0,0). I am happy to leave the tick markings > on the border around the plot. > > I currently use a > ax.axvline(x=0, color='black') > ax.axhline(y=0, color='black') > > to get the lines, but how to get y label to be on the top of the vline > that goes through x=0 and the xlabel to be at the left end of the hline > that goes through y=0? Sadly, it is not possible, but it is on the wish list. You can however, turn it off, and then use ax.text to put text anywhere you want. Eg to place something at 0,0 ax.text(0, 0, 'my xlabel') |
|
From: Jeff W. <js...@fa...> - 2009-01-16 15:51:36
|
David Trethewey wrote:
> I've had problems trying to read shapefiles using the matplotlib basemap
> toolkit
>
> I can import the shapelib module without error but when I try to read a
> shapefile this happens:
>
> Traceback (most recent call last):
> File "C:\Documents and Settings\David\Desktop\cornwall\try_4828.py",
> line 44, in <module>
> read_4828()
> File "C:\Documents and Settings\David\Desktop\cornwall\try_4828.py",
> line 7, in read_4828
> shp=shapelib.ShapeFile('4828/4828/package/shp/par1851.shp')
> File
> "c:\python25\lib\site-packages\basemap-0.99.1.0001-py2.5-win32.egg\shapelib\shapelib.py",
> line 44, in __init__
> self.this = apply(shapelibc.new_ShapeFile,args)
> IOError: new_ShapeFile failed
>
> Anyone know why this might be?
>
> I'm using basemap 0.99.1 on Windows XP
>
> David
David Can you post your shapefile somewhere so I can try it here?
-Jeff
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
|
|
From: John H. <jd...@gm...> - 2009-01-16 15:49:15
|
On Fri, Jan 16, 2009 at 9:40 AM, <pro...@cl...> wrote: > That's great. I'm a real newbie with mpl and I would like to know how to > change figure after a PyQt-Event. > That's must be simple but I don't see how to do this. My idea would be for > example to show different kinds of draw like for example the sin function > and another function. The users just have to click on some button. This is > only to understand the way mpl manage changes in the figure. > > If someone could helpme that would be greater than great. Take a look at the matplotlib widgets example referenced below. It uses mpl widgets rather than qt widgets, but it should make clear the logic of updating plot properties connected to callbacks http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/examples/widgets/radio_buttons.py?content-type=text%2Fplain |
|
From: David T. <dl...@ca...> - 2009-01-16 15:48:31
|
I've had problems trying to read shapefiles using the matplotlib basemap
toolkit
I can import the shapelib module without error but when I try to read a
shapefile this happens:
Traceback (most recent call last):
File "C:\Documents and Settings\David\Desktop\cornwall\try_4828.py",
line 44, in <module>
read_4828()
File "C:\Documents and Settings\David\Desktop\cornwall\try_4828.py",
line 7, in read_4828
shp=shapelib.ShapeFile('4828/4828/package/shp/par1851.shp')
File
"c:\python25\lib\site-packages\basemap-0.99.1.0001-py2.5-win32.egg\shapelib\shapelib.py",
line 44, in __init__
self.this = apply(shapelibc.new_ShapeFile,args)
IOError: new_ShapeFile failed
Anyone know why this might be?
I'm using basemap 0.99.1 on Windows XP
David
|
|
From: Zoho V. <zoh...@gm...> - 2009-01-16 15:47:33
|
Hello: I would like to place the x label and y label to be placed above lines running through the origin (0,0). I am happy to leave the tick markings on the border around the plot. I currently use a ax.axvline(x=0, color='black') ax.axhline(y=0, color='black') to get the lines, but how to get y label to be on the top of the vline that goes through x=0 and the xlabel to be at the left end of the hline that goes through y=0? Thank you, Zoho |
|
From: <pro...@cl...> - 2009-01-16 15:40:30
|
That's great. I'm a real newbie with mpl and I would like to know how to
change figure after a PyQt-Event.
That's must be simple but I don't see how to do this. My idea would be for
example to show different kinds of draw like for example the sin function
and another function. The users just have to click on some button. This is
only to understand the way mpl manage changes in the figure.
If someone could helpme that would be greater than great.
Regards.
Christophe.
----Message d'origine----
>Date: Fri, 16 Jan 2009 07:00:07 -0800 (PST)
>De: B Clowers
>Sujet: Re: [Matplotlib-users] Figure with pyQt
>A: mat...@li..., pro...@cl...
>
>
>You'll have to excuse some of the comments in the code (it's in a constant
state of revision), but this is a basic PyQt4/matplotlib widget that I use
quite often and can be embedded using QtDesigner as well. You'll
obviously need PyQt4, Matplotlib, and Numpy to run it. Of course mods can
be made as you see fit for your particular application.
>
>I should note that Ctrl+Z zooms using the Spanselector and the top of the
drawn span is the max Y and the the min Y always defaults to 0 (this works
for my data sets). Ctrl+A zooms out. Save to csv is also an option
(Ctrl+Alt+S)--this can fail if you've a weird data set. Ctrl+C copies a png of
the current figure to the user's home directory (works for both Linux and
Windows) and also puts the image on the current clipboard.
>
>I've also added an option to make multiple plot layouts that are stored in
a dictionary that can be accessed to plot to the given axes. If anyone has
a more elegant solution please share. Let me know if you've questions.
>
>Cheers,
>
>Brian
>
>##############################
>#!/usr/bin/env python
>
>
>import os
>
>import sys
>
>
>from PyQt4 import QtCore, QtGui
>
>
>from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as
FigureCanvas
>
>from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as
NavigationToolbar
>
>#from matplotlib.backend_bases import NavigationToolbar2
>
>
>from matplotlib.figure import Figure
>
>
>from matplotlib.widgets import SpanSelector
>
>#from matplotlib.pyplot import savefig
>
>
>import numpy as N
>
>
>
>class MyMplCanvas(FigureCanvas):
>
> def __init__(self, parent=None, width = 5, height = 5, dpi = 100,
sharex = None, sharey = None):
>
> self.fig = Figure(figsize = (width, height), dpi=dpi, facecolor =
'#FFFFFF')
>
> self.axDict = {}
>
> self.figInit = False
>
>
> self.sharey = sharey
>
> self.sharey = sharey
>
>
># self.ax1.hold(True)
>
>
>
> FigureCanvas.__init__(self, self.fig)
>
> #self.fc = FigureCanvas(self.fig)
>
> FigureCanvas.setSizePolicy(self,
>
> QtGui.QSizePolicy.Expanding,
>
> QtGui.QSizePolicy.Expanding)
>
> FigureCanvas.updateGeometry(self)
>
> self.setupSub(1)
>
>
> def setupSub(self, numSubRows, numSubCols = 1, sharex = False,
sharey = False):
>
> self.fig.clf()
>
> for m in range(1,numSubRows+1):
>
> for n in range(1,numSubCols+1):
>
> axName = 'ax%s'%m
>
> axLoc = 100*numSubRows+10*n+m
>
> #print axLoc
>
> if sharex:
>
> if m>1:
>
> self.axDict[axName] = self.fig.add_subplot(axLoc, sharex
= self.axDict['ax%s'%(m-1)])
>
> else:
>
> self.axDict[axName] = self.fig.add_subplot(axLoc)#,
sharex = self.sharex, sharey = self.sharey)
>
> else:
>
> self.axDict[axName] = self.fig.add_subplot(axLoc)#, sharex
= self.sharex, sharey = self.sharey)
>
>
> self.figInit = True
>
>
> self.fig.subplots_adjust(left=0.1, bottom=0.1, right=0.9, top=0.9)
>
> self.xtitle=""
>
> self.ytitle=""
>
> #self.PlotTitle = "Plot"
>
> self.grid_status = True
>
> self.xaxis_style = 'linear'
>
> self.yaxis_style = 'linear'
>
> self.format_labels()
>
>
>
>
> def format_labels(self):
>
> if self.figInit:
>
> for ax in self.axDict.itervalues():
>
> ax.title.set_fontsize(10)
>
> ax.set_xlabel(self.xtitle, fontsize = 9)
>
> ax.set_ylabel(self.ytitle, fontsize = 9)
>
> labels_x = ax.get_xticklabels()
>
> labels_y = ax.get_yticklabels()
>
>
> for xlabel in labels_x:
>
> xlabel.set_fontsize(8)
>
> for ylabel in labels_y:
>
> ylabel.set_fontsize(8)
>
> ylabel.set_color('b')
>
> if ax.get_legend() != None:
>
> texts = ax.get_legend().get_texts()
>
> for text in texts:
>
> text.set_fontsize(8)
>
> else:
>
> print "please initiate the number of subplots. Call
*.canvas.setupSub(numofSubs)"
>
>
> def sizeHint(self):
>
> w, h = self.get_width_height()
>
> return QtCore.QSize(w, h)
>
>
> def minimumSizeHint(self):
>
> return QtCore.QSize(10, 10)
>
>
> def sizeHint(self):
>
> w, h = self.get_width_height()
>
> return QtCore.QSize(w, h)
>
>
> def minimumSizeHint(self):
>
> return QtCore.QSize(10, 10)
>
>
>
>class MyNavigationToolbar(NavigationToolbar) :
>
> def __init__(self , parent , canvas , direction = 'h' ) :
>
> #NavigationToolbar.__init__(self,parent,canvas)
>
> #self.layout = QVBoxLayout( self )
>
>
> self.canvas = canvas
>
> QWidget.__init__( self, parent )
>
>
> if direction=='h' :
>
> self.layout = QHBoxLayout( self )
>
> else :
>
> self.layout = QVBoxLayout( self )
>
>
> self.layout.setMargin( 2 )
>
> self.layout.setSpacing( 0 )
>
>
> NavigationToolbar2.__init__( self, canvas )
>
>
>
> def set_message( self, s ):
>
> pass
>
>
>
>class MPL_Widget(QtGui.QWidget):
>
> def __init__(self, parent = None):
>
> QtGui.QWidget.__init__(self, parent)
>
> self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
>
> self.canvas = MyMplCanvas()
>
> self.toolbar = NavigationToolbar(self.canvas, self.canvas)
>
> #self.toolbar.hide()
>
> self.vbox = QtGui.QVBoxLayout()
>
> self.vbox.addWidget(self.canvas)
>
> self.vbox.addWidget(self.toolbar)
>
> self.setLayout(self.vbox)
>
> self.ax1 = self.canvas.axDict['ax1']
>
> ###############ZOOM CONTROLS ################
>
>
> self.ZoomChrom = QtGui.QAction("Zoom Chrom", self)
>
> self.ZoomChrom.setShortcut("Ctrl+Z")
>
> self.addAction(self.ZoomChrom)
>
>
QtCore.QObject.connect(self.ZoomChrom,QtCore.SIGNAL("triggered()"),
self.ZoomToggle)
>
>
> self.actionAutoScaleChrom = QtGui.QAction("AutoScale",
self)#self.MainWindow)
>
> self.actionAutoScaleChrom.setShortcut("Ctrl+A")
>
> self.addAction(self.actionAutoScaleChrom)
>
>
QtCore.QObject.connect(self.actionAutoScaleChrom,QtCore.SIGNAL("trigge
red()"), self.autoscale_plot)
>
>
> self.span = SpanSelector(self.ax1, self.onselect, 'horizontal',
minspan =0.01,
>
> useblit=True, rectprops=dict(alpha=0.5,
facecolor='#C6DEFF') )
>
> self.hZoom = False
>
> self.span.visible = False
>
>
> self.localYMax = 0
>
> self.canvas.mpl_connect('button_press_event', self.onclick)
>
>
> ###########SAVING FIGURE TO CLIPBOARD##########
>
> self.cb = None #will be used for the clipboard
>
> self.tempPath = getHomeDir()
>
> self.tempPath = os.path.join(self.tempPath,'tempMPL.png')
>
>
> self.mpl2ClipAction = QtGui.QAction("Save to Clipboard", self)
>
> self.mpl2ClipAction.setShortcut("Ctrl+C")
>
> self.addAction(self.mpl2ClipAction)
>
>
QtCore.QObject.connect(self.mpl2ClipAction,QtCore.SIGNAL("triggered()"),
self.mpl2Clip)
>
>
>
> #######SAVING FIGURE
DATA############################
>
># self.saveCSVAction = QtGui.QAction("Save to CSV", self)
>
># self.saveCSVAction.setShortcut("Ctrl+Alt+S")
>
># self.addAction(self.saveCSVAction)
>
>#
QtCore.QObject.connect(self.saveCSVAction,QtCore.SIGNAL("triggered()"),
self.save2CSV)
>
>
> ########### HELPER FUNCTIONS
#########################
>
>
> def ZoomToggle(self):
>
> #self.toolbar.zoom() #this implements the classic zoom
>
> if self.hZoom:
>
> self.hZoom = False
>
> self.span.visible = False
>
> else:
>
> self.hZoom = True
>
> self.span.visible = True
>
>
> def autoscale_plot(self):
>
># print "autoscale"
>
> #self.toolbar.home() #implements the classic return to home
>
> self.ax1.autoscale_view(tight = False, scalex=True, scaley=True)
>
> self.canvas.draw()
>
>
> def onclick(self, event):
>
> #sets up the maximum Y level to be displayed after the zoom.
>
> #if not set then it maxes to the largest point in the data
>
> #not necessarily the local max
>
> if event.ydata != None:
>
> self.localYMax = int(event.ydata)
>
>
> def onselect(self, xmin, xmax):
>
> #print xmin, xmax
>
> if self.hZoom:
>
> self.ax1.set_ylim(ymax = self.localYMax)
>
> self.ax1.set_xlim(xmin, xmax)
>
>
>
> def save2CSV(self):
>
> path = self.SFDialog()
>
> if path != None:
>
> try:
>
> lines = self.ax1.get_lines()
>
> data2write = []
>
> for line in lines:
>
> data2write.append(line.get_data()[0])
>
> data2write.append(line.get_data()[1])
>
> print data2write
>
> data2write = N.array(data2write)
>
> data2write.dtype = N.float32
>
> N.savetxt(str(path), N.transpose(data2write), delimiter = ',',
fmt='%.4f')
>
> except:
>
> try:
>
> #this is for the case where the data may not be in float
format?
>
> N.savetxt(str(path), N.transpose(data2write), delimiter = ',')
>
> except:
>
> print 'Error saving figure data'
>
> errorMsg = "Sorry: %s\n\n:%s\n"%(sys.exc_type,
sys.exc_value)
>
> print errorMsg
>
>
>
> def SFDialog(self):
>
> fileName = QtGui.QFileDialog.getSaveFileName(self,
>
> "Select File to Save",
>
> "",
>
> "csv Files (*.csv)")
>
> if not fileName.isEmpty():
>
> print fileName
>
> return fileName
>
> else:
>
> return None
>
>
>
> def mpl2Clip(self):
>
> try:
>
> self.canvas.fig.savefig(self.tempPath)
>
> tempImg = QtGui.QImage(self.tempPath)
>
> self.cb = QtGui.QApplication.clipboard()
>
> self.cb.setImage(tempImg)
>
> except:
>
> print 'Error copying figure to clipboard'
>
> errorMsg = "Sorry: %s\n\n:%s\n"%(sys.exc_type,
sys.exc_value)
>
> print errorMsg
>
># savefig(fname, dpi=None, facecolor='w', edgecolor='w',
>
># orientation='portrait', papertype=None, format=None,
>
># transparent=False):
>
>
>####USED TO GET THE USERS HOME DIRECTORY FOR USE OF A TEMP
FILE
>
>
>def valid(path):
>
> if path and os.path.isdir(path):
>
> return True
>
> return False
>
>
>def env(name):
>
> return os.environ.get( name, '' )
>
>
>def getHomeDir():
>
> if sys.platform != 'win32':
>
> return os.path.expanduser( '~' )
>
>
> homeDir = env( 'USERPROFILE' )
>
> if not valid(homeDir):
>
> homeDir = env( 'HOME' )
>
> if not valid(homeDir) :
>
> homeDir = '%s%s' % (env('HOMEDRIVE'),env('HOMEPATH'))
>
> if not valid(homeDir) :
>
> homeDir = env( 'SYSTEMDRIVE' )
>
> if homeDir and (not homeDir.endswith('\\')) :
>
> homeDir += '\\'
>
> if not valid(homeDir) :
>
> homeDir = 'C:\\'
>
> return homeDir
>
>
>
>
>
>def main():
>
> import sys
>
> app = QtGui.QApplication(sys.argv)
>
> w = MPL_Widget()
>
># w.canvas.setupSub(1)
>
> ax1 = w.canvas.axDict['ax1']
>
> x = N.arange(0, 20)
>
> y = N.sin(x)
>
> y2 = N.cos(x)
>
> ax1.plot(x, y)
>
> ax1.plot(x, y2)
>
> w.show()
>
> sys.exit(app.exec_())
>
>
>if __name__ == "__main__":
>
> main()
>
>####################################
>
>
>--- On Thu, 1/15/09, pro...@cl... <projetmbc@club-
internet.fr> wrote:
>From: pro...@cl... <pro...@cl...>
>Subject: [Matplotlib-users] Figure with pyQt
>To: mat...@li...
>Date: Thursday, January 15, 2009, 9:56 AM
>
>Hello,
>I would like to see the following example
>http://matplotlib.sourceforge.net/examples/pylab_examples/ellipse_demo
.ht
>ml using the 2nd one
>http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in
_qt
>4.html .
>In fact, I don't undrestand how to add the figure to the screen (I'm a
>real
>beginner with matplotlib but not with PyQt).
>
>Thanks for any kind of help.
>
>
>------------------------------------------------------------------------------
>This SF.net email is sponsored by:
>SourcForge Community
>SourceForge wants to tell your story.
>http://p.sf.net/sfu/sf-spreadtheword
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
>
|
|
From: John H. <jd...@gm...> - 2009-01-16 15:40:27
|
On Fri, Jan 16, 2009 at 8:20 AM, Tom Krauss <tp...@kr...> wrote: > After some positive feedback and subsequent discussion on the > wxPython users list, I decided to add a wiki page for the Fourier > Demo I posted earlier: > > http://wiki.wxpython.org/MatplotlibFourierDemo > > Robin, et. al., do you think this warrants moving up into a new > category (e.g. RecipesMatplotlib) in the Recipes section? I added it > in the RecipesOther but there are so many recipes there that it seems > kind of buried. Thanks for the reminder Tom -- the demo is indeed very nice but it stuck in the back of my inbox. I added it to mpl svn in examples/user_interfaces/fourier_demo_wx.py |
|
From: Tom K. <tp...@kr...> - 2009-01-16 15:25:49
|
After some positive feedback and subsequent discussion on the wxPython users list, I decided to add a wiki page for the Fourier Demo I posted earlier: http://wiki.wxpython.org/MatplotlibFourierDemo Robin, et. al., do you think this warrants moving up into a new category (e.g. RecipesMatplotlib) in the Recipes section? I added it in the RecipesOther but there are so many recipes there that it seems kind of buried. Best, Tom K. |
|
From: B C. <clo...@ya...> - 2009-01-16 15:00:13
|
You'll have to excuse some of the comments in the code (it's in a constant state of revision), but this is a basic PyQt4/matplotlib widget that I use quite often and can be embedded using QtDesigner as well. You'll obviously need PyQt4, Matplotlib, and Numpy to run it. Of course mods can be made as you see fit for your particular application.
I should note that Ctrl+Z zooms using the Spanselector and the top of the drawn span is the max Y and the the min Y always defaults to 0 (this works for my data sets). Ctrl+A zooms out. Save to csv is also an option (Ctrl+Alt+S)--this can fail if you've a weird data set. Ctrl+C copies a png of the current figure to the user's home directory (works for both Linux and Windows) and also puts the image on the current clipboard.
I've also added an option to make multiple plot layouts that are stored in a dictionary that can be accessed to plot to the given axes. If anyone has a more elegant solution please share. Let me know if you've questions.
Cheers,
Brian
##############################
#!/usr/bin/env python
import os
import sys
from PyQt4 import QtCore, QtGui
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as NavigationToolbar
#from matplotlib.backend_bases import NavigationToolbar2
from matplotlib.figure import Figure
from matplotlib.widgets import SpanSelector
#from matplotlib.pyplot import savefig
import numpy as N
class MyMplCanvas(FigureCanvas):
def __init__(self, parent=None, width = 5, height = 5, dpi = 100, sharex = None, sharey = None):
self.fig = Figure(figsize = (width, height), dpi=dpi, facecolor = '#FFFFFF')
self.axDict = {}
self.figInit = False
self.sharey = sharey
self.sharey = sharey
# self.ax1.hold(True)
FigureCanvas.__init__(self, self.fig)
#self.fc = FigureCanvas(self.fig)
FigureCanvas.setSizePolicy(self,
QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)
self.setupSub(1)
def setupSub(self, numSubRows, numSubCols = 1, sharex = False, sharey = False):
self.fig.clf()
for m in range(1,numSubRows+1):
for n in range(1,numSubCols+1):
axName = 'ax%s'%m
axLoc = 100*numSubRows+10*n+m
#print axLoc
if sharex:
if m>1:
self.axDict[axName] = self.fig.add_subplot(axLoc, sharex = self.axDict['ax%s'%(m-1)])
else:
self.axDict[axName] = self.fig.add_subplot(axLoc)#, sharex = self.sharex, sharey = self.sharey)
else:
self.axDict[axName] = self.fig.add_subplot(axLoc)#, sharex = self.sharex, sharey = self.sharey)
self.figInit = True
self.fig.subplots_adjust(left=0.1, bottom=0.1, right=0.9, top=0.9)
self.xtitle=""
self.ytitle=""
#self.PlotTitle = "Plot"
self.grid_status = True
self.xaxis_style = 'linear'
self.yaxis_style = 'linear'
self.format_labels()
def format_labels(self):
if self.figInit:
for ax in self.axDict.itervalues():
ax.title.set_fontsize(10)
ax.set_xlabel(self.xtitle, fontsize = 9)
ax.set_ylabel(self.ytitle, fontsize = 9)
labels_x = ax.get_xticklabels()
labels_y = ax.get_yticklabels()
for xlabel in labels_x:
xlabel.set_fontsize(8)
for ylabel in labels_y:
ylabel.set_fontsize(8)
ylabel.set_color('b')
if ax.get_legend() != None:
texts = ax.get_legend().get_texts()
for text in texts:
text.set_fontsize(8)
else:
print "please initiate the number of subplots. Call *.canvas.setupSub(numofSubs)"
def sizeHint(self):
w, h = self.get_width_height()
return QtCore.QSize(w, h)
def minimumSizeHint(self):
return QtCore.QSize(10, 10)
def sizeHint(self):
w, h = self.get_width_height()
return QtCore.QSize(w, h)
def minimumSizeHint(self):
return QtCore.QSize(10, 10)
class MyNavigationToolbar(NavigationToolbar) :
def __init__(self , parent , canvas , direction = 'h' ) :
#NavigationToolbar.__init__(self,parent,canvas)
#self.layout = QVBoxLayout( self )
self.canvas = canvas
QWidget.__init__( self, parent )
if direction=='h' :
self.layout = QHBoxLayout( self )
else :
self.layout = QVBoxLayout( self )
self.layout.setMargin( 2 )
self.layout.setSpacing( 0 )
NavigationToolbar2.__init__( self, canvas )
def set_message( self, s ):
pass
class MPL_Widget(QtGui.QWidget):
def __init__(self, parent = None):
QtGui.QWidget.__init__(self, parent)
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.canvas = MyMplCanvas()
self.toolbar = NavigationToolbar(self.canvas, self.canvas)
#self.toolbar.hide()
self.vbox = QtGui.QVBoxLayout()
self.vbox.addWidget(self.canvas)
self.vbox.addWidget(self.toolbar)
self.setLayout(self.vbox)
self.ax1 = self.canvas.axDict['ax1']
###############ZOOM CONTROLS ################
self.ZoomChrom = QtGui.QAction("Zoom Chrom", self)
self.ZoomChrom.setShortcut("Ctrl+Z")
self.addAction(self.ZoomChrom)
QtCore.QObject.connect(self.ZoomChrom,QtCore.SIGNAL("triggered()"), self.ZoomToggle)
self.actionAutoScaleChrom = QtGui.QAction("AutoScale", self)#self.MainWindow)
self.actionAutoScaleChrom.setShortcut("Ctrl+A")
self.addAction(self.actionAutoScaleChrom)
QtCore.QObject.connect(self.actionAutoScaleChrom,QtCore.SIGNAL("triggered()"), self.autoscale_plot)
self.span = SpanSelector(self.ax1, self.onselect, 'horizontal', minspan =0.01,
useblit=True, rectprops=dict(alpha=0.5, facecolor='#C6DEFF') )
self.hZoom = False
self.span.visible = False
self.localYMax = 0
self.canvas.mpl_connect('button_press_event', self.onclick)
###########SAVING FIGURE TO CLIPBOARD##########
self.cb = None #will be used for the clipboard
self.tempPath = getHomeDir()
self.tempPath = os.path.join(self.tempPath,'tempMPL.png')
self.mpl2ClipAction = QtGui.QAction("Save to Clipboard", self)
self.mpl2ClipAction.setShortcut("Ctrl+C")
self.addAction(self.mpl2ClipAction)
QtCore.QObject.connect(self.mpl2ClipAction,QtCore.SIGNAL("triggered()"), self.mpl2Clip)
#######SAVING FIGURE DATA############################
# self.saveCSVAction = QtGui.QAction("Save to CSV", self)
# self.saveCSVAction.setShortcut("Ctrl+Alt+S")
# self.addAction(self.saveCSVAction)
# QtCore.QObject.connect(self.saveCSVAction,QtCore.SIGNAL("triggered()"), self.save2CSV)
########### HELPER FUNCTIONS #########################
def ZoomToggle(self):
#self.toolbar.zoom() #this implements the classic zoom
if self.hZoom:
self.hZoom = False
self.span.visible = False
else:
self.hZoom = True
self.span.visible = True
def autoscale_plot(self):
# print "autoscale"
#self.toolbar.home() #implements the classic return to home
self.ax1.autoscale_view(tight = False, scalex=True, scaley=True)
self.canvas.draw()
def onclick(self, event):
#sets up the maximum Y level to be displayed after the zoom.
#if not set then it maxes to the largest point in the data
#not necessarily the local max
if event.ydata != None:
self.localYMax = int(event.ydata)
def onselect(self, xmin, xmax):
#print xmin, xmax
if self.hZoom:
self.ax1.set_ylim(ymax = self.localYMax)
self.ax1.set_xlim(xmin, xmax)
def save2CSV(self):
path = self.SFDialog()
if path != None:
try:
lines = self.ax1.get_lines()
data2write = []
for line in lines:
data2write.append(line.get_data()[0])
data2write.append(line.get_data()[1])
print data2write
data2write = N.array(data2write)
data2write.dtype = N.float32
N.savetxt(str(path), N.transpose(data2write), delimiter = ',', fmt='%.4f')
except:
try:
#this is for the case where the data may not be in float format?
N.savetxt(str(path), N.transpose(data2write), delimiter = ',')
except:
print 'Error saving figure data'
errorMsg = "Sorry: %s\n\n:%s\n"%(sys.exc_type, sys.exc_value)
print errorMsg
def SFDialog(self):
fileName = QtGui.QFileDialog.getSaveFileName(self,
"Select File to Save",
"",
"csv Files (*.csv)")
if not fileName.isEmpty():
print fileName
return fileName
else:
return None
def mpl2Clip(self):
try:
self.canvas.fig.savefig(self.tempPath)
tempImg = QtGui.QImage(self.tempPath)
self.cb = QtGui.QApplication.clipboard()
self.cb.setImage(tempImg)
except:
print 'Error copying figure to clipboard'
errorMsg = "Sorry: %s\n\n:%s\n"%(sys.exc_type, sys.exc_value)
print errorMsg
# savefig(fname, dpi=None, facecolor='w', edgecolor='w',
# orientation='portrait', papertype=None, format=None,
# transparent=False):
####USED TO GET THE USERS HOME DIRECTORY FOR USE OF A TEMP FILE
def valid(path):
if path and os.path.isdir(path):
return True
return False
def env(name):
return os.environ.get( name, '' )
def getHomeDir():
if sys.platform != 'win32':
return os.path.expanduser( '~' )
homeDir = env( 'USERPROFILE' )
if not valid(homeDir):
homeDir = env( 'HOME' )
if not valid(homeDir) :
homeDir = '%s%s' % (env('HOMEDRIVE'),env('HOMEPATH'))
if not valid(homeDir) :
homeDir = env( 'SYSTEMDRIVE' )
if homeDir and (not homeDir.endswith('\\')) :
homeDir += '\\'
if not valid(homeDir) :
homeDir = 'C:\\'
return homeDir
def main():
import sys
app = QtGui.QApplication(sys.argv)
w = MPL_Widget()
# w.canvas.setupSub(1)
ax1 = w.canvas.axDict['ax1']
x = N.arange(0, 20)
y = N.sin(x)
y2 = N.cos(x)
ax1.plot(x, y)
ax1.plot(x, y2)
w.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()
####################################
--- On Thu, 1/15/09, pro...@cl... <pro...@cl...> wrote:
From: pro...@cl... <pro...@cl...>
Subject: [Matplotlib-users] Figure with pyQt
To: mat...@li...
Date: Thursday, January 15, 2009, 9:56 AM
Hello,
I would like to see the following example
http://matplotlib.sourceforge.net/examples/pylab_examples/ellipse_demo.ht
ml using the 2nd one
http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_qt
4.html .
In fact, I don't undrestand how to add the figure to the screen (I'm a
real
beginner with matplotlib but not with PyQt).
Thanks for any kind of help.
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: John H. <jd...@gm...> - 2009-01-16 10:43:59
|
On Jan 15, 2009, at 8:41 PM, Eric Firing <ef...@ha...> wrote: > Chris Fonnesbeck wrote: >> Is there any way of preventing tick label names from being cut off by >> the plot canvas? Seems to happen every time: >> >> http://a3.s3.p.quickshareit.com/files/validationb0e66.png >> >> Thanks in advance. >> > > There is no automatic way. If you are going to use long labels like > that, then you need to use subplots_adjust or other manual methods for > positioning your axes within your figure. You can also permanently change the defaults in you rc file JDH |
|
From: <pro...@cl...> - 2009-01-16 09:59:48
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<title>Flashmail</title>
<style type="text/css">
BODY, TABLE, TR, TD, P {margin:0;padding:0;}
BODY {background:#FFFFFF;}
</style>
</head>
<body>
<P>Thanks,</P>
<P>that's look great.</P>
<P> </P>
<P>Regards.</P>
<P>C.</P>
<P> </P>
<P><BR>>Unfortunately, I don't use Mayavi and therefore don't have any easy <BR>>examples to offer. I guess you might find such things in the user <BR>>guide or Cookbook. <BR>> <BR>>http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/ <BR>>http://www.scipy.org/Cookbook/MayaVi <BR>> <BR>>Cheers, <BR>>Scott </P></body></html>
|
|
From: <pro...@cl...> - 2009-01-16 09:55:29
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<title>Flashmail</title>
<style type="text/css">
BODY, TABLE, TR, TD, P {margin:0;padding:0;}
BODY {background:#FFFFFF;}
</style>
</head>
<body>
<P>Thanks, that's work well.</P>
<P> </P>
<P>Regards.</P>
<P>C.</P>
<P> </P>
<P> </P>
<P>>I presume that you're only interested in the math formula, and not in <BR>>any other graphical functionality of MPL. You may use mathtext module <BR>>directly in that case. <BR>> <BR>>from matplotlib.mathtext import MathTextParser <BR>> <BR>>p = MathTextParser("bitmap") <BR>>filename, texstr = "test.png", r"$\alpha$" <BR>>p.to_png(filename, texstr) <BR>>d = p.get_depth(texstr)</P></body></html>
|
|
From: Scott S. <sco...@gm...> - 2009-01-16 06:25:55
|
> 2009/1/15 <pro...@cl...>: >>Matplotlib is a purely 2D plotting library, it doesn't provide similar >>capability to the Matlab 'mesh' function. For 3D plotting you could >>use Mayavi > > > Do you have some example of Python programs using Mayavi ? Simple > examples would be good ones. Please make sure to direct your response to the mailing list so that others can offer assistance, on this list that means using "Reply-to-all". Unfortunately, I don't use Mayavi and therefore don't have any easy examples to offer. I guess you might find such things in the user guide or Cookbook. http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/ http://www.scipy.org/Cookbook/MayaVi Cheers, Scott |
|
From: Eric F. <ef...@ha...> - 2009-01-16 02:41:11
|
Chris Fonnesbeck wrote: > Is there any way of preventing tick label names from being cut off by > the plot canvas? Seems to happen every time: > > http://a3.s3.p.quickshareit.com/files/validationb0e66.png > > Thanks in advance. > There is no automatic way. If you are going to use long labels like that, then you need to use subplots_adjust or other manual methods for positioning your axes within your figure. Eric |