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
(19)
2
(30)
3
(14)
4
(1)
5
(16)
6
(7)
7
(12)
8
(14)
9
(35)
10
(16)
11
(31)
12
(6)
13
(14)
14
(13)
15
(20)
16
(15)
17
(27)
18
(5)
19
(10)
20
(22)
21
(20)
22
(30)
23
(25)
24
(11)
25
(2)
26
(2)
27
(23)
28
(20)
29
(26)
30
(25)
31
(7)

Showing 25 results of 25

From: Jae-Joon L. <lee...@gm...> - 2009年07月23日 22:41:14
Hi,
Thanks for reporting this.
The axes class in axes_grid toolkits uses different artists to render
ticks and ticklabels. And some of the features in the original
matplotlib won't work correctly, and the "tick direction" turned out
to be one of them.
However, I just committed a fix for this to the svn (r7292), so it
should work now.
So, please install mpl from the current svn again, and test it.
Unfortunately, while the ticks are rotated, the pad for tick labels
are not automatically adjusted.
Therefore, you may want to adjust it manually. e.g.,
ax.axis["left"].major_tick_pad = 10
I'll try to improve this in the future.
On the other hand, you may take a look at the recently added "spine"
support in the main matplotlib.
http://matplotlib.sourceforge.net/examples/pylab_examples/spine_placement_demo.html
If you use spine, than all the ticks & ticklabels feature in mpl will work.
Regards,
-JJ
On Thu, Jul 23, 2009 at 3:23 PM, Nicolas Pinto<nic...@gm...> wrote:
> Hello,
>
> I'm trying to get the ticks "out" in the following scripts using matplotlib
> svn version. Any reason why it's not working ? Should I dig deeper in
> mpl_toolkits ?
>
> # -- Script 1
> # modified from
> http://matplotlib.sourceforge.net/examples/axes_grid/simple_axisline3.html
> import matplotlib.pyplot as plt
> from mpl_toolkits.axes_grid.axislines import Subplot
>
> plt.rc("xtick", direction="out")
> plt.rc("ytick", direction="out")
>
> fig = plt.figure(1, (3,3))
>
> ax = Subplot(fig, 111)
> fig.add_subplot(ax)
>
> ax.axis["right"].set_visible(False)
> ax.axis["top"].set_visible(False)
>
> plt.show()
>
> # -- EOF
>
> # -- Script 2
> # modified from
> http://matplotlib.sourceforge.net/examples/axes_grid/simple_axisline2.html
>
> import matplotlib.pyplot as plt
> from mpl_toolkits.axes_grid.axislines import SubplotZero
> import numpy as np
>
> plt.rc("xtick", direction="out")
> plt.rc("ytick", direction="out")
>
> fig = plt.figure(1, (4,3))
>
> # a subplot with two additiona axis, "xzero" and "yzero". "xzero" is
> # y=0 line, and "yzero" is x=0 line.
> ax = SubplotZero(fig, 1, 1, 1)
> fig.add_subplot(ax)
>
> # make xzero axis (horizontal axis line through y=0) visible.
> ax.axis["xzero"].set_visible(True)
> ax.axis["xzero"].label.set_text("Axis Zero")
>
> # make other axis (bottom, top, right) invisible.
> for n in ["bottom", "top", "right"]:
>   ax.axis[n].set_visible(False)
>
> xx = np.arange(0, 2*np.pi, 0.01)
> ax.plot(xx, np.sin(xx))
>
> plt.show()
>
> # -- EOF
>
> Thanks for your help.
>
> Best regards,
>
> --
> Nicolas Pinto
> Ph.D. Candidate, Brain & Computer Sciences
> Massachusetts Institute of Technology, USA
> http://web.mit.edu/pinto
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Michael D. <md...@st...> - 2009年07月23日 20:15:47
The latest version I see there is 2.3.9. Is this another instance of 
the sourceforge file display bug that haunted matplotlib recently?
Mike
Nils Wagner wrote:
> Hi all,
>
> I am confused by the build requirements for matplotlib.
> I cannot find freetype 1.4
>
> http://matplotlib.sourceforge.net/users/installing.html
>
> The latest version is freetype 1.3.1
>
> http://sourceforge.net/projects/freetype/files/
>
> Any comments ?
>
> Nils
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Nils W. <nw...@ia...> - 2009年07月23日 19:50:53
Hi all,
I am confused by the build requirements for matplotlib.
I cannot find freetype 1.4
http://matplotlib.sourceforge.net/users/installing.html
The latest version is freetype 1.3.1
 http://sourceforge.net/projects/freetype/files/
Any comments ?
 Nils
From: Nicolas P. <nic...@gm...> - 2009年07月23日 19:23:40
Hello,
I'm trying to get the ticks "out" in the following scripts using matplotlib
svn version. Any reason why it's not working ? Should I dig deeper in
mpl_toolkits ?
# -- Script 1
# modified from
http://matplotlib.sourceforge.net/examples/axes_grid/simple_axisline3.html
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.axislines import Subplot
plt.rc("xtick", direction="out")
plt.rc("ytick", direction="out")
fig = plt.figure(1, (3,3))
ax = Subplot(fig, 111)
fig.add_subplot(ax)
ax.axis["right"].set_visible(False)
ax.axis["top"].set_visible(False)
plt.show()
# -- EOF
# -- Script 2
# modified from
http://matplotlib.sourceforge.net/examples/axes_grid/simple_axisline2.html
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.axislines import SubplotZero
import numpy as np
*plt.rc("xtick", direction="out")
plt.rc("ytick", direction="out")
*
fig = plt.figure(1, (4,3))
# a subplot with two additiona axis, "xzero" and "yzero". "xzero" is
# y=0 line, and "yzero" is x=0 line.
ax = SubplotZero(fig, 1, 1, 1)
fig.add_subplot(ax)
# make xzero axis (horizontal axis line through y=0) visible.
ax.axis["xzero"].set_visible(True)
ax.axis["xzero"].label.set_text("Axis Zero")
# make other axis (bottom, top, right) invisible.
for n in ["bottom", "top", "right"]:
 ax.axis[n].set_visible(False)
xx = np.arange(0, 2*np.pi, 0.01)
ax.plot(xx, np.sin(xx))
plt.show()
# -- EOF
Thanks for your help.
Best regards,
-- 
Nicolas Pinto
Ph.D. Candidate, Brain & Computer Sciences
Massachusetts Institute of Technology, USA
http://web.mit.edu/pinto
From: Ralf G. <ral...@go...> - 2009年07月23日 17:27:29
On Wed, Jul 22, 2009 at 6:36 AM, Alexander Baker
<bak...@gm...>wrote:
>
>
> Ralph,
>
> Perhaps time to migrate to Chaco API from Enthought? not sure if there is
> Ubuntu support yet however.
Alex, I assume you did not mean to send this to the list...
Anyway, matplotlib is a central part of my application and is not going
anywhere. The next step to try to fix this issue is compiling from trunk and
seeing if anything changes. Unfortunately I do not have too much time at the
moment so it may take a while to find the problem.
Cheers,
Ralf
>
> Alex Baker
>
> http://code.enthought.com/chaco/
>
>
> Ralf Gommers-2 wrote:
> >
> > Hi,
> >
> > I am working on a PyQt4 application with some embedded MPL figures, and
> am
> > also trying to save some figures as png's without displaying them. I am
> > observing huge memory increases (10s or 100s of Mb) the moment I try to
> > save
> > a png. I reproduced the issue by combining two mpl examples,
> >
> http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_qt4.htmland
> > http://matplotlib.sourceforge.net/examples/api/agg_oo.html. Full code is
> > attached. When pressing the "save figure" button, memory usage shoots up,
> > multiple clicks keep sending it higher (although not monotonically).
>
>
From: Jorge S. <jor...@ya...> - 2009年07月23日 16:36:34
 <jorgesmbox-ml@...> writes:
> 
> Hi,
> I have a strange problem. It seems to me it is related to 
> mpl.axes.Axes.add_collection(), but I am too lost to be sure. 
Well, I haven't solved this problem yet, but it seems that the add_collection()
method is not the one at fault. It looks like the lasso widget I am using to
selct the regions is returning for the fourth region the same vertices than for
the third one. That's why I saw nothing for the fourth region when I was
actually passing the add_collection() method a valid PolyCollection. I'll keep
on looking... but why the fourth?
Jorge
From: Michael D. <md...@st...> - 2009年07月23日 12:57:40
I'm not able to reproduce this problem here. Can you provide a 
standalone script that illustrates it? Also, what version of matplotlib 
are you using?
Mike
Barnette, Daniel W wrote:
> I've written a python gui to matplotlib which allows the user to plot either cartesian, semi-log, or log-log plots. Log plots can be generated for typical base values except for base 2. Is this a bug, or is there some reason that matplotlib does not do log plots using base 2?
>
> Using base 2, the log-log plot error is:
>
> ------ begin snippet -----
> Exception in Tkinter callback
> Traceback (most recent call last):
> File "C:\python251_102507\lib\lib-tk\Tkinter.py", line 1403, in __call__
> return self.func(*args)
> File "C:\python251_102507\lib\site-packages\matplotlib\backends\backend_tkagg.
> py", line 211, in resize
> self.show()
> File "C:\python251_102507\lib\site-packages\matplotlib\backends\backend_tkagg.
> py", line 214, in draw
> FigureCanvasAgg.draw(self)
> File "C:\python251_102507\lib\site-packages\matplotlib\backends\backend_agg.py
> ", line 261, in draw
> self.figure.draw(self.renderer)
> File "C:\python251_102507\lib\site-packages\matplotlib\figure.py", line 759, i
> n draw
> for a in self.axes: a.draw(renderer)
> File "C:\python251_102507\lib\site-packages\matplotlib\axes.py", line 1523, in
> draw
> a.draw(renderer)
> File "C:\python251_102507\lib\site-packages\matplotlib\axis.py", line 712, in
> draw
> for tick, loc, label in self.iter_ticks():
> File "C:\python251_102507\lib\site-packages\matplotlib\axis.py", line 659, in
> iter_ticks
> minorLocs = self.minor.locator()
> File "C:\python251_102507\lib\site-packages\matplotlib\ticker.py", line 1026,
> in __call__
> if len(subs) > 1 or subs[0] != 1.0:
> IndexError: index out of bounds
>
> ----- end snippet -----
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: <jor...@ya...> - 2009年07月23日 12:22:47
Hi,
I have a strange problem. It seems to me it is related to 
mpl.axes.Axes.add_collection(), but I am too lost to be sure. I have a 
script for visualizing certain aspects of images, built upon many bits 
and pieces I found on the matplotlib example section. It basically lets 
me view an image from two different perspectives, that is, its usual 
representation and another one, for example a scatter plot of red versus 
green. That part is working, but I added later on the possibility to 
select a group of points in either representation and see them 
highlighted in both with the same color. That part works OK, up to the 
third selected region, but when I select the fourth something strange 
happens, as I don't see this region in any of the subplots. I represent 
the regions as collections, and add them to subplot with 
add_collection() method. The collections themselves are created ok, and 
the get_children() method even report having them, but they are not 
visible. What surprises me the most is that it is always the fourth 
selected region the one showing this problem, no matter how big or small 
are the previous ones.I tried to make a scaled down version of the 
script exhibiting the problem, but it works ok then. I could post the 
code here, but then I'll force you to go through a 300 lines script. How 
do you go about debugging these sort of problems?
As a side note, the doc tells that add_collection() returns the 
collection, when it actually returns a NoneType object.
BTW, I am using the gtk backend, ipython is started with ipython 
-gthread -pylab. Matplotlib version is 0.98.5.3
Regards,
Jorge
From: Jeff W. <js...@fa...> - 2009年07月23日 12:15:41
Denis-B wrote:
> Robert C, Robert K, folks,
>
> messing with the nice delaunay/testfuncs.py to time
> linear_interpolate_grid nn_interpolate_grid and nn_interpolate_unstructured
> in _delaunay, I see linear ~ 100 times faster than the nn_ s:
>
> # from: trigrid Ntri=1000 Ngrid=100 run: 21 Jul 2009 17:33 mac 10.4.11 ppc
>
> time: 0.027 sec trigrid: build Triangulation 1000
> time: 0.0059 sec trigrid 100 "linear" corners: 0 1 2 1
> time: 0.5 sec trigrid 100 "nn_grid" corners: 0 1 2 1
> time: 0.49 sec trigrid 100 "nn_unstruct" corners: 0 1 2 1
>
> Correct me: if all 3 methods do gridpoint-to-triangle in the same way, 
> then the huge diff is in find-neighboring-triangles (6 on average ?), not in
> gridpoint-to-triangle ?
>
> This is with the _delaunay.so that comes with the mac 98.5.3 egg,
> however that was compiled (-O3 ?)
>
>
> What to do ?
>
> 1) does it matter, how many people care ? (all who believe in telekinesis,
> raise my right hand)
>
> 2) natgrid ? don't see it in matplotlib.sf.net
>
> 3) stick with fast linear, smooth the triangle planes a la 3t^2 - 2t^3 or
> fancier smoothing
>
> In any case, add griddata( ... method = "linear" / "nn" ... ) so users have
> a choice.
> 
Denis: I have added an 'interp' keyword to griddata (svn revision 7287) 
so you can choose the faster linear interpolation with interp='linear'. 
However, for linear interpolation the output grid is assumed to be 
regular with constant dx and dy (and this is *not* checked for by griddata).
The natgrid toolkit is on the sf site under 'Files', then 
'matplotlib-toolkits'. It is in fact slower than the Delaunay package 
included in matplotlib, but a little bit more robust for pathological cases.
-Jeff
> Can a real user or two tell us about the flow,
> with some rough numbers for Ntri Ngrid Npix --
> Ntri = nr original sample points, say 1000
> Ngrid 100 x 100
> Npix 800 x 600 ?
> (Ntri -> Ngrid slowly and accurately,
> then Ngrid -> Npix w fast inaccurate image interpolation ? hmm.)
>
> cheers
> -- denis
>
> 
From: Angus M. <am...@gm...> - 2009年07月23日 11:40:16
2009年7月23日 Angus McMorland <am...@gm...>:
> 2009年7月23日 Nicolas <nic...@gm...>:
>> Hi all
>>
>> I was wondering if anyone managed to find / install Basemap on a i386
>> machine running ubuntu 9.04 (Jaunty Jackalope) ...
>>
>> I've installed the debs through synaptic, and I've tried without
>> success to compile
>> Basemap (0.99), with failure at the libgeos compilation. Trying to
>> install "old" .deb (python-basemap_0.99-0ads1_i386.deb) complains
>> about python 2.6
>>
>> do I have to redo all the installation (numpy etc) using an older python (2.5) ?
>
> No. I have basemap 0.99.3 working with python 2.6 under Jaunty. What's
> the compilation error you're getting? I can't immediately remember how
> I did it (although it was not that long ago), but we can rework it
> out.
Found it, I think. I followed some instructions here [1], which are
copied below:
$ sudo apt-get install python-matplotlib python-numpy libgeos-dev
python-httplib2 python-imaging python-dev
$ tar xvfz basemap-0.99.2.tar.gz
$ cd basemap-0.99.2/
$ sudo checkinstall sudo python setup.py install
I hope that helps,
Angus.
-- 
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh
From: Angus M. <am...@gm...> - 2009年07月23日 11:29:42
2009年7月23日 Nicolas <nic...@gm...>:
> Hi all
>
> I was wondering if anyone managed to find / install Basemap on a i386
> machine running ubuntu 9.04 (Jaunty Jackalope) ...
>
> I've installed the debs through synaptic, and I've tried without
> success to compile
> Basemap (0.99), with failure at the libgeos compilation. Trying to
> install "old" .deb (python-basemap_0.99-0ads1_i386.deb) complains
> about python 2.6
>
> do I have to redo all the installation (numpy etc) using an older python (2.5) ?
No. I have basemap 0.99.3 working with python 2.6 under Jaunty. What's
the compilation error you're getting? I can't immediately remember how
I did it (although it was not that long ago), but we can rework it
out.
Angus.
-- 
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh
From: Nicolas <nic...@gm...> - 2009年07月23日 10:44:50
Hi all
I was wondering if anyone managed to find / install Basemap on a i386
machine running ubuntu 9.04 (Jaunty Jackalope) ...
I've installed the debs through synaptic, and I've tried without
success to compile
Basemap (0.99), with failure at the libgeos compilation. Trying to
install "old" .deb (python-basemap_0.99-0ads1_i386.deb) complains
about python 2.6
do I have to redo all the installation (numpy etc) using an older python (2.5) ?
thanks for any advice
-- 
_/\/ ̄ ̄ ̄ ̄ ̄ ̄\/\_ 33o49'45.24"S & 18o28'45.60"E
Dr. Nicolas Fauchereau
Senior Researcher
CSIR - NRE
Research Group: Ocean systems and climate
15 Lower Hope street, Rosebank 7700
South Africa
_/\/ ̄ ̄ ̄ ̄ ̄ ̄\/\_ 33o49'45.24"S & 18o28'45.60"E
From: Nicolas <nic...@gm...> - 2009年07月23日 10:38:07
-- 
_/\/ ̄ ̄ ̄ ̄ ̄ ̄\/\_ 33o49'45.24"S & 18o28'45.60"E
Dr. Nicolas Fauchereau
Senior Researcher
CSIR - NRE
Research Group: Ocean systems and climate
15 Lower Hope street, Rosebank 7700
South Africa
_/\/ ̄ ̄ ̄ ̄ ̄ ̄\/\_ 33o49'45.24"S & 18o28'45.60"E
From: plankton <and...@dl...> - 2009年07月23日 10:22:04
plankton wrote:
> 
> Greetings all,
> 
> I rotate a vector field and than I tried to interpolate it to a new grid
> using griddata. 
> 
> CODE:
> 
> x_grid_unique = unique(x_grid)
> y_grid_unique = unique(y_grid)
> x_meshgrid, y_meshgrid = meshgrid(x_grid_unique, y_grid_unique)
> x_rot_meshgrid = reshape(x_rot, [ len(x_meshgrid[:, 0]),
> len(x_meshgrid[0, :])] )
> y_rot_meshgrid = reshape(y_rot, [ len(x_meshgrid[:, 0]),
> len(x_meshgrid[0, :])] )
> u_rot_meshgrid = reshape(u_rot, [ len(x_meshgrid[:, 0]),
> len(x_meshgrid[0, :])] )
> v_rot_meshgrid = reshape(v_rot, [ len(x_meshgrid[:, 0]),
> len(x_meshgrid[0, :])] )
> u_interpolate = griddata(x_rot, y_rot, u_rot, x_rot_meshgrid, 
> y_rot_meshgrid)
> v_interpolate = griddata(x_rot, y_rot, v_rot, x_rot_meshgrid, 
> y_rot_meshgrid)
> 
> 
> 
> I unfortunately griddata returns some nan (It seems that there are
> multiple occurrences of the same [X,Y] pair in the data). In matlab you
> can use griddata with additional options e.g. ru =
> griddata(nx,ny,nu,rx,ry,'linear', {'QJ'}) to fix this, but this seems to
> be not possible using the griddata function in matplotlib. Is there any
> other way to avoid a return of nan?
> 
> For any help many thanks in advance
> 
> Andreas
> 
> 
> 
> 
Problem solved more or less. Griddata produces only at the boundary of the
vector field nan, which seems to be the result of my data matrixes u and v.
They contain serveral colums and rows with zeros at the boundary, which
leads to nan at the boundary. Finaly this is not a great problem and can be
fixed easily by adding zeros at the boundary after using griddata. 
But maybe this can be fixed otherwise e.g. using griddata with parameters,
so that it is not necessary to fix the matrix by rewriting the boundary.
Therefore, following a sample script, which demonstrates the problem. 
SAMPLE SCRIPT
--CODE--
from pylab import *
def rotate(x, y, angle):
 x_rot = x * cos(angle) - y * sin(angle)
 y_rot = x * sin(angle) + y * cos(angle)
 return x_rot, y_rot 
 
def generate_new_grid(x_rot, y_rot, x_elements, y_elements):
 xmin = min(x_rot)
 xmax = max(x_rot) 
 ymin = min(y_rot)
 ymax = max(y_rot) 
 x = linspace(xmin, xmax, x_elements)
 y = linspace(ymin, ymax, y_elements)
 x_tecplot_vector = zeros(25, float)
 y_tecplot_vector = zeros(25, float)
 for i in range(5):
 first = i *5
 last = (i+1) * 5
 x_tecplot_vector[first:last] = x
 y_tecplot_vector[first:last] = y[i]
 return x_tecplot_vector, y_tecplot_vector 
# ###################################
u = zeros(25, float)
u[12] = 1
v = zeros(25, float)
v[11] = 2
x = zeros(5, float)
y = zeros(5, float)
x = linspace(1, 5, 5)
y = linspace(1, 5, 5)
x_grid, y_grid= generate_new_grid(x, y, 5, 5)
print y_grid
# ###################################
angle = 0.1
x_rot, y_rot = rotate(x_grid, y_grid, angle)
x_elements = 5 
y_elements = 5
x_grid, y_grid= generate_new_grid(x_rot, y_rot, x_elements, y_elements)
u_rot, v_rot = rotate(u, v, angle)
x_meshgrid, y_meshgrid = meshgrid(x_grid, y_grid)
x_rot_meshgrid = reshape(x_grid, [ 5, 5] )
y_rot_meshgrid = reshape(y_grid, [ 5, 5] )
u_rot_meshgrid = reshape(u_rot, [ 5, 5] )
u_interpolate = griddata(x_rot, y_rot, u_rot, x_rot_meshgrid, 
y_rot_meshgrid)
#save('test.dat', u_interpolate)
print u_interpolate
--CODE--
-- 
View this message in context: http://www.nabble.com/griddata-returns-nan-tp24537481p24623042.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: davide l. <las...@gm...> - 2009年07月23日 06:46:58
Yes,
That did it. The partition had to be mounted with option
execin /etc/fstab!!
Thanks.
Cheers
Davide
Ah, thanks!
On Thu, Jul 23, 2009 at 12:18 PM, John Hunter<jd...@gm...> wrote:
> bar width or 1.0 corresponds to 1 day. The default width to the bar
> command is 0.8, which is too thin for months, just right for days, and
> too wide for hours. Eg, for hours do
>
> bar(x, y, width=0.8*1/24.) # width is 0.8 hours
>
> for months, do something like
>
> bar(x, y, width=0.8*30/24.) # width approx 80% of a month
It would be nice for the documentation to say something like "width:
	the widths of the bars as a proportion of the width of 1 day" instead
of "width: 	the widths of the bars"
Nick
From: per f. <per...@gm...> - 2009年07月23日 03:01:14
hi all,
i'm trying to find the function for the pdf of a multivariate normal pdf. i
know that multivariate_normal can be used to sample from the multivariate
normal distribution, but i just want to get the pdf for a given vector of
means and a covariance matrix. is there a function to do this?
thank you.
On Tue, Jul 21, 2009 at 8:00 PM, Nick Seow<nic...@gm...> wrote:
> Hi,
>
> I'm worried that I'm doing something stupid, but can't quite spot it.
>
> testBarCharts() :- X axis in integers. Works fine.
> testBarChartsDTMonths() :- X axis in datetimes, 1 month between data
> points. Works fine
> testBarChartsDTHours() :- X axis in datetimes, 1 hour between data
under the hood, mpl converts datetime objects to days since 1/1/0000,
using a floating point representation for fractions of a day. So a
bar width or 1.0 corresponds to 1 day. The default width to the bar
command is 0.8, which is too thin for months, just right for days, and
too wide for hours. Eg, for hours do
 bar(x, y, width=0.8*1/24.) # width is 0.8 hours
for months, do something like
 bar(x, y, width=0.8*30/24.) # width approx 80% of a month
Perhaps bar should take a width=None arg and try to infer the ideal
with, eg assuming even spacing, but for now you need to specify the
width in fractional days when making bar plots with datetimes.
JDH
From: John H. <jd...@gm...> - 2009年07月23日 02:12:55
On Tue, Jul 21, 2009 at 3:32 PM, Barnette, Daniel W<dw...@sa...> wrote:
> I've written a python gui to matplotlib which allows the user to plot either cartesian, semi-log, or log-log plots. Log plots can be generated for typical base values except for base 2. Is this a bug, or is there some reason that matplotlib does not do log plots using base 2?
Can you post an example which shows your problem? The following works for me:
 In [14]: x, y = np.random.rand(2, 100)
 In [15]: loglog(x, y, basex=2)
 Out[15]: [<matplotlib.lines.Line2D object at 0x11a1a2d0>]
JDH
From: John H. <jd...@gm...> - 2009年07月23日 01:59:40
On Wed, Jul 22, 2009 at 8:50 PM, Ryan May<rm...@gm...> wrote:
> I'm willing to. However, I just noticed that with just the pylab_import_all
> 0, you get the import numpy as np and import matplotlib.pyplot as plt
> automatically. Also, nicely, these don't show up when you type 'whos'. This
> is with ipython 0.9.1. Should I just add the pylab_import_all 0 to the FAQ?
Should be enough, but it would be nice to have a little bit on how to
write a profile to add extra imports (eg scipy as sp) to an ipython
profile and load it in the same FAQ. Yes, they could find it reading
the ipython docs, but the easier it is to get the info the more useful
it will be.
From: Ryan M. <rm...@gm...> - 2009年07月23日 01:51:03
On Wed, Jul 22, 2009 at 8:34 PM, John Hunter <jd...@gm...> wrote:
> On Wed, Jul 22, 2009 at 8:04 PM, Ryan May<rm...@gm...> wrote:
> > On Wed, Jul 22, 2009 at 6:09 PM, Christopher Barker <
> Chr...@no...>
> > wrote:
> >>
> >> Hi folks,
> >>
> >> Does anyone know if there is a way to use ipython with the advantages of
> >> the -pylab option (separate gui thread, etc.), but without the whole
> >> pylab namespace getting sucked in?
> >
> > Put this in your ~/.ipython/ipythonrc:
> >
> > pylab_import_all 0
> >
> > That gives you exactly what you want. In my case, I also made a profile
> > that imports numpy as np and matplotlib.pyplot as plt, so that I can get
> the
> > equivalent of the ease pylab without the pollution.
>
> Hey Ryan -- could you write up a sphinx/rest FAQ that describes all
> these steps in detail, eg how you create the profile and how you start
> ipython, so we can add it to the site docs? If you are uncomfortable
> with the docs, I can apply the patch.
I'm willing to. However, I just noticed that with just the pylab_import_all
0, you get the import numpy as np and import matplotlib.pyplot as plt
automatically. Also, nicely, these don't show up when you type 'whos'. This
is with ipython 0.9.1. Should I just add the pylab_import_all 0 to the FAQ?
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from Norman, Oklahoma, United States
From: Eric F. <ef...@ha...> - 2009年07月23日 01:42:27
Johan Carlin wrote:
> Hi all,
> 
> I have just migrated from Matlab to Scipy. Matplotlib has been great so 
> far. However, I have some trouble getting imshow to behave like Matlab's 
> image function.
> 
> If you do image(eye(8)) in matlab, you get this:
> 
> http://www.flickr.com/photos/phineasgage/3746211714/
> 
> If you do imshow(eye(8)) in matplotlib, you get this:
> 
> http://www.flickr.com/photos/phineasgage/3745417651/
> 
> How do I get matplotlib to stop interpolating or blurring the borders in 
> the image? I have tried setting interpolation=None (the default 
> behaviour), but this has no effect.
interpolation='nearest'
Eric
> 
> I use matplotlib-0.98.5.2n2 as part of the Enthought distro on Red Hat 4 
> Linux. Any help would be greatly appreciated.
> 
> Johan
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John H. <jd...@gm...> - 2009年07月23日 01:40:15
On Wed, Jul 22, 2009 at 8:04 PM, Ryan May<rm...@gm...> wrote:
> On Wed, Jul 22, 2009 at 6:09 PM, Christopher Barker <Chr...@no...>
> wrote:
>>
>> Hi folks,
>>
>> Does anyone know if there is a way to use ipython with the advantages of
>> the -pylab option (separate gui thread, etc.), but without the whole
>> pylab namespace getting sucked in?
>
> Put this in your ~/.ipython/ipythonrc:
>
> pylab_import_all 0
>
> That gives you exactly what you want. In my case, I also made a profile
> that imports numpy as np and matplotlib.pyplot as plt, so that I can get the
> equivalent of the ease pylab without the pollution.
Hey Ryan -- could you write up a sphinx/rest FAQ that describes all
these steps in detail, eg how you create the profile and how you start
ipython, so we can add it to the site docs? If you are uncomfortable
with the docs, I can apply the patch.
Thanks
JDH
From: Ryan M. <rm...@gm...> - 2009年07月23日 01:05:20
On Wed, Jul 22, 2009 at 6:09 PM, Christopher Barker
<Chr...@no...>wrote:
> Hi folks,
>
> Does anyone know if there is a way to use ipython with the advantages of
> the -pylab option (separate gui thread, etc.), but without the whole
> pylab namespace getting sucked in?
Put this in your ~/.ipython/ipythonrc:
pylab_import_all 0
That gives you exactly what you want. In my case, I also made a profile
that imports numpy as np and matplotlib.pyplot as plt, so that I can get the
equivalent of the ease pylab without the pollution.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from Norman, Oklahoma, United States
From: dpo <dom...@gm...> - 2009年07月23日 00:38:35
Hello,
I am running Matplotlib 0.98.6svn compiled from source on OSX and Sphinx
0.6.2. I am trying the following example to test plot_directive
.. plot::
 from numpy import linspace, sin
 import matplotlib.pylab as plt
 x = linspace(0.01,25, 10000)
 plt.plot(x, sin(x)/x)
 plt.show()
When I 'make html', I get the warning messages:
/Users/dpo/local/dev/pyorder/doc/source/pymc60.rst:: WARNING: image file not
readable: build/plot_directive/inline/2d6f2be741.png
/Users/dpo/local/dev/pyorder/doc/source/pymc60.rst:: WARNING: image file not
readable: build/plot_directive/inline/2d6f2be741.pdf
and the plot is not embedded in my html page. The links 'hires.png' and
'pdf' do point to (readable) images, though. From build/html:
$ ls -l plot_directive/inline/
total 104
-rw-r--r-- 1 dpo dpo 41347 22 Jul 20:01 2d6f2be741.hires.png
-rw-r--r-- 1 dpo dpo 7370 22 Jul 20:01 2d6f2be741.pdf
Strangely, there is no 'png' link even though my conf.py specifies
plot_formats = ['png', 'hires.png', 'pdf']
If I look at the generated html, I notice that the "img" tag wants the png,
which doesn't exist. That is one problem.
The other problem is that the "img" tag searches for the png file in
build/plot_directive/inline/, which does not exist either.
The same happens in the LaTeX output. When I 'make latex' followed by 'make
all-pdf' from build/latex, I get the error message:
LaTeX Warning: File `build/plot_directive/inline/2d6f2be741.pdf' not found
on input line 499.
!pdfTeX error: pdflatex (file build/plot_directive/inline/2d6f2be741.pdf):
cannot find image file
 ==> Fatal error occurred, no output PDF file produced!
Indeed, the image files are in plot_directive/inline/ and not in
build/plot_directive/inline/. Changing the path in the .tex solves the
problem.
Thanks in advance,
Dominique
-- 
View this message in context: http://www.nabble.com/Help-with-plot_directive-tp24617359p24617359.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Showing 25 results 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 によって変換されたページ (->オリジナル) /