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

Showing results of 295

<< < 1 .. 3 4 5 6 7 .. 12 > >> (Page 5 of 12)
From: Dante P. <by...@gm...> - 2009年02月23日 02:44:03
Hi Eric,
first of all thank you for your reply.
My problem is so simple that it is diffucult to explain :)
may be pictures speak better than me.
Let me show you 2 simple pictures and you'll understand:
this is what i want to do: (done with excel)
http://89.96.100.40/~dante/wish.png
(2 simple bars centered in a short enough x axis)
and this is what i have with matplotlib:
http://89.96.100.40/~dante/hist.png
Thank you again for your time,
dp
2009年2月23日 Eric Firing <ef...@ha...>:
> Dante Plicato wrote:
>>
>> Hi all,
>> i just want to have a simple 2-bar histogram,
>> and my problem is that i want my axis to be with NON-squared aspect,
>> i.e. the y-axes automatically scaled (and this yet works this way),but
>> the x-axis to be as long as it need to display 2 little bars.
>> Instead i get a squared graph with 2 big bars.
>> I also tried using something like "plt.axis([0,1,0,mymax*1.2])",
>> changing the second value, but this affects the scale and NOT my
>> picture aspect ratio.
>
> I'm sorry; I haven't been able to figure out what you want the plot to look
> like, and I suspect others on the list may be having the same problem.
>
> When you describe the bars as "big" or "little", are you referring to width?
> Height? spacing?
>
> When I run your script, I don't see anything that I would describe as
> "squared aspect". What physical dimensions would you like the axes to have,
> and what physical dimensions would you like the bars to have?
>
> Maybe you can make a sketch using characters to show what you
> want the plot to look like, e.g.,
>
> ___________________
> | |
> | ____ |
> | | | ____ |
> | | | | | |
> -------------------
>
> Also, is there a reason you are using two calls to "bar" instead of one?
> Note that arguments such as color can be sequences.
>
> Eric
>
>>
>>
>> This is my simploe source:
>>
>> import numpy as np
>> import matplotlib
>> import matplotlib.pyplot as plt
>>
>> N = 1
>> ind = np.arange(N)
>> width = 0.05
>>
>> rects2 = plt.bar(ind+width, 100, width, color='g')
>> rects1 = plt.bar(ind, 200, width, color='b')
>>
>> I tried many things, figsize, axis.. i have no idea,
>> probably because i'm new to matplotlib programming
>>
>> Thank you very much for any help,
>> my best
>>
>>
>> ------------------------------------------------------------------------------
>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
>> CA
>> -OSBC tackles the biggest issue in open source: Open Sourcing the
>> Enterprise
>> -Strategies to boost innovation and cut costs with open source
>> participation
>> -Receive a 600ドル discount off the registration fee with the source code:
>> SFAD
>> http://p.sf.net/sfu/XcvMzF8H
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jae-Joon L. <lee...@gm...> - 2009年02月23日 02:40:31
I think the error is raised when you try to import matplotlib (not
when you try to save your figure)
matplotlib needs its config directory writable.
It first try MPLCONFIGDIR env. variable, then try $HOME/.matplotlib.
Here, the $HOME is the home directory of the user executing the script.
I think it would be better to set MPLCONFIGDIR env. variable (it
should be env. variable, not rcparams) instead of HOME.
The directory referred by MPLCONFIGDIR must exist.
Unfortunately, I'm not an expert on apache and I can't tell you which
is the best way to set the env. variable.
-JJ
On Fri, Feb 20, 2009 at 4:50 PM, bpklmd <rp...@re...> wrote:
>
> I have searched the web for a solution to the following problem and nothing
> works.
>
>
> I call matplotlib code from a python script (2.5) running on Apache2.2 and
> mod_python. When I get to the point where I the code is to save a figure in
> the website dir I get the following error.
>
> File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 324, in
> _get_configdir
> raise RuntimeError("'%s' is not a writable dir; you must set environment
> variable HOME to be a writable dir "%h)
>
> RuntimeError: '/root' is not a writable dir; you must set environment
> variable HOME to be a writable dir
>
> The code that creates the fig is a follows:
>
> import matplotlib
> from matplotlib import pylab as plt
> import numpy as np
>
> matplotlib.use('AGG') # use a nongui backend
> matplotlib.rdParams['MPLCONFIGDIR']='/var/www/modtest/'
> ...
> plot code here
> ...
>
> plt.savefig('/var/www/modtest/plot_data/' + plotfile[0]) # use 1st
> generated random file name
>
> First can anyone tell me what "HOME" variable the error message is referring
> to?
> I have changed the $HOME env variable under linux Ubuntu Gutsy
> I have added a $HOME variable to httpd.conf, however I am not an
> experienced Apache user
> I can get the code to work from the interactive.py shell
>
>
>
> rlp
> --
> View this message in context: http://www.nabble.com/Problems-with-saving-figure-from-within-mod_python-script-tp22129192p22129192.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a 600ドル discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Eric F. <ef...@ha...> - 2009年02月23日 02:12:48
Dante Plicato wrote:
> Hi all,
> i just want to have a simple 2-bar histogram,
> and my problem is that i want my axis to be with NON-squared aspect,
> i.e. the y-axes automatically scaled (and this yet works this way),but
> the x-axis to be as long as it need to display 2 little bars.
> Instead i get a squared graph with 2 big bars.
> I also tried using something like 	"plt.axis([0,1,0,mymax*1.2])",
> changing the second value, but this affects the scale and NOT my
> picture aspect ratio.
I'm sorry; I haven't been able to figure out what you want the plot to 
look like, and I suspect others on the list may be having the same problem.
When you describe the bars as "big" or "little", are you referring to 
width? Height? spacing?
When I run your script, I don't see anything that I would describe as 
"squared aspect". What physical dimensions would you like the axes to 
have, and what physical dimensions would you like the bars to have?
Maybe you can make a sketch using characters to show what you
want the plot to look like, e.g.,
___________________
| |
| ____ |
| | | ____ |
| | | | | |
-------------------
Also, is there a reason you are using two calls to "bar" instead of one? 
Note that arguments such as color can be sequences.
Eric
> 
> 
> This is my simploe source:
> 
> import numpy as np
> import matplotlib
> import matplotlib.pyplot as plt
> 
> N = 1
> ind = np.arange(N)
> width = 0.05
> 
> rects2 = plt.bar(ind+width, 100, width, color='g')
> rects1 = plt.bar(ind, 200, width, color='b')
> 
> I tried many things, figsize, axis.. i have no idea,
> probably because i'm new to matplotlib programming
> 
> Thank you very much for any help,
> my best
> 
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a 600ドル discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jae-Joon L. <lee...@gm...> - 2009年02月23日 02:03:17
What version of maploltib are you using?
Your data displayed with correct scale with my installation of
matplotlib 0.98.5.2.
By the way, you're chaning the axes limit of the wrong axes.
"matplotlib.pyplot.axes()" create a new axes.
Use plt.xlim (or plt.ylim for y-limit), or use the method of the existing axes.
-JJ
On Thu, Feb 19, 2009 at 8:22 PM, Nash, Brent R
<bre...@jp...> wrote:
> Hey everyone,
>
> I'm fairly new to matplotlib, but have read through tons of the
> documentation today and have a decent understanding of it. All the
> auto-scaling, xlim, and x_bound stuff works fine for me with the examples,
> but as soon as I try to use it on my data, it's not working for me. I've
> attached a demo script, 2 input files of data, and a PNG showing the
> resulting chart I get. The numbers on my Y-axis range from 7656 to 59928 (a
> difference of 52272) and the numbers on my X-axis range from
> 1.22896144017e+12 to 1.22896155012e+12 (a difference of 109950).
>
> The plot should look like a monotonically increasing line, but the resulting
> plot always comes out looking like a vertical line. I realize that the plot
> is actually correct, the problem is the default scaling on the ouptut. The
> easy way to justify this to yourself is to take the line "ert = float(i)" in
> the script and replace it with "ert = float(i) - 1228960000000" to reduce
> the ert #'s to a manageable size and then everything plots very nicely. The
> data is all linear, not logarithmic or anything, so I don't think writing a
> custom scaler is the solution.
>
> I left commented out sections in my script of all the different methods I've
> tried to scale this thing. I've tried all permutations I could think of for
> the following functions:
>
> matplotlib.pyplot.axes().autoscale_view(...)
> matplotlib.pyplot.axes().set_xbound(...)
> matplotlib.pyplot.axes().set_xlim(...)
> matplotlib.pyplot.axes().set_aspect(...)
> matplotlib.pyplot.axis(...)
> matplotlib.pyplot.axes().set_xscale(...)
>
> Can anyone catch what I'm doing wrong here? I'm hoping it's just something
> obvious due to my unfamiliarity with the tool.
>
> Is there any way to write my own custom autoscale algorithm?
>
> Thanks very much for your time/help!
>
> ~Brent
>
> PS ~ Here's my OS info:
>
> MacBook Pro Laptop
> Mac O X 10.5.6
> 2.6 GHz Intel Core 2 Duo
> 4GB 667 MHz DDR2 SDRAM
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a 600ドル discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Dante P. <by...@gm...> - 2009年02月22日 23:42:59
Hi all,
i just want to have a simple 2-bar histogram,
and my problem is that i want my axis to be with NON-squared aspect,
i.e. the y-axes automatically scaled (and this yet works this way),but
the x-axis to be as long as it need to display 2 little bars.
Instead i get a squared graph with 2 big bars.
I also tried using something like 	"plt.axis([0,1,0,mymax*1.2])",
changing the second value, but this affects the scale and NOT my
picture aspect ratio.
This is my simploe source:
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
N = 1
ind = np.arange(N)
width = 0.05
rects2 = plt.bar(ind+width, 100, width, color='g')
rects1 = plt.bar(ind, 200, width, color='b')
I tried many things, figsize, axis.. i have no idea,
probably because i'm new to matplotlib programming
Thank you very much for any help,
my best
From: Goyo <goy...@gm...> - 2009年02月22日 23:22:48
El sáb, 21-02-2009 a las 16:26 -0800, Daniel Soto escribió:
> i'd like to plot some data, get user input, and then plot the original 
> data and user input. when i try to show() the data i get a segfault 
> after about ten seconds.
> 
> any clue what i'm doing wrong? using mac os x 10.5 with enthought 
> distribution.
> 
> thanks,
> drs
> 
> #!/usr/bin/env python
> 
> import pylab
> 
> x = pylab.arange(0,10,0.1)
> y = pylab.sin(x)
> 
> # plot and get user input, then close fig
> pylab.plot(x,y)
> points = pylab.ginput(2)
> points = pylab.array(points)
> pylab.close()
> 
> # replot with chosen points
> pylab.plot(x,y)
> pylab.plot(points[:,0],points[:,1],'ko')
> pylab.show()
> # wait for it, wait for it...now segfault
Your code works for me in Ubuntu 8.10, mpl 0.98.5.2 (Debian package!)
and GTKAgg backend.
Goyo
From: Wai Y. T. <tun...@ya...> - 2009年02月22日 23:00:08
Hello all,
I find that Matplotlib only have Python 2.5 build for Windows. Is there 
any plan to release a 2.6 build soon? I am trying to build it from source 
but I run into numerous problem. I am still struggling to find all 
dependent packages. It will help a lot if the 2.6 installer is available.
Thanks,
Wai Yip
From: Thomas R. <tho...@gm...> - 2009年02月22日 22:47:55
Hi Eric,
I'm using matplotlib 0.98 (which comes with the Enthought distribution) 
so that would explain why there was an issue.
Thanks for your help!
Thomas
Eric Firing wrote:
> Thomas Robitaille wrote:
>> Hi Eric,
>>
>> Thanks for your help! Unfortunately, ax.set_autoscale_on(False) does
>> not work - I had already tried this before unsuccessfully. Consider
>> the following:
>>
>> from pylab import *
>> import numpy as np
>>
>> def test():
>> fig = figure()
>> ax = fig.add_subplot(111)
>> a = np.zeros((100,100))
>> b = np.zeros((10,10))
>> ax.imshow(a)
>> ax.set_autoscale_on(False)
>> ax.contour(b)
>> fig.canvas.draw()
>>
>> Running test() should result in a subplot with the view interval 0 to
>> 99, but instead goes from 0 to 9.
>>
>> Is this normal?
>
> On my system, it does go from 0-99. What mpl version are you using? I
> made the change to using autoscale_view in the ContourSet initializer,
> which obeys the setting by set_autoscale_on, on November 17. Prior to
> that, xlim and ylim were being set directly, so the workaround if you
> have an earlier version would be to save those values (using
> ax.get_xlim(), ax.get_ylim()) and then restore them with ax.set_xlim etc.
>
> Eric
>
>>
>> Thanks,
>>
>> Thomas
>>
>> Eric Firing wrote:
>>> Thomas Robitaille wrote:
>>>> Hello,
>>>>
>>>> I am using matplotlib to show an image using:
>>>>
>>>> fig = figure()
>>>> ax = fig.add_subplot(111)
>>>> ax.imshow(image)
>>>>
>>>> After doing this, I want to find the contours for a different image
>>>> (with different dimensions), but I do not want to interact with the
>>>> current figure or axes, I just want to retrieve the set of
>>>> LineCollection objects for the contours. The issue is that if I do
>>>>
>>>> c = contour(image2)
>>>>
>>>> the contours are stored inside c, but at the same time they are
>>>> plotted in the current figure. If I use
>>>>
>>>> ax.contour(image2)
>>>>
>>>> then the contours are not plotted immediately, but the view interval
>>>> has already been changed inside ax.
>>>
>>> The workaround for now may be to call ax.set_autoscale_on(False) before
>>> your call to ax.contour. You could also save the datalim before and
>>> restore them afterwards.
>>>
>>> This sort of request has come up before, though, and the longer-term
>>> solution might be some refactoring in contour.py. As it is, everything
>>> is done when the ContourSet is instantiated; one does not have the
>>> option of simply calculating the contours, for example.
>>>
>>> Eric
>>>
>>>>
>>>> So essentially, I am wondering if it is possible to retrieve a set of
>>>> LineCollection objects without acting in any way on the current
>>>> figure/axes.
>>>
>>>>
>>>> Thanks for any help,
>>>>
>>>> Thomas
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>>
>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San
>>>> Francisco, CA
>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the
>>>> Enterprise
>>>> -Strategies to boost innovation and cut costs with open source
>>>> participation
>>>> -Receive a 600ドル discount off the registration fee with the source
>>>> code: SFAD
>>>> http://p.sf.net/sfu/XcvMzF8H
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>
From: Eric F. <ef...@ha...> - 2009年02月22日 22:45:50
Thomas Robitaille wrote:
> Hi Eric,
> 
> Thanks for your help! Unfortunately, ax.set_autoscale_on(False) does not 
> work - I had already tried this before unsuccessfully. Consider the 
> following:
> 
> from pylab import *
> import numpy as np
> 
> def test():
> fig = figure()
> ax = fig.add_subplot(111)
> a = np.zeros((100,100))
> b = np.zeros((10,10))
> ax.imshow(a)
> ax.set_autoscale_on(False)
> ax.contour(b)
> fig.canvas.draw()
> 
> Running test() should result in a subplot with the view interval 0 to 
> 99, but instead goes from 0 to 9.
> 
> Is this normal?
On my system, it does go from 0-99. What mpl version are you using? I 
made the change to using autoscale_view in the ContourSet initializer, 
which obeys the setting by set_autoscale_on, on November 17. Prior to 
that, xlim and ylim were being set directly, so the workaround if you 
have an earlier version would be to save those values (using 
ax.get_xlim(), ax.get_ylim()) and then restore them with ax.set_xlim etc.
Eric
> 
> Thanks,
> 
> Thomas
> 
> Eric Firing wrote:
>> Thomas Robitaille wrote:
>>> Hello,
>>>
>>> I am using matplotlib to show an image using:
>>>
>>> fig = figure()
>>> ax = fig.add_subplot(111)
>>> ax.imshow(image)
>>>
>>> After doing this, I want to find the contours for a different image
>>> (with different dimensions), but I do not want to interact with the
>>> current figure or axes, I just want to retrieve the set of
>>> LineCollection objects for the contours. The issue is that if I do
>>>
>>> c = contour(image2)
>>>
>>> the contours are stored inside c, but at the same time they are
>>> plotted in the current figure. If I use
>>>
>>> ax.contour(image2)
>>>
>>> then the contours are not plotted immediately, but the view interval
>>> has already been changed inside ax.
>>
>> The workaround for now may be to call ax.set_autoscale_on(False) before
>> your call to ax.contour. You could also save the datalim before and
>> restore them afterwards.
>>
>> This sort of request has come up before, though, and the longer-term
>> solution might be some refactoring in contour.py. As it is, everything
>> is done when the ContourSet is instantiated; one does not have the
>> option of simply calculating the contours, for example.
>>
>> Eric
>>
>>>
>>> So essentially, I am wondering if it is possible to retrieve a set of
>>> LineCollection objects without acting in any way on the current
>>> figure/axes.
>>
>>>
>>> Thanks for any help,
>>>
>>> Thomas
>>>
>>> ------------------------------------------------------------------------------ 
>>>
>>>
>>> Open Source Business Conference (OSBC), March 24-25, 2009, San
>>> Francisco, CA
>>> -OSBC tackles the biggest issue in open source: Open Sourcing the
>>> Enterprise
>>> -Strategies to boost innovation and cut costs with open source
>>> participation
>>> -Receive a 600ドル discount off the registration fee with the source
>>> code: SFAD
>>> http://p.sf.net/sfu/XcvMzF8H
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
From: Dante P. <by...@gm...> - 2009年02月22日 22:36:17
Hi all,
i just want to have a simple bar-chart,
and my problem is that i want it to be with NON-squared aspect, i.e. the
x-axis to be as long as i need with 2 little bart.
Instead i get a squared graph with 2 big bars even if i change width value.
This is my source:
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
N = 1
ind = np.arange(N)
width = 0.05
rects2 = plt.bar(ind+width, 100, width, color='g')
rects1 = plt.bar(ind, 200, width, color='b')
I tried many things, figsize, axis.. i have no idea,
probably because i'm new to matplotlib programming/
Thank you very much for any help,
my best
dp
From: Thomas R. <tho...@gm...> - 2009年02月22日 22:32:55
Hi Eric,
Thanks for your help! Unfortunately, ax.set_autoscale_on(False) does not 
work - I had already tried this before unsuccessfully. Consider the 
following:
from pylab import *
import numpy as np
def test():
	fig = figure()
	ax = fig.add_subplot(111)
	a = np.zeros((100,100))
	b = np.zeros((10,10))
	ax.imshow(a)
	ax.set_autoscale_on(False)
	ax.contour(b)
	fig.canvas.draw()
Running test() should result in a subplot with the view interval 0 to 
99, but instead goes from 0 to 9.
Is this normal?
Thanks,
Thomas
Eric Firing wrote:
> Thomas Robitaille wrote:
>> Hello,
>>
>> I am using matplotlib to show an image using:
>>
>> fig = figure()
>> ax = fig.add_subplot(111)
>> ax.imshow(image)
>>
>> After doing this, I want to find the contours for a different image
>> (with different dimensions), but I do not want to interact with the
>> current figure or axes, I just want to retrieve the set of
>> LineCollection objects for the contours. The issue is that if I do
>>
>> c = contour(image2)
>>
>> the contours are stored inside c, but at the same time they are
>> plotted in the current figure. If I use
>>
>> ax.contour(image2)
>>
>> then the contours are not plotted immediately, but the view interval
>> has already been changed inside ax.
>
> The workaround for now may be to call ax.set_autoscale_on(False) before
> your call to ax.contour. You could also save the datalim before and
> restore them afterwards.
>
> This sort of request has come up before, though, and the longer-term
> solution might be some refactoring in contour.py. As it is, everything
> is done when the ContourSet is instantiated; one does not have the
> option of simply calculating the contours, for example.
>
> Eric
>
>>
>> So essentially, I am wondering if it is possible to retrieve a set of
>> LineCollection objects without acting in any way on the current
>> figure/axes.
>
>>
>> Thanks for any help,
>>
>> Thomas
>>
>> ------------------------------------------------------------------------------
>>
>> Open Source Business Conference (OSBC), March 24-25, 2009, San
>> Francisco, CA
>> -OSBC tackles the biggest issue in open source: Open Sourcing the
>> Enterprise
>> -Strategies to boost innovation and cut costs with open source
>> participation
>> -Receive a 600ドル discount off the registration fee with the source
>> code: SFAD
>> http://p.sf.net/sfu/XcvMzF8H
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Daniel S. <dan...@gm...> - 2009年02月22日 00:26:50
i'd like to plot some data, get user input, and then plot the original 
data and user input. when i try to show() the data i get a segfault 
after about ten seconds.
any clue what i'm doing wrong? using mac os x 10.5 with enthought 
distribution.
thanks,
drs
#!/usr/bin/env python
import pylab
x = pylab.arange(0,10,0.1)
y = pylab.sin(x)
# plot and get user input, then close fig
pylab.plot(x,y)
points = pylab.ginput(2)
points = pylab.array(points)
pylab.close()
# replot with chosen points
pylab.plot(x,y)
pylab.plot(points[:,0],points[:,1],'ko')
pylab.show()
# wait for it, wait for it...now segfault
From: Daniel S. <ds...@st...> - 2009年02月22日 00:22:15
i'd like to plot some data, get user input, and then plot the original 
data and user input. when i try to show() the data i get a segfault 
after about ten seconds.
any clue what i'm doing wrong? using mac os x 10.5 with enthought 
distribution.
thanks,
drs
#!/usr/bin/env python
import pylab
x = pylab.arange(0,10,0.1)
y = pylab.sin(x)
# plot and get user input, then close fig
pylab.plot(x,y)
points = pylab.ginput(2)
points = pylab.array(points)
pylab.close()
# replot with chosen points
pylab.plot(x,y)
pylab.plot(points[:,0],points[:,1],'ko')
pylab.show()
# wait for it, wait for it...now segfault
From: Ken M. <mc...@ii...> - 2009年02月21日 21:19:47
I've finally been able to update the WxMpl library so it's compatible 
with MPL 0.98:
	http://agni.phys.iit.edu/~kmcivor/wxmpl/downloads/wxmpl-1.3.0.tar.gz
It's been tested on Debian Lenny (Python 2.5.2, MPL 0.98.1, wxPython 
2.6.3.2) and Mac OS 10.5.5 (MacPython 2.5.4, MPL 0.98.1 and 0.98.6svn, 
wxPython 2.8.9.1). Please let me know if you encounter any problems.
My thanks to everyone for the patches and feedback, and for being so 
patient.
Ken
From: Eric F. <ef...@ha...> - 2009年02月21日 19:34:22
Thomas Robitaille wrote:
> Hello,
> 
> I am using matplotlib to show an image using:
> 
> fig = figure()
> ax = fig.add_subplot(111)
> ax.imshow(image)
> 
> After doing this, I want to find the contours for a different image 
> (with different dimensions), but I do not want to interact with the 
> current figure or axes, I just want to retrieve the set of 
> LineCollection objects for the contours. The issue is that if I do
> 
> c = contour(image2)
> 
> the contours are stored inside c, but at the same time they are plotted 
> in the current figure. If I use
> 
> ax.contour(image2)
> 
> then the contours are not plotted immediately, but the view interval has 
> already been changed inside ax.
The workaround for now may be to call ax.set_autoscale_on(False) before 
your call to ax.contour. You could also save the datalim before and 
restore them afterwards.
This sort of request has come up before, though, and the longer-term 
solution might be some refactoring in contour.py. As it is, everything 
is done when the ContourSet is instantiated; one does not have the 
option of simply calculating the contours, for example.
Eric
> 
> So essentially, I am wondering if it is possible to retrieve a set of 
> LineCollection objects without acting in any way on the current figure/axes.
> 
> Thanks for any help,
> 
> Thomas
> 
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a 600ドル discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Thomas R. <tho...@gm...> - 2009年02月21日 14:00:47
Hello,
I am using matplotlib to show an image using:
fig = figure()
ax = fig.add_subplot(111)
ax.imshow(image)
After doing this, I want to find the contours for a different image 
(with different dimensions), but I do not want to interact with the 
current figure or axes, I just want to retrieve the set of 
LineCollection objects for the contours. The issue is that if I do
c = contour(image2)
the contours are stored inside c, but at the same time they are plotted 
in the current figure. If I use
ax.contour(image2)
then the contours are not plotted immediately, but the view interval has 
already been changed inside ax.
So essentially, I am wondering if it is possible to retrieve a set of 
LineCollection objects without acting in any way on the current figure/axes.
Thanks for any help,
Thomas
From: Nils W. <nw...@ia...> - 2009年02月21日 10:22:04
Attachments: truss.png
Hi all,
I have written a small program for optimization of truss 
structures. The design variables are the cross sectional
areas of the truss elements (attached figure).
One way to visualize the results is to use the linewidth
as a parameter.
Is it also possible to use different ("continuous") colors 
corresponding to the values of the design variables ?
 
Any pointer would be appreciated.
Thanks in advance.
Nils
Postprocessing
from scipy import io, set_printoptions
from numpy import zeros, arange, outer, identity, loadtxt, 
ones, shape, dot, r_, where, min, max
set_printoptions(precision=4,linewidth=150)
from pylab import spy, show, plot, subplot, figure, 
imshow, scatter, title, text, annotate, xlabel, ylabel, 
savefig
from scipy.linalg import eigh, norm, solve
#
# Visualization of the
# results of a sizing optimization problem
#
N = 45 # Number of nodes
nele = 136 # Number of elements
coord = 
loadtxt('coord.inp',comments='#',usecols=(1,2)).astype(float)
inz = 
loadtxt('connect.inp',comments='#',usecols=(1,2)).astype(int)
cross = loadtxt('crossopt.dat')
cross_max = max(cross)
cross_min = min(cross)
a = 1.9/(cross_max-cross_min)
b = 2.-a*cross_max
def model(cross):
 """ Model plot """
 scatter(coord[:,0],coord[:,1])
 title('Plane truss structure')
 for iele in arange(0,nele):
 p_j = coord[inz[iele,1]-1]
 p_i = coord[inz[iele,0]-1]
 linewidth = a*cross[iele]+b
 print iele, linewidth
 plot 
(r_[p_i[0],p_j[0]],r_[p_i[1],p_j[1]],'r-',lw=linewidth)
 xlabel('$x$')
 ylabel('$y$')
model(cross)
savefig('truss')
show()
From: C M <cmp...@gm...> - 2009年02月21日 09:15:12
Hi, I have two picking questions. First, If I do this inside a pick
handler function:
def OnPick(self, event):
 if isinstance(event.artist, Line2D):
 thisline = event.artist
 xdata = thisline.get_xdata()
 ydata = thisline.get_ydata()
I can grab the data from a line. Fine.
Now I'd like to do two things:
1) WIthin this same pick handler function, have another if conditional,
but for the case when the user is picking the legend. In other words, I
want to pick the legend artist, not a Line2D artist.
2) Modify the above so the user can pick only the actual points on a line,
but not the connecting line if I have plotted it like 'o-' style (connected
points).
I hope this is clear. Any help is appreciated. Thanks.
Che
From: Eric F. <ef...@ha...> - 2009年02月21日 01:07:16
Jeff Whitaker wrote:
> Armin Moser wrote:
>> Jeff Whitaker wrote:
>> 
>>> Armin Moser wrote:
>>> 
>>>> Hi,
>>>>
>>>> I would like to interpolate an array of shape (801,676) to regularily
>>>> spaced datapoints using griddata. This interpolation is quick if the
>>>> (x,y) supporting points are computed as X,Y = meshgrid(x,y). If this
>>>> condition is not fullfilled the delaunay triangulation is extremely
>>>> slow, i.e. not useable. Is this a known property of the used
>>>> triangulation? The triangulation can be performed with matlab without
>>>> any problems.
>>>>
>>>> Armin
>>>> 
>>>> 
>>> Armin: You could try installing the natgrid toolkit and see if that
>>> speeds up griddata at all. If not, please post a test script with data
>>> and maybe we can figure out what is going on.
>>> 
>> I have already tried natgrid and it didn't improve the situation. As
>> suggested I append a script demonstrating the problem.
Reducing the original grid from 676x801 to 100x120, I get benchmarks of 
about 6 seconds with natgrid and 0.15 s with Robert's delaunay. This 
seems quite repeatable.
I also tried randomizing x and y in the first benchmark with natgrid, 
and it made only a slight difference.
Eric
>>
>> Thanks
>> Armin
>> 
> 
> Armin: On my mac, your two benchmarks take 15 and 14 seconds. Do you 
> consider that too slow?
> 
> Perhaps this is just a toy example to test griddata, but I assume you 
> realize that you wouldn't normally use griddata to interpolate data on 
> one regular grid to another regular grid. griddata is strictly for 
> interpolating scatter data (not on a regular mesh) to a regular mesh.
> 
> -Jeff
>> ------8<-------------
>> from numpy import *
>> from pylab import *
>> import time
>>
>> deg2rad = pi/180.0
>> ai = 0.12*deg2rad
>> x = linspace(13,40,676)
>> y = linspace(10,22,801)
>>
>> x = x*deg2rad
>> y = y*deg2rad
>> [x,y] = meshgrid(x,y)
>> z = (x**2+y**2)
>>
>> xi = linspace(x.min(),x.max(),x.shape[1])
>> yi = linspace(y.min(),y.max(),y.shape[0])
>> tic= time.time()
>> zi = griddata(x.flatten(),y.flatten(),z.flatten(),xi,yi)
>> toc = time.time()
>> print toc-tic
>>
>> fac = 2*pi/1.2681
>> nx = fac * (cos(y)*cos(x) - cos(ai))
>> ny = fac * (cos(y)*sin(x))
>> nz = fac * (sin(y) + sin(ai))
>> np = sqrt(nx**2 + ny**2)
>>
>> z = (np**2+nz**2)*exp(-0.001*nz)
>>
>> xi = linspace(np.min(),np.max(),x.shape[1])
>> yi = linspace(nz.min(),nz.max(),y.shape[0])
>> tic = time.time()
>> zi = griddata(np.flatten(),nz.flatten(),z.flatten(),xi,yi)
>> toc = time.time()
>> print toc-tic
>> 
> 
> 
From: Armin M. <arm...@st...> - 2009年02月20日 23:23:03
Eric Firing wrote:
> Jeff Whitaker wrote:
>> Armin Moser wrote:
>>> Jeff Whitaker wrote:
>>> 
>>>> Armin Moser wrote:
>>>> 
>>>>> Hi,
>>>>>
>>>>> I would like to interpolate an array of shape (801,676) to regularily
>>>>> spaced datapoints using griddata. This interpolation is quick if the
>>>>> (x,y) supporting points are computed as X,Y = meshgrid(x,y). If this
>>>>> condition is not fullfilled the delaunay triangulation is extremely
>>>>> slow, i.e. not useable. Is this a known property of the used
>>>>> triangulation? The triangulation can be performed with matlab without
>>>>> any problems.
>>>>>
>>>>> Armin
>>>>> 
>>>> Armin: You could try installing the natgrid toolkit and see if that
>>>> speeds up griddata at all. If not, please post a test script with data
>>>> and maybe we can figure out what is going on.
>>>> 
>>> I have already tried natgrid and it didn't improve the situation. As
>>> suggested I append a script demonstrating the problem.
>>>
>>> Thanks
>>> Armin
>>> 
>>
>> Armin: On my mac, your two benchmarks take 15 and 14 seconds. Do you
>> consider that too slow?
> 
> I got 10 s and 8 s on my Thinkpad--but that was without natgrid. When I
> installed natgrid, the benchmark was taking so long I killed the window.
Thats the behaviour I observed (on Windows and Linux) with and without
natgrid. I'm very puzzled at the moment.
Thanks a lot
Armin
From: bpklmd <rp...@re...> - 2009年02月20日 23:16:47
I have searched the web for a solution to the following problem and nothing
works.
I call matplotlib code from a python script (2.5) running on Apache2.2 and
mod_python. When I get to the point where I the code is to save a figure in
the website dir I get the following error. 
File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 324, in
_get_configdir
 raise RuntimeError("'%s' is not a writable dir; you must set environment
variable HOME to be a writable dir "%h)
RuntimeError: '/root' is not a writable dir; you must set environment
variable HOME to be a writable dir 
The code that creates the fig is a follows:
import matplotlib
from matplotlib import pylab as plt
import numpy as np
matplotlib.use('AGG') # use a nongui backend
matplotlib.rdParams['MPLCONFIGDIR']='/var/www/modtest/'
...
plot code here
...
plt.savefig('/var/www/modtest/plot_data/' + plotfile[0]) # use 1st
generated random file name
First can anyone tell me what "HOME" variable the error message is referring
to? 
I have changed the $HOME env variable under linux Ubuntu Gutsy
I have added a $HOME variable to httpd.conf, however I am not an
experienced Apache user
I can get the code to work from the interactive.py shell
rlp
-- 
View this message in context: http://www.nabble.com/Problems-with-saving-figure-from-within-mod_python-script-tp22129192p22129192.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Armin M. <arm...@st...> - 2009年02月20日 21:27:21
Jeff Whitaker wrote:
> Armin Moser wrote:
>> Jeff Whitaker wrote:
>> 
>>> Armin Moser wrote:
>>> 
>>>> Hi,
>>>>
>>>> I would like to interpolate an array of shape (801,676) to regularily
>>>> spaced datapoints using griddata. This interpolation is quick if the
>>>> (x,y) supporting points are computed as X,Y = meshgrid(x,y). If this
>>>> condition is not fullfilled the delaunay triangulation is extremely
>>>> slow, i.e. not useable. Is this a known property of the used
>>>> triangulation? The triangulation can be performed with matlab without
>>>> any problems.
>>>>
>>>> Armin
>>>> 
>>> Armin: You could try installing the natgrid toolkit and see if that
>>> speeds up griddata at all. If not, please post a test script with data
>>> and maybe we can figure out what is going on.
>>> 
>> I have already tried natgrid and it didn't improve the situation. As
>> suggested I append a script demonstrating the problem.
>>
>> Thanks
>> Armin
>> 
> 
> Armin: On my mac, your two benchmarks take 15 and 14 seconds. Do you
> consider that too slow?
No definitely not but up to now I always killed the process (after more
than 10 minutes). I tried the script again and it worked... I have to
check the original on monday at work.
> 
> Perhaps this is just a toy example to test griddata, but I assume you
> realize that you wouldn't normally use griddata to interpolate data on
> one regular grid to another regular grid. griddata is strictly for
> interpolating scatter data (not on a regular mesh) to a regular mesh.
Yes I do, but the supporting points of the second example are not on a
regular grid.
Thanks a lot
Armin
From: Eric F. <ef...@ha...> - 2009年02月20日 21:11:04
Jeff Whitaker wrote:
> Armin Moser wrote:
>> Jeff Whitaker wrote:
>> 
>>> Armin Moser wrote:
>>> 
>>>> Hi,
>>>>
>>>> I would like to interpolate an array of shape (801,676) to regularily
>>>> spaced datapoints using griddata. This interpolation is quick if the
>>>> (x,y) supporting points are computed as X,Y = meshgrid(x,y). If this
>>>> condition is not fullfilled the delaunay triangulation is extremely
>>>> slow, i.e. not useable. Is this a known property of the used
>>>> triangulation? The triangulation can be performed with matlab without
>>>> any problems.
>>>>
>>>> Armin
>>>> 
>>>> 
>>> Armin: You could try installing the natgrid toolkit and see if that
>>> speeds up griddata at all. If not, please post a test script with data
>>> and maybe we can figure out what is going on.
>>> 
>> I have already tried natgrid and it didn't improve the situation. As
>> suggested I append a script demonstrating the problem.
>>
>> Thanks
>> Armin
>> 
> 
> Armin: On my mac, your two benchmarks take 15 and 14 seconds. Do you 
> consider that too slow?
Jeff,
I got 10 s and 8 s on my Thinkpad--but that was without natgrid. When I 
installed natgrid, the benchmark was taking so long I killed the window.
I'm running 32-bit Ubuntu.
Eric
> 
> Perhaps this is just a toy example to test griddata, but I assume you 
> realize that you wouldn't normally use griddata to interpolate data on 
> one regular grid to another regular grid. griddata is strictly for 
> interpolating scatter data (not on a regular mesh) to a regular mesh.
> 
> -Jeff
>> ------8<-------------
>> from numpy import *
>> from pylab import *
>> import time
>>
>> deg2rad = pi/180.0
>> ai = 0.12*deg2rad
>> x = linspace(13,40,676)
>> y = linspace(10,22,801)
>>
>> x = x*deg2rad
>> y = y*deg2rad
>> [x,y] = meshgrid(x,y)
>> z = (x**2+y**2)
>>
>> xi = linspace(x.min(),x.max(),x.shape[1])
>> yi = linspace(y.min(),y.max(),y.shape[0])
>> tic= time.time()
>> zi = griddata(x.flatten(),y.flatten(),z.flatten(),xi,yi)
>> toc = time.time()
>> print toc-tic
>>
>> fac = 2*pi/1.2681
>> nx = fac * (cos(y)*cos(x) - cos(ai))
>> ny = fac * (cos(y)*sin(x))
>> nz = fac * (sin(y) + sin(ai))
>> np = sqrt(nx**2 + ny**2)
>>
>> z = (np**2+nz**2)*exp(-0.001*nz)
>>
>> xi = linspace(np.min(),np.max(),x.shape[1])
>> yi = linspace(nz.min(),nz.max(),y.shape[0])
>> tic = time.time()
>> zi = griddata(np.flatten(),nz.flatten(),z.flatten(),xi,yi)
>> toc = time.time()
>> print toc-tic
>> 
> 
> 
From: Jeff W. <js...@fa...> - 2009年02月20日 20:04:17
Armin Moser wrote:
> Jeff Whitaker wrote:
> 
>> Armin Moser wrote:
>> 
>>> Hi,
>>>
>>> I would like to interpolate an array of shape (801,676) to regularily
>>> spaced datapoints using griddata. This interpolation is quick if the
>>> (x,y) supporting points are computed as X,Y = meshgrid(x,y). If this
>>> condition is not fullfilled the delaunay triangulation is extremely
>>> slow, i.e. not useable. Is this a known property of the used
>>> triangulation? The triangulation can be performed with matlab without
>>> any problems.
>>>
>>> Armin
>>> 
>>> 
>> Armin: You could try installing the natgrid toolkit and see if that
>> speeds up griddata at all. If not, please post a test script with data
>> and maybe we can figure out what is going on.
>> 
> I have already tried natgrid and it didn't improve the situation. As
> suggested I append a script demonstrating the problem.
>
> Thanks
> Armin
> 
Armin: On my mac, your two benchmarks take 15 and 14 seconds. Do you 
consider that too slow?
Perhaps this is just a toy example to test griddata, but I assume you 
realize that you wouldn't normally use griddata to interpolate data on 
one regular grid to another regular grid. griddata is strictly for 
interpolating scatter data (not on a regular mesh) to a regular mesh.
-Jeff
> ------8<-------------
> from numpy import *
> from pylab import *
> import time
>
> deg2rad = pi/180.0
> ai = 0.12*deg2rad
> x = linspace(13,40,676)
> y = linspace(10,22,801)
>
> x = x*deg2rad
> y = y*deg2rad
> [x,y] = meshgrid(x,y)
> z = (x**2+y**2)
>
> xi = linspace(x.min(),x.max(),x.shape[1])
> yi = linspace(y.min(),y.max(),y.shape[0])
> tic= time.time()
> zi = griddata(x.flatten(),y.flatten(),z.flatten(),xi,yi)
> toc = time.time()
> print toc-tic
>
> fac = 2*pi/1.2681
> nx = fac * (cos(y)*cos(x) - cos(ai))
> ny = fac * (cos(y)*sin(x))
> nz = fac * (sin(y) + sin(ai))
> np = sqrt(nx**2 + ny**2)
>
> z = (np**2+nz**2)*exp(-0.001*nz)
>
> xi = linspace(np.min(),np.max(),x.shape[1])
> yi = linspace(nz.min(),nz.max(),y.shape[0])
> tic = time.time()
> zi = griddata(np.flatten(),nz.flatten(),z.flatten(),xi,yi)
> toc = time.time()
> print toc-tic
> 
-- 
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: Armin M. <arm...@st...> - 2009年02月20日 19:10:19
Jeff Whitaker wrote:
> Armin Moser wrote:
>> Hi,
>>
>> I would like to interpolate an array of shape (801,676) to regularily
>> spaced datapoints using griddata. This interpolation is quick if the
>> (x,y) supporting points are computed as X,Y = meshgrid(x,y). If this
>> condition is not fullfilled the delaunay triangulation is extremely
>> slow, i.e. not useable. Is this a known property of the used
>> triangulation? The triangulation can be performed with matlab without
>> any problems.
>>
>> Armin
>> 
> 
> Armin: You could try installing the natgrid toolkit and see if that
> speeds up griddata at all. If not, please post a test script with data
> and maybe we can figure out what is going on.
I have already tried natgrid and it didn't improve the situation. As
suggested I append a script demonstrating the problem.
Thanks
Armin
------8<-------------
from numpy import *
from pylab import *
import time
deg2rad = pi/180.0
ai = 0.12*deg2rad
x = linspace(13,40,676)
y = linspace(10,22,801)
x = x*deg2rad
y = y*deg2rad
[x,y] = meshgrid(x,y)
z = (x**2+y**2)
xi = linspace(x.min(),x.max(),x.shape[1])
yi = linspace(y.min(),y.max(),y.shape[0])
tic= time.time()
zi = griddata(x.flatten(),y.flatten(),z.flatten(),xi,yi)
toc = time.time()
print toc-tic
fac = 2*pi/1.2681
nx = fac * (cos(y)*cos(x) - cos(ai))
ny = fac * (cos(y)*sin(x))
nz = fac * (sin(y) + sin(ai))
np = sqrt(nx**2 + ny**2)
z = (np**2+nz**2)*exp(-0.001*nz)
xi = linspace(np.min(),np.max(),x.shape[1])
yi = linspace(nz.min(),nz.max(),y.shape[0])
tic = time.time()
zi = griddata(np.flatten(),nz.flatten(),z.flatten(),xi,yi)
toc = time.time()
print toc-tic
6 messages has been excluded from this view by a project administrator.

Showing results of 295

<< < 1 .. 3 4 5 6 7 .. 12 > >> (Page 5 of 12)
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 によって変換されたページ (->オリジナル) /