SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
(20)
2
(16)
3
(9)
4
(12)
5
(14)
6
(22)
7
(17)
8
(33)
9
(26)
10
(32)
11
(47)
12
(26)
13
(7)
14
(24)
15
(44)
16
(42)
17
(22)
18
(31)
19
(8)
20
(4)
21
(15)
22
(27)
23
(41)
24
(33)
25
(31)
26
(24)
27
(10)
28
(20)






Showing results of 620

<< < 1 2 3 4 5 .. 25 > >> (Page 3 of 25)
From: Gael V. <gae...@no...> - 2010年02月26日 06:04:58
On Fri, Feb 26, 2010 at 12:16:40AM +0100, Friedrich Romstedt wrote:
> 2010年2月25日 Eric Firing <ef...@ha...>:
> > Is it time for some re-thinking of the approach to 3-D? I am a bystander,
> > but I have the uneasy sense that trying to turn mplot3d into a first-class
> > 3-D plotting tool may be a misapplication of effort. Might the effort be
> > more productive if applied to mayavi, or built on mayavi, so that the 3-D
> > engine is already taken care of?
> Hmm, mayavi seems not suitable for our purpose,
> http://mayavi.sourceforge.net/docs/guide/ch04.html
> First, mayavi always creates its gui, second, one has to use an
> intermediate vtk file. Don't know what about using vtk directly.
What Eric was most probably talking about is the newer versions of
Mayavi, that we tend to call 'mayavi2', even though we are now up to
version 3, in particular the mlab interface:
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/mlab.html
which is demoed in the examples:
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/examples.html
I believe that Mayavi does take care of the task you are interested in.
It has its limitation and annoyances, but a lot of people use it quite
efficiently to do 3D plotting, for simple problems to very complex ones.
Gaël
From: David A. <dwa...@su...> - 2010年02月26日 03:45:55
All,
I tried this code from: http://matplotlib.sourceforge.net/examples/widgets/cursor.py
from matplotlib.widgets import Cursor
import pylab
fig = pylab.figure(figsize=(8,6))
ax = fig.add_axes([0.075, 0.25, 0.9, 0.725], axisbg='#FFFFCC')
#ax = fig.add_subplot(111, axisbg='#FFFFCC')
canvas = ax.figure.canvas
x,y = 4*(pylab.rand(2,100)-.5)
ax.plot(x,y,'o')
ax.set_xlim(-2,2)
ax.set_ylim(-2,2)
# set useblit = True on gtkagg for enhanced performance
cursor = Cursor(ax, useblit=True, color='red', linewidth=2 )
pylab.show()
I got this error on my Macbook Pro:
The debugged program raised the exception unhandled AttributeError
"'FigureCanvasMac' object has no attribute 'copy_from_bbox'"
Any suggestions?
David
From: Andrew C. <ac...@gm...> - 2010年02月26日 01:09:55
On Thu, Feb 25, 2010 at 7:26 PM, Friedrich Romstedt
<fri...@gm...> wrote:
> 2010年2月25日 Andrew Charles <ac...@gm...>:
>> I'm trying to interpolate from one grid to another using Basemap's
>> interp function. It seems to want the lat and lon axis of the new grid
>> to have the same shape:
>>
>> 3524 if xout.shape != yout.shape:
>> 3535   raise ValueError, 'xout and yout must have same shape!'
>>
>> The grid I'm interpolating to is 144 by 72
>>
>> I'm calling it as interp(x,lon,lat,plon,plat)
>> where lon and plon are numpy arrays with shape (144,) lat has shape
>> (73,) plat has shape(72,) and x has shape (72, 144)
>>
>> Does interp() really only work if the target grid is square?
>
> I guess it wants a meshgrid
Aye, now that I read the docstring with a rested pair of eyes it's
clear that xout and yout are meshgrids (rank 2 arrays). Thanks,
problem solved.
-------------------------
Andrew Charles
From: Christoph G. <cg...@uc...> - 2010年02月25日 23:56:59
You need Visual Studio 2008 (MSVC9) to compile extensions for Python 2.6 
on Windows. The Express edition should work 
<http://www.microsoft.com/express/Downloads/#2008-Visual-CPP>.
Christoph
On 2/25/2010 3:16 PM, Ben Axelrod wrote:
>
> I am getting the same error.
>
> Here is my console output:
>
> C:\Projects\matplotlib>python setup.py build
> basedirlist is: ['win32_static']
> ============================================================================
> BUILDING MATPLOTLIB
> matplotlib: 1.0.svn
> python: 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC
> v.1500 32 bit (Intel)]
> platform: win32
> Windows version: (5, 1, 2600, 2, 'Service Pack 3')
>
> REQUIRED DEPENDENCIES
> numpy: 1.4.0
> freetype2: found, but unknown version (no pkg-config)
> * WARNING: Could not find 'freetype2' headers in any
> * of '.', '.\freetype2'.
>
> OPTIONAL BACKEND DEPENDENCIES
> libpng: found, but unknown version (no pkg-config)
> * Could not find 'libpng' headers in any of '.'
> Tkinter: no
> * Tkinter present, but header files are not found.
> * You may need to install development packages.
> wxPython: 2.8.10.1
> * WxAgg extension not required for wxPython>= 2.8
> Gtk+: no
> * Building for Gtk+ requires pygtk; you must be able
> * to "import gtk" in your build/install environment
> Mac OS X native: no
> Qt: no
> Qt4: no
> Cairo: no
>
> OPTIONAL DATE/TIMEZONE DEPENDENCIES
> datetime: present, version unknown
> dateutil: matplotlib will provide
> pytz: 2008c
>
> OPTIONAL USETEX DEPENDENCIES
> dvipng: file.
> ghostscript: 'gswin32c' is not recognized as an internal or
> external command, operable program or batch file.
> latex: no
>
> [Edit setup.cfg to suppress the above messages]
> ============================================================================
> pymods ['pylab']
> packages ['matplotlib', 'matplotlib.backends',
> 'matplotlib.backends.qt4_editor', 'matplotlib.projections',
> 'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests',
> 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid',
> 'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab',
> 'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra',
> 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft',
> 'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil/zoneinfo']
> running build
> running build_py
> copying lib\matplotlib\mpl-data\matplotlibrc ->
> build\lib.win32-2.6\matplotlib\mpl-data
> copying lib\matplotlib\mpl-data\matplotlib.conf ->
> build\lib.win32-2.6\matplotlib\mpl-data
> running build_ext
> building 'matplotlib.ft2font' extension
> error: Unable to find vcvarsall.bat
>
> I found that I do have a vcvarsall.bat file. it is located here:
>
> "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
>
> I thought this might be a bug in freetype2, so i downloaded the latest
> windows version from:
> http://gnuwin32.sourceforge.net/packages/freetype.htm
> with no luck. setup.py still says it can't verify my freetype2 version.
>
> After grepping through lots of code, I found that vcvarsall.bat is only
> listed in these files:
>
> C:\Python26\Lib\distutils\msvc9compiler.py
> C:\Python26\Lib\distutils\tests\test_msvc9compiler.py
> C:\Python26\Lib\site-packages\numpy\distutils\command\config.py
> C:\Python26\Lib\site-packages\numpy\distutils\fcompiler\compaq.py
>
> And after looking at some code comments, I think this is either a bug in
> python 2.6.4, or python 2.6 requires Visual Studio 2008. I only have Visual
> Studio 2005 installed.
>
> Any thoughts?
> Thanks,
> -Ben
>
>
> PHobson wrote:
>>
>> Whenever I try to build from source, I get an error saying that it can't
>> find vcvarsall.bat. Here are the last few lines of the output from DOS:
>> copying lib\pytz\zoneinfo\US\Pacific ->
>> build\lib.win32-2.6\pytz\zoneinfo\US
>> copying lib\pytz\zoneinfo\US\Pacific-New ->
>> build\lib.win32-2.6\pytz\zoneinfo\US
>> copying lib\pytz\zoneinfo\US\Samoa -> build\lib.win32-2.6\pytz\zoneinfo\US
>> copying lib\dateutil\zoneinfo\zoneinfo-2008e.tar.gz ->
>> build\lib.win32-2.6\dateutil\zoneinfo
>> running build_ext
>> building 'matplotlib.ft2font' extension
>> error: Unable to find vcvarsall.bat
>>
>> Now I can't import pyplot. Any thoughts?
>>
>> Thanks,
>>
>> Paul M. Hobson
>> Senior Staff Engineer
>> --
>> Geosyntec Consultants
>> 55 SW Yamhill St, Ste 200
>> Portland, OR 97204
>> Phone: 503.222.9518
>> www.geosyntec.com
From: Friedrich R. <fri...@gm...> - 2010年02月25日 23:22:33
Ok, it's rereleased now under MIT,
github.com/friedrichromstedt/diagram_cl . I'm having somewhat trouble
accessing my web server at the moment, so please find it on github.
The docu on www.friedrichromstedt.org (see github link) is a bit
outdated, but only with respect to the double-right click settings
dialog.
Friedrich
From: Friedrich R. <fri...@gm...> - 2010年02月25日 23:16:48
2010年2月25日 Eric Firing <ef...@ha...>:
> Is it time for some re-thinking of the approach to 3-D? I am a bystander,
> but I have the uneasy sense that trying to turn mplot3d into a first-class
> 3-D plotting tool may be a misapplication of effort. Might the effort be
> more productive if applied to mayavi, or built on mayavi, so that the 3-D
> engine is already taken care of?
Hmm, mayavi seems not suitable for our purpose,
http://mayavi.sourceforge.net/docs/guide/ch04.html
First, mayavi always creates its gui, second, one has to use an
intermediate vtk file. Don't know what about using vtk directly.
For me, it would just be an interesting task to solve, just as for the
person you cite:
http://www.mail-archive.com/mat...@li.../msg01343.html
Re: [matplotlib-devel] mpl1: models, projections, other comments
Gael Varoquaux
2007年7月22日 02:18:36 -0700
> [...], but I
> did learn something: a 3D package must be fully 3D, or I think it won't
> go far. My personnal opinion is that I won't spend my time on a package
> that wants to do 3D and that does not keep a complete 3D representation
> of its object at all time, and even feeds it to the backends.
I would not feed it to the backend, as our backend seems to be the mpl
plotting engine, but I agree to the basic outline of this thought.
When I move through the code of mplot3d, which is indeed much shorter
that I expected, I find it not that way :-(.
I think, it would be a good approach to rewrite the package nearly
from scratch. I don't want to diminish the work of John and Reinier
in any way, but I think as far as my knowledge of mplot3d reaches, I
come to an answer similar to that cited above.
When John and Reinier would agree, I would like to start thus a new
package, which uses mpl clearly as a backend. For me, I wouln't
derive Axes3D from Axes, as it intermingles both.
This approach would even make the package much more general, as other
backends could be imagined (e.g., direct file rendering or display
from more than one viewing position.) I would feel responsible for
the C++ rendering machine, this has to be fast, but I will certainly
need some advice :-) with Python extensions.
Btw, z sorting isn't sufficient, imagining a ring of surfaces, 1, 2,
..., n, e.g. like in a turbine's compressor wheels, such that 2 > 1
and 3 > 2 ... and 1 > n, thus a ring. Not always is a linear ordering
of the sufaces thus possible.
If my thoughts find some resonance, I would suggest a switch to
matplotlib-devel?
Friedrich
From: Ben A. <bax...@co...> - 2010年02月25日 23:16:48
I am getting the same error.
Here is my console output:
C:\Projects\matplotlib>python setup.py build
basedirlist is: ['win32_static']
============================================================================
BUILDING MATPLOTLIB
 matplotlib: 1.0.svn
 python: 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC
 v.1500 32 bit (Intel)]
 platform: win32
 Windows version: (5, 1, 2600, 2, 'Service Pack 3')
REQUIRED DEPENDENCIES
 numpy: 1.4.0
 freetype2: found, but unknown version (no pkg-config)
 * WARNING: Could not find 'freetype2' headers in any
 * of '.', '.\freetype2'.
OPTIONAL BACKEND DEPENDENCIES
 libpng: found, but unknown version (no pkg-config)
 * Could not find 'libpng' headers in any of '.'
 Tkinter: no
 * Tkinter present, but header files are not found.
 * You may need to install development packages.
 wxPython: 2.8.10.1
 * WxAgg extension not required for wxPython >= 2.8
 Gtk+: no
 * Building for Gtk+ requires pygtk; you must be able
 * to "import gtk" in your build/install environment
 Mac OS X native: no
 Qt: no
 Qt4: no
 Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES
 datetime: present, version unknown
 dateutil: matplotlib will provide
 pytz: 2008c
OPTIONAL USETEX DEPENDENCIES
 dvipng: file.
 ghostscript: 'gswin32c' is not recognized as an internal or
 external command, operable program or batch file.
 latex: no
[Edit setup.cfg to suppress the above messages]
============================================================================
pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends',
'matplotlib.backends.qt4_editor', 'matplotlib.projections',
'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests',
'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid',
'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab',
'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra',
'matplotlib.numerix.random_array', 'matplotlib.numerix.fft',
'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil/zoneinfo']
running build
running build_py
copying lib\matplotlib\mpl-data\matplotlibrc ->
build\lib.win32-2.6\matplotlib\mpl-data
copying lib\matplotlib\mpl-data\matplotlib.conf ->
build\lib.win32-2.6\matplotlib\mpl-data
running build_ext
building 'matplotlib.ft2font' extension
error: Unable to find vcvarsall.bat
I found that I do have a vcvarsall.bat file. it is located here:
"C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
I thought this might be a bug in freetype2, so i downloaded the latest
windows version from:
http://gnuwin32.sourceforge.net/packages/freetype.htm
with no luck. setup.py still says it can't verify my freetype2 version.
After grepping through lots of code, I found that vcvarsall.bat is only
listed in these files:
C:\Python26\Lib\distutils\msvc9compiler.py
C:\Python26\Lib\distutils\tests\test_msvc9compiler.py
C:\Python26\Lib\site-packages\numpy\distutils\command\config.py
C:\Python26\Lib\site-packages\numpy\distutils\fcompiler\compaq.py
And after looking at some code comments, I think this is either a bug in
python 2.6.4, or python 2.6 requires Visual Studio 2008. I only have Visual
Studio 2005 installed.
Any thoughts?
Thanks,
-Ben
PHobson wrote:
> 
> Whenever I try to build from source, I get an error saying that it can't
> find vcvarsall.bat. Here are the last few lines of the output from DOS:
> copying lib\pytz\zoneinfo\US\Pacific ->
> build\lib.win32-2.6\pytz\zoneinfo\US
> copying lib\pytz\zoneinfo\US\Pacific-New ->
> build\lib.win32-2.6\pytz\zoneinfo\US
> copying lib\pytz\zoneinfo\US\Samoa -> build\lib.win32-2.6\pytz\zoneinfo\US
> copying lib\dateutil\zoneinfo\zoneinfo-2008e.tar.gz ->
> build\lib.win32-2.6\dateutil\zoneinfo
> running build_ext
> building 'matplotlib.ft2font' extension
> error: Unable to find vcvarsall.bat
> 
> Now I can't import pyplot. Any thoughts?
> 
> Thanks,
> 
> Paul M. Hobson 
> Senior Staff Engineer
> -- 
> Geosyntec Consultants 
> 55 SW Yamhill St, Ste 200
> Portland, OR 97204
> Phone: 503.222.9518
> www.geosyntec.com
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/Error-build-from-SVN-on-Windows-XP-tp27251915p27714548.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Ethan C. <et...@co...> - 2010年02月25日 21:02:29
Hi all,
I'm using matplotlib-0.99.1 (with backend Qt4, I don't have Tk backends
installed to compare there) on a netbook with Ubuntu netbook remix,
which includes maximus, a window manager which maximizes screen usage on
little screens. It chooses to maximize/not maximize new windows based
upon their WM_CLASS. Since I don't want to maximize matplotlib figures,
I add the matplotlib window WM_CLASS to an exclude list.
A quick check shows that matplotlib (or at least the Qt4 backend)
doesn't set the WM_CLASS of its windows:
> xprop | grep WM_CLASS # click on matplotlib figure
WM_CLASS(STRING) = " ", " "
I'm not that familiar with the innards of matplotlib, so I'm not sure if
this is something that is possible to set in user-space, or if this is
something missing from the backend. Ideally this would be set to
something useful by matplotlib/the backend, but I'd settle for a quick
way of setting it manually.
Thanks for the advice!
Ethan
From: Jeff W. <js...@fa...> - 2010年02月25日 20:19:05
Mike Bauer wrote:
> Jeff,
>
>
> Attached you'll find an example and sample data. Sample output is
> here: http://gallery.me.com/ohtinsel#100149
>
> Below you'll also find an old email about the project that you've
> answered before (might help you understand what I'm doing).
>
> Thank you so much. This is a huge help.
>
> Mike
> 
Mike: OK, I figure out why I have a black plot. In the latest version 
of netCDF4, scale_factor and add_offset are applied automatically, so in 
your script they were effectively being applied twice. Concerning the 
contours spilling out over the domain, just set the keyword masked to 
True in the call to transform_scalar. Concerning the "floating 
whitespace" - your data is on a lat/lon grid, so just plot the data with 
projection='cyl' and specify the lat/lon values of the lower left and 
upper right corners of the grid. Then the data will exactly fit the 
map. Your are using a lambert conformal projection, which covers a much 
larger area than your data.
-Jeff
> mbauer wrote:
> 
>> Thanks Jeff,
>>
>> To clarify, I'm sampling a numpy array (regular lon/lat grid) and
>> extracting a series of same size frames (say 60 longitude grids and 30
>> latitude grids) around a feature of interest, which can be centered
>> somewhere on the map. What I want to do is accumulate statistics with
>> these frames such that the relative size/distances are persevered,
>> which of course means that I can't just add a frame centered on 30N
>> with one centered on 80N. Ideally, I'd like to interpolate each frame
>> to a common point (lon/lat) and display the results either in the
>> common grid space or as radial distances from the common point.
>>
>> Since you're a meteorologist I can simply say I'm creating an ensemble
>> average of extra tropical cyclones from a dozen or so computer models
>> (each with very different resolutions). I want to see how cloud and
>> precipitation features in each model's cyclones compare to a similar
>> product I'm producing from satellite data using weather model output
>> to locate the cyclones. Much the same thing as the link I provided.
>>
>> Thanks for your suggests as transform_scalar sounds like a good place
>> to begin.
>>
>> Mike
>> 
>
> Mike: Thanks for the explanation, I get it now - and I think I have
> just the thing for you. First, define a Basemap instance for a Lambert
> Conformal projection centered on each of you frames that is 5000 km wide
> and 5000 km tall.
>
> # for frame centered on lon_0, lat_0.
> # resolution=None skips processing of boundary datasets to save time.
> m = Basemap(lon_0=lon_0, lat_0=lat_0, projection='lcc', \
> width=5000000, height=5000000, resolution=None)
>
>
> Now interpolate your data to a nx by ny grid that is regular in the map
> projection region.
>
> # data is the lat/lon gridded data, lons and lats are 1D arrays in degrees.
> data2 = m.transform_scalar(data, lons, lats, nx, ny)
>
> The data2 grids will be approximately equally spaced on the surface of
> the earth, regardless on lat_0 and lon_0. Therefore, you should be able
> to just ensemble average all the data2 grids and preserve the relative
> shapes and sizes of the features (this is helped by the fact that the
> projection is conformal, or shape-preserving).
>
> HTH,
>
> -Jeff
>
> ================================================================================
>
> On Thu, Feb 25, 2010 at 12:16 PM, Jeff Whitaker <js...@fa...> wrote:
> 
>> Mike Bauer wrote:
>> 
>>> Howdy All,
>>>
>>> I'm hoping someone can give me a quick solution to a couple of
>>> problems. I think I'm just missing an idea or two.
>>>
>>> Problem 1: I'm creating a map using the 'llc' lambert conformal
>>> projection and pcolormesh. Here is a sampling of the source.
>>>
>>> self.m =
>>> Basemap(lat_0=self.lat_0,lon_0=self.lon_0,projection='lcc',
>>>
>>> width=store_comp.base_width,height=store_comp.base_height,
>>> resolution='i',area_thresh=100000)
>>> self.fig = plt.figure(figsize=(width,hieght),frameon=True)
>>> self.ax = self.fig.add_subplot(111)
>>> self.xx, self.yy = self.m(*numpy.meshgrid(self.x,self.y))
>>> self.the_image =
>>>
>>> self.m.pcolormesh(self.xx,self.yy,z,edgecolors='None',cmap=self.color_scheme)
>>>
>>> The problem I have is two fold: 1) the map segment isn't
>>> fully shown unless I drive up the width and size in basemap so that
>>> the map floats in a lot of whitespace. 2) when I use drawparallels
>>> etc. the lines extend beyond the map in a way that I wish they
>>> wouldn't. See map1 in http://gallery.me.com/ohtinsel#100149
>>>
>>> Problem 2: This problem comes up when I use contourf on the same
>>> data, which occupies only a limited domain (i.e., there is no data
>>> outside the lat/lon bounds shown in map1). Here the contours spill out
>>> onto the plot in a way that I wish they wound't (some of the source
>>> is below). See map2 in http://gallery.me.com/ohtinsel#100149
>>>
>>> self.x = numpy.where(self.x < 180.0,self.x,self.x-360.0)
>>> scale = 1
>>> dx = self.width/((len(self.x)-1)*scale)
>>> dy = self.height/((len(self.y)-1)*scale)
>>> nx = int((self.m.xmax-self.m.xmin)/dx)+1
>>> ny = int((self.m.ymax-self.m.ymin)/dy)+1
>>> self.z,self.xx,self.yy = self.m.transform_scalar(
>>> self.z,self.x,self.y,nx,ny,returnxy=True)
>>> self.the_image =
>>> self.m.contour(self.xx,self.yy,self.z,colors='k')
>>> self.the_image = self.m.contourf(self.xx,self.yy,self.z,
>>> cmap=self.color_scheme,extend=self.extend)
>>>
>>> No doubt I'm doing something wrong and probably obvious, but I can't
>>> figure it out. Suggestions are much appreciated.
>>>
>>> Mike
>>>
>>>
>>>
>>> 
>> Mike: It's difficult to tell what's going on (or even what you're really
>> trying to do) from the code snippets you posted. If you can send a
>> complete, self-contained example of the problem you're having that anybody
>> can run, then we can probably help.
>>
>> -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
>>
>>
>>
>>
>> 
> >
-- 
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: Wai Y. T. <tun...@ya...> - 2010年02月25日 19:56:27
I want to plat a column graph with variable width. The size of both axis 
have meaning. The Y-axis is the density. The X-axis is the size. Let's say 
it is a graph of world population by country. Say China has 1 billion 
people occupying an area of 10000 km2. And Japan has 0.1 billion people 
occupying an area 500 km2. So their density is 1 billion / 10000 and 0.1 
billion / 500 respectively. The chart should show Japan's column twice as 
high as China but much narrower. And the area of each column reflects the 
population.
My question is how do I plot a column graph with variable width? The 
closest I can find is in the histogram in the second example below
http://matplotlib.sourceforge.net/examples/pylab_examples/histogram_demo_extended.html
I'm quite new to matplotlib. Thanks for your help.
Wai Yip
From: Sebastien B. <bi...@ce...> - 2010年02月25日 19:11:35
hi Jeff,
I was wondering if I could reap out your little root2matplot script.
I am planning to release a few helper functions as part of a tutorial I'll be 
giving here at Orsay (how to use python/numpy/.... as an analysis foundation 
in Atlas), and it seems it would be quite interesting to help people switch to 
matplotlib and still interact with the rest of the HEP crowd...
cheers,
sebastien.
On Wednesday 24 February 2010 22:07:03 klukas wrote:
> Tom Leys wrote:
> > It looks like you are storing your source data in a python list.
> > Matplotlib runs much faster if you store your data using a numpy array
> > instead.
> > 
> > I'm no expert, but it certianly sped up my graph drawing.
> 
> I am trying something similar to what Mike was describing. I have
> converted all of the stored data to numpy arrays rather than python lists,
> as per your suggestion. But the plots I'm making don't have more than 50
> entries apiece, and I'm not seeing any appreciable speed-up. It still
> takes ~15 seconds to produce each plot (using PDF backend to save to
> files).
> 
> Does anybody have other thoughts on what I might be able to try to bring
> the lag down to something more reasonable?
> 
> My use case is that I'm building a library to dump the content of
> histograms from ROOT (a data analysis package used in physics) into a
> convenient Hist object that has members to directly plot the data as a
> matplotlib errorbar or bar plot. You can see the 100 lines I've written
> here:
> http://www.hep.wisc.edu/~jklukas/public/root2matplot.py
> 
> I've tried running a profiler like Mike did, but I'm afraid I'm not able to
> parse any useful information from it either.
> 
> I'd appreciate any advice from the community.
> 
> Thanks,
> Jeff
> 
> Output of profiler for producing one single plot:
> ----------------------------------------------------
> 
> Wed Feb 24 15:01:20 2010 timing
> 
> 6995086 function calls (6983887 primitive calls) in 22.301 CPU
> seconds
> 
> Ordered by: cumulative time
> List reduced from 1080 to 25 due to restriction <25>
> 
> ncalls tottime percall cumtime percall filename:lineno(function)
> 1 0.004 0.004 22.301 22.301 ../overlayHists.py:367(main)
> 20/1 0.139 0.007 21.669 21.669
> ../overlayHists.py:123(process_directory)
> 1 0.001 0.001 21.529 21.529
> ../overlayHists.py:231(process_hist_matplotlib)
> 2 0.000 0.000 21.384 10.692
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/pyplot.py:354(savefig) 2 0.000 0.000 21.384 
> 10.692
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/figure.py:959(savefig) 2 0.000 0.000 21.384 
> 10.692
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/backend_bases.py:1372(print_figure) 2 0.000 0.000 
> 21.373 10.687
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/backends/backend_pdf.py:2012(print_pdf) 126/2 0.001 
> 0.000 12.314 6.157
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/artist.py:44(draw_wrapper) 2 0.000 0.000 12.314 
> 6.157
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/figure.py:729(draw) 2 0.000 0.000 12.310 6.155
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/axes.py:1632(draw) 4 0.002 0.000 11.940 2.985
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/axis.py:727(draw) 40 0.005 0.000 11.927 0.298
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/text.py:504(draw) 58 0.023 0.000 10.349 0.178
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/dviread.py:805(find_tex_file) 58 0.008 0.000 9.904
> 0.171
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/subproces
> s.py:662(communicate) 15059 9.899 0.001 9.899 0.001 {method
> 'read' of 'file' objects}
> 2 0.000 0.000 9.051 4.526
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/backends/backend_pdf.py:447(close) 2 0.001 0.001 
> 9.043 4.521
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/backends/backend_pdf.py:520(writeFonts) 8 0.008 0.001
> 9.041 1.130
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/backends/backend_pdf.py:554(embedTeXFont) 8 0.000 
> 0.000 8.637 1.080
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/type1font.py:47(__init__) 304 0.001 0.000 7.796 
> 0.026
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/dviread.py:50(__iter__) 157/152 0.017 0.000 7.780 
> 0.051
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/dviread.py:114(_read) 5788/3854 0.025 0.000 7.765 
> 0.002
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/dviread.py:146(_dispatch) 116 0.004 0.000 7.751 
> 0.067
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/backends/backend_pdf.py:1643(get_text_width_height_descent)
> 116 0.002 0.000 7.711 0.066
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/texmanager.py:576(get_text_width_height_descent) 82 
> 0.007 0.000 7.690 0.094
> /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-pack
> ages/matplotlib/text.py:250(_get_layout)
-- 
#########################################
# Dr. Sebastien Binet
# Laboratoire de l'Accelerateur Lineaire
# Universite Paris-Sud XI
# Batiment 200
# 91898 Orsay
#########################################
From: Nico S. <nic...@gm...> - 2010年02月25日 18:55:33
Hi all,
I'd like to make a countour plot just like in
http://matplotlib.sourceforge.net/examples/pylab_examples/contour_demo.html
but instead of text at the contour lines I'd like to have arrows in
the in the direction of the contour lines. Does anyone know if that's
possible.
Cheers,
Nico
From: Eric F. <ef...@ha...> - 2010年02月25日 18:54:41
Sebastian Rhode wrote:
> Hi,
> 
> I would like to show an image using the imshow function. Thsi is quite 
> trivial, but what I acn not figure out so far, is how to display the 
> image without any interpolation. For my application it is useful to 
> really see the individaul pixel and the borders between them. Setting 
> interpolation=None did not give the expected results ...
interpolation='nearest'
Eric
> 
> Thanks for your help,
> 
> Sebi
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Sebastian R. <seb...@go...> - 2010年02月25日 18:53:05
Hi,
I would like to show an image using the imshow function. Thsi is quite
trivial, but what I acn not figure out so far, is how to display the image
without any interpolation. For my application it is useful to really see the
individaul pixel and the borders between them. Setting interpolation=None
did not give the expected results ...
Thanks for your help,
Sebi
From: Eric F. <ef...@ha...> - 2010年02月25日 18:27:19
John Hunter wrote:
[...]
> 
> It looks like we have enough 3D projects to justify a google summer of 
> code student. Would those of you with an interest in mplot3d and some 
> knowledge of the internals be interested in helping mentor a student?
> 
http://www.mail-archive.com/mat...@li.../msg01343.html
Is it time for some re-thinking of the approach to 3-D? I am a 
bystander, but I have the uneasy sense that trying to turn mplot3d into 
a first-class 3-D plotting tool may be a misapplication of effort. 
Might the effort be more productive if applied to mayavi, or built on 
mayavi, so that the 3-D engine is already taken care of?
Eric
From: afancy <gr...@gm...> - 2010年02月25日 17:49:27
Hi,
I want to generate a graph with line, and table at the bottom. However, I
found that the fontsize is very small and it is unchangeable. Could anybody
help me? thanks
Regards
afancy
fig=figure()
ax=fig.add_subplot(111)
data=(
 (0.529, 0.612, 0.855, 0.178, 1.432, 6.43, 41.311, 1.62,
71.012, 1.59, 0.271, 0.066, 4.721),
 (0.014, 0.512, 0.015, 0.161, 1.177, 6.793, 0.089, 1.495,
25.65, 0.014, 0.045, 0.052, 5.423),
 (0.493, 834.351, 0.156, 743.193,0.428, 84.101, 1058.062,8.652,
1023, 0.168, 7.101, 8.135, 152.646),
 (118.90,2035.35, 89.35, 15.402, 10.856,110.049,3024.42,
8054.74,5214.36, 5.539, 11.539, 515.632,150.411)
 )
rowLabels=['row1','row2', 'row3', 'row4']
colLabels=['Q%d'%(x+1) for x in range(13)]
the_table = table(cellText=txtdata, rowLabels=rowLabels,
colLabels=colLabels, loc='bottom')
the_table.set_fontsize(20.0)
From: Jeff W. <js...@fa...> - 2010年02月25日 17:16:38
Mike Bauer wrote:
> Howdy All,
>
> I'm hoping someone can give me a quick solution to a couple of
> problems. I think I'm just missing an idea or two.
>
> Problem 1: I'm creating a map using the 'llc' lambert conformal
> projection and pcolormesh. Here is a sampling of the source.
>
> self.m = Basemap(lat_0=self.lat_0,lon_0=self.lon_0,projection='lcc',
>
> width=store_comp.base_width,height=store_comp.base_height,
> resolution='i',area_thresh=100000)
> self.fig = plt.figure(figsize=(width,hieght),frameon=True)
> self.ax = self.fig.add_subplot(111)
> self.xx, self.yy = self.m(*numpy.meshgrid(self.x,self.y))
> self.the_image =
> self.m.pcolormesh(self.xx,self.yy,z,edgecolors='None',cmap=self.color_scheme)
>
> The problem I have is two fold: 1) the map segment isn't
> fully shown unless I drive up the width and size in basemap so that
> the map floats in a lot of whitespace. 2) when I use drawparallels
> etc. the lines extend beyond the map in a way that I wish they
> wouldn't. See map1 in http://gallery.me.com/ohtinsel#100149
>
> Problem 2: This problem comes up when I use contourf on the same
> data, which occupies only a limited domain (i.e., there is no data
> outside the lat/lon bounds shown in map1). Here the contours spill out
> onto the plot in a way that I wish they wound't (some of the source
> is below). See map2 in http://gallery.me.com/ohtinsel#100149
>
> self.x = numpy.where(self.x < 180.0,self.x,self.x-360.0)
> scale = 1
> dx = self.width/((len(self.x)-1)*scale)
> dy = self.height/((len(self.y)-1)*scale)
> nx = int((self.m.xmax-self.m.xmin)/dx)+1
> ny = int((self.m.ymax-self.m.ymin)/dy)+1
> self.z,self.xx,self.yy = self.m.transform_scalar(
> self.z,self.x,self.y,nx,ny,returnxy=True)
> self.the_image =
> self.m.contour(self.xx,self.yy,self.z,colors='k')
> self.the_image = self.m.contourf(self.xx,self.yy,self.z,
> cmap=self.color_scheme,extend=self.extend)
>
> No doubt I'm doing something wrong and probably obvious, but I can't
> figure it out. Suggestions are much appreciated.
>
> Mike
>
>
> 
Mike: It's difficult to tell what's going on (or even what you're 
really trying to do) from the code snippets you posted. If you can send 
a complete, self-contained example of the problem you're having that 
anybody can run, then we can probably help.
-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: Mike B. <mb...@gi...> - 2010年02月25日 16:01:38
Howdy All,
I'm hoping someone can give me a quick solution to a couple of
problems. I think I'm just missing an idea or two.
Problem 1: I'm creating a map using the 'llc' lambert conformal
projection and pcolormesh. Here is a sampling of the source.
 self.m = Basemap(lat_0=self.lat_0,lon_0=self.lon_0,projection='lcc',
width=store_comp.base_width,height=store_comp.base_height,
 resolution='i',area_thresh=100000)
 self.fig = plt.figure(figsize=(width,hieght),frameon=True)
 self.ax = self.fig.add_subplot(111)
 self.xx, self.yy = self.m(*numpy.meshgrid(self.x,self.y))
 self.the_image =
self.m.pcolormesh(self.xx,self.yy,z,edgecolors='None',cmap=self.color_scheme)
 The problem I have is two fold: 1) the map segment isn't
fully shown unless I drive up the width and size in basemap so that
the map floats in a lot of whitespace. 2) when I use drawparallels
etc. the lines extend beyond the map in a way that I wish they
wouldn't. See map1 in http://gallery.me.com/ohtinsel#100149
 Problem 2: This problem comes up when I use contourf on the same
data, which occupies only a limited domain (i.e., there is no data
outside the lat/lon bounds shown in map1). Here the contours spill out
onto the plot in a way that I wish they wound't (some of the source
is below). See map2 in http://gallery.me.com/ohtinsel#100149
 self.x = numpy.where(self.x < 180.0,self.x,self.x-360.0)
 scale = 1
 dx = self.width/((len(self.x)-1)*scale)
 dy = self.height/((len(self.y)-1)*scale)
 nx = int((self.m.xmax-self.m.xmin)/dx)+1
 ny = int((self.m.ymax-self.m.ymin)/dy)+1
 self.z,self.xx,self.yy = self.m.transform_scalar(
 self.z,self.x,self.y,nx,ny,returnxy=True)
 self.the_image =
self.m.contour(self.xx,self.yy,self.z,colors='k')
 self.the_image = self.m.contourf(self.xx,self.yy,self.z,
 cmap=self.color_scheme,extend=self.extend)
No doubt I'm doing something wrong and probably obvious, but I can't
figure it out. Suggestions are much appreciated.
Mike
From: Gökhan S. <gok...@gm...> - 2010年02月25日 15:21:32
On Thu, Feb 25, 2010 at 8:56 AM, afancy <gr...@gm...> wrote:
> Hi,
>
> I have some difficulty to use the log scale on bar chart. Could anybody
> help me, thanks in advace.
>
> Regards,
> afancy
>
> from matplotlib.font_manager import FontProperties
> data=((0.014, 0.512, 0.015, 0.161, 1.177, 6.793, 0.089, 1.495,
> 25.65, 0.014, 0.045, 0.052, 5.423),
> (0.529, 0.612, 0.855, 0.178, 1.432, 6.43, 41.311, 1.62,
> 71.012, 1.59, 0.271, 0.066, 4.721),
> (0.493, 834.351, 0.156, 743.193,0.428, 84.101, 1058.062,8.652,
> 1023, 0.168, 7.101, 8.135, 152.646),
> (118.90,2035.35, 89.35, 15.402, 10.856,110.049,3024.42,
> 8054.74,5214.36, 5.539, 11.539, 515.632,150.411)
> )
>
> rects=[]
> xticks=[]
> patterns = ('/','x', '\\','o')
> colors=['r','b','y', 'g']
>
> fig = figure()
> ax=fig.add_subplot(111)
>
> ax.set_yscale('log')
> ax.set_ylim(1e-4, 1e5)
> width=0.1
>
> for q in range(13):
> for n in range(4):
> l = q+width*n
> h = data[n][q]
> w = width
> rect, = ax.bar(l, h, w, bottom=0, fill=False, hatch=patterns[n],
> log=True)
>
>
> draw()
>
>
Try without bottom=0 in ax.bar. Also you don't need ax.set_yscale('log') in
the first place. How did you get something seen on your screen without
show() in the end?
>
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
-- 
Gökhan
From: Friedrich R. <fri...@gm...> - 2010年02月25日 15:05:27
Attachments: tst06.ppm.rar
2010年2月25日 John Hunter <jd...@gm...>:
> We rely on plenty of C++ code so this isn't a problem for us. We would have
> to write an interface layer but it shouldn't be too difficult. The harder
> problem may be dealing tracking the interior vs the edges of the mesh, but
> certainly not insurmountable. If you'd like to contribute the code, that'd
> be great. If you want to add some comments first, even better.
I'll be happy to contribute the code, but it certainly needs some
reworking and investigation before, because I recall it to be written
in part with german class names ... well, it was a high-school project
... long ago.
I think the concept could be fairly easy if I'm not mistaken: One has
a list of "pathes" (lines) and a list of "patches" (surfaces). When
adding a plot, it will be both created and appended. Then the
rendering engine clips the "pathes" and "patches" as mentioned.
I think also it would be a nice idea to design the thing in the whole
such that it can be integrated into matplotlib's core, I mean, that
one does not need to call another module to make 3D plots, but instead
simply passes another coordinate as non-None. But this is just an
idea, I'm inclined to believe that it's maybe not feasible at the
present point. Also I have way to low knowledge about mplot3d and am
in fact new to it. Thus please apologise this thought if it is
half-baken or even raw.
> I believe the faces are quadrilateral, and Michael already wrote the code to
> convert these to triangle meshes for his gouraud shading work ( which I'd
> still like to see ported to 3d).
That sounds good, at least to me.
In fact, the project of mine is a complete renderer, thus we could
also incorporate any kind of shading and light sources and shadows
...... I send a picture appended.
> It looks like we have enough 3D projects to justify a google summer of code
> student. Would those of you with an interest in mplot3d and some knowledge
> of the internals be interested in helping mentor a student?
I never dived very deeply into matplotlib, and don't know how much
time I can efford for even one more project, but I can certainly help
with telling the concepts of my implementation etc. and how I coded
things, such that another person can do the real work :-) In fact,
even this small amount of help could maybe save us a lot of time?
My deepest matplotlib project was that mentioned in the thread
"Embedding matplotlib in Tkinter Applications" in the first post.
(Soon unter MIT.)
It would be great for me to make a contribution to a real usable
rendering engine ... :-)
Friedrich
From: afancy <gr...@gm...> - 2010年02月25日 15:04:14
Hi,
I have some difficulty to use the log scale on bar chart. Could anybody help
me, thanks in advace.
Regards,
afancy
from matplotlib.font_manager import FontProperties
data=((0.014, 0.512, 0.015, 0.161, 1.177, 6.793, 0.089, 1.495,
25.65, 0.014, 0.045, 0.052, 5.423),
 (0.529, 0.612, 0.855, 0.178, 1.432, 6.43, 41.311, 1.62,
71.012, 1.59, 0.271, 0.066, 4.721),
 (0.493, 834.351, 0.156, 743.193,0.428, 84.101, 1058.062,8.652,
1023, 0.168, 7.101, 8.135, 152.646),
 (118.90,2035.35, 89.35, 15.402, 10.856,110.049,3024.42,
8054.74,5214.36, 5.539, 11.539, 515.632,150.411)
 )
rects=[]
xticks=[]
patterns = ('/','x', '\\','o')
colors=['r','b','y', 'g']
fig = figure()
ax=fig.add_subplot(111)
ax.set_yscale('log')
ax.set_ylim(1e-4, 1e5)
width=0.1
for q in range(13):
 for n in range(4):
 l = q+width*n
 h = data[n][q]
 w = width
 rect, = ax.bar(l, h, w, bottom=0, fill=False, hatch=patterns[n],
log=True)
draw()
From: John H. <jd...@gm...> - 2010年02月25日 14:04:27
On Feb 25, 2010, at 2:50 AM, Friedrich Romstedt <fri...@gm... 
 > wrote:
> 2010年2月25日 Reinier Heeres <re...@he...>:
>> Of course many 3D engines do this already, but the problem is always
>> the integration. Is your engine python based and is the code (freely)
>> available? I would be interested in taking a look.
>
> It's C++ code :-( And nearly no comments :-(( I myself will need some
> time to find out what part does what.
> But nevertheless, if it can help, I will be happy to privide with it.
> Maybe it's faster than writing from scratch and tracking all the bugs
>
We rely on plenty of C++ code so this isn't a problem for us. We would 
have to write an interface layer but it shouldn't be too difficult. 
The harder problem may be dealing tracking the interior vs the edges 
of the mesh, but certainly not insurmountable. If you'd like to 
contribute the code, that'd be great. If you want to add some comments 
first, even better.
>
>> Also, currently the native mpl structures are polygons instead of a
>> triangles, so they will have to be decomposed. This will definitely
>> cause some issues with line styles etc. that should not be applied to
>> all edges.
>
> What kind of structure is used to store the polygons? Is each 
> polygon planar?
>
I believe the faces are quadrilateral, and Michael already wrote the 
code to convert these to triangle meshes for his gouraud shading work 
( which I'd still like to see ported to 3d).
It looks like we have enough 3D projects to justify a google summer of 
code student. Would those of you with an interest in mplot3d and some 
knowledge of the internals be interested in helping mentor a student?
> For the second issue, one could decompose the polygon into surface and
> boundary. The lines would be clipped against the surfaces only, and
> the surfaces against the surfaces too. Then one could draw the
> surfaces first without any line style around the triangles, and in the
> end the boundaries.
>
> When performing clipping, there will be no way around decomposing the
> polygons into something?
>
> Friedrich
>
> --- 
> --- 
> --- 
> ---------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Friedrich R. <fri...@gm...> - 2010年02月25日 08:50:53
2010年2月25日 Reinier Heeres <re...@he...>:
> Of course many 3D engines do this already, but the problem is always
> the integration. Is your engine python based and is the code (freely)
> available? I would be interested in taking a look.
It's C++ code :-( And nearly no comments :-(( I myself will need some
time to find out what part does what.
But nevertheless, if it can help, I will be happy to privide with it.
Maybe it's faster than writing from scratch and tracking all the bugs
...
> Also, currently the native mpl structures are polygons instead of a
> triangles, so they will have to be decomposed. This will definitely
> cause some issues with line styles etc. that should not be applied to
> all edges.
What kind of structure is used to store the polygons? Is each polygon planar?
For the second issue, one could decompose the polygon into surface and
boundary. The lines would be clipped against the surfaces only, and
the surfaces against the surfaces too. Then one could draw the
surfaces first without any line style around the triangles, and in the
end the boundaries.
When performing clipping, there will be no way around decomposing the
polygons into something?
Friedrich
From: Reinier H. <re...@he...> - 2010年02月25日 08:35:57
Hi Friedrich,
Thanks for your message.
On Thu, Feb 25, 2010 at 9:24 AM, Friedrich Romstedt
<fri...@gm...> wrote:
> I have worked in highschool on a project "Beam tracing" where I had to
> subdivide triangles from a certain point of view with z-ordering and with
> such a subdivision how they are covered by the viewing beam. This means
> this engine you want to write already exists. See the following ascii
> graphics:
Of course many 3D engines do this already, but the problem is always
the integration. Is your engine python based and is the code (freely)
available? I would be interested in taking a look.
Also, currently the native mpl structures are polygons instead of a
triangles, so they will have to be decomposed. This will definitely
cause some issues with line styles etc. that should not be applied to
all edges.
Cheers,
Reinier
>
> +------------+
> |      /
> |  1   /
> |     /
> | +-----/------+
> |  \ 2 /   /
> |  \ /   /
> |   /  3 /
> |  / \  /
> |  /  \ /
> | /   \/
> | /
> |/
>
> Say that 1 is in front of 2 + 3. Then the engine will leave 1 unchanged,
> will discard 2, and will subdivide 3 into a number of sub-triangles, which
> comprise 3 exactly.
>
> Don't know whether you are interested in the tringles at all or only in the
> pathes of their contours.
>
> The engine assumes that the sets of points comprising the sufaces of the
> triangles are disjoint.
>
> Friedrich
>
> 2010年2月25日 Reinier Heeres <re...@he...>:
>> Hi all,
>>
>> I'll mention again that I intend to continue supporting mplot3d,
>> although help would be greatly appreciated.
>>
>> I think the z-ordering issues are in the end quite hard to tackle,
>> especially since we can have different kinds of structures in a plot,
>> e.g. polygons and lines (or rather: curves).
>>
>> John's suggestion of a global polygon list would indeed be a good way
>> forward, and I will think about implementing this soon. However, the
>> next step of finding intersecting polygons and breaking them properly
>> could be quite slow if implemented in pure python. So I'm not sure
>> whether our goal should be to create a full 3d engine...
>>
>> Cheers,
>> Reinier
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
-- 
Reinier Heeres
Tel: +31 6 10852639
From: Friedrich R. <fri...@gm...> - 2010年02月25日 08:27:12
Andrew, I sent this to you personally, unintentionally, and want it to
be on the list too. So you have it doubled now, sorry.
2010年2月25日 Andrew Charles <ac...@gm...>:
> I'm trying to interpolate from one grid to another using Basemap's
> interp function. It seems to want the lat and lon axis of the new grid
> to have the same shape:
>
> 3524 if xout.shape != yout.shape:
> 3535   raise ValueError, 'xout and yout must have same shape!'
>
> The grid I'm interpolating to is 144 by 72
>
> I'm calling it as interp(x,lon,lat,plon,plat)
> where lon and plon are numpy arrays with shape (144,) lat has shape
> (73,) plat has shape(72,) and x has shape (72, 144)
>
> Does interp() really only work if the target grid is square?
I guess it wants a meshgrid, use e.g.:
lats = len(lat)
lons = len(lon)
lat = lat[:, numpy.newaxis].repeat(lons, axis = 1)
lon = lon[numpy.newaxis, :].repeat(lats, axis = 0)
- or the other way round -
lat = lat[numpy.newaxis, :].repeat(lons, axis = 0)
lon = lat[:, numpy.newaxis].repeat(lats, axis = 1)
depending on what axis lat and lon should respectively be associated with.
A meshgrid is a sequence of coordinate grids. For each point KEY, the
coordinates are MESHGRID[:, KEY]. Thus you can via meshgrids specifiy
also distorted grids to interpolate to (e.g. a wavy rectangular grid
or something). (I guess this is actually needed when doing Mercator
to Postels or similar).
Friedrich
37 messages has been excluded from this view by a project administrator.

Showing results of 620

<< < 1 2 3 4 5 .. 25 > >> (Page 3 of 25)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /