On 8 Aug 2008, at 8:42 PM, Michael McNeil Forbes wrote:
> While revisiting some old plotting code, I ran across the following
> change in behaviour that seems to be buggy.
>
> from pylab import *
> ion()
> clf()
> x = linspace(0,1,10)
> plot(x,x**2,'r')
> a = gcf().add_axes([0.5,0.6,0.3,0.3])
>
Richard Lawrence wrote:
> I decided to try building Python myself using --prefix=$HOME,
Did you do that because you want to mess around with 2.6?
You might want to try building it as a more OS-X is way, I think that
required a flag something like "enable-frameworks" or something like that.
> w
I think what you are asking for is interpolation. You have a set of
(x,y) data, and you want to find a new y-value corresponding to a
given x-value.
Take a look at scipy.interpolate.interp1d
import numpy
import scipy
import scipy.interpolate
# Set up fake "data".
x= numpy.arange(10)
y = numpy.sin
Hello, everyone,
I am creating a plot based on several (x,y) value pairs (it constitutes some
fuel burn envelope).
Then I have to draw a line parallel to X axis with a given value of X that
would start at my plot, which means I have to find a value of Y on my plot
that corresponds to a given X
stuartornum wrote:
> Also what does rand(3,3) actually produce? is it a list, dict, im not really
> sure.
Since you are using Python, you can just ask it:
>>> import numpy as np
>>> help(np.random.rand)
Help on built-in function rand:
rand(...)
Return an array of t
AH HA!
Pete, you are a life saver! Thank you so much for all your help !
--
View this message in context:
http://www.nabble.com/Contour-Contourf-Plot-Heatmap---Grid---Multiple-Items-tp18872991p1931.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
---
try this:
list = numpy.array([0.66877509, 0.58785363, 0.32387598, 0.16877509,
0.48785363,
0.22387598, 0.96877509, 0.18785363, 0.52387598])
Pete
2008/8/8 stuartornum <[EMAIL PROTECTED]>
>
> Thanks again Pete for your help.
>
> I have numpy imported, and here is what my code looks like:
>
> #
Thanks again Pete for your help.
I have numpy imported, and here is what my code looks like:
import matplotlib
import numpy
from numpy import *
from pylab import *
list = [0.66877509, 0.58785363, 0.32387598, 0.16877509, 0.48785363,
0.22387598, 0.96877509, 0.18785363
rand() produces a numpy array, so long as numpy is imported into the
namespace.
I was simply using the random numbers as example data.
In your case you would take your 1x100 vector of heat data and re-shape it
to a 10x10 array. data=data.reshape(10,10)
Pete
2008/8/8 stuartornum <[EMAIL PROTEC
Hi Pete / All,
Thank you for the help so far, really appreciate it.
I have managed to plot the graph above using the code you gave me:
###
z=rand(3,3)
pcolormesh(z)
colorbar()
savefig('colour.png')
###
However, I am trying to find out what rand() actually does
10 matches
Mail list logo