[Matplotlib-users] Set Histogram bin size to change by interger value

2012-08-12 Thread surfcast23
Hi All, I would like to know if there is a way to have the bin sizes change by integer values. For example the bin size would be 10-20 20-30 not 10.3-20.5 20.3-30.5 and have it adjust as the number of bins changes. Thanks -- View this message in context: http://matplotlib.1069221.n5.n

Re: [Matplotlib-users] Size of array elements when using Axes3D.plot_wireframe(X, Y, Z, *args, **kwargs)

2012-08-02 Thread surfcast23
Gotcha ya working perfectly now thank you for the help! Benjamin Root-2 wrote: > > On Thursday, August 2, 2012, surfcast23 wrote: > >> >> Wouldn't >> >> X= np.ones((1, 45)) >> Y= np.zeros((32, 1)) >> >> change the existing valu

Re: [Matplotlib-users] Size of array elements when using Axes3D.plot_wireframe(X, Y, Z, *args, **kwargs)

2012-08-02 Thread surfcast23
I tested it out and it does change all the values to ones and zeros. Is there a way to broadcast and keep the original values that were in the arrays? Thanks for the help Benjamin Root-2 wrote: > > On Thursday, August 2, 2012, surfcast23 wrote: > >> >> Okay thank you!

Re: [Matplotlib-users] Size of array elements when using Axes3D.plot_wireframe(X, Y, Z, *args, **kwargs)

2012-08-02 Thread surfcast23
sorry misssed this line "Which produces x and y with the same shapes, and their values duplicated in the direction the array was "expanded"." surfcast23 wrote: > > Wouldn't > > X= np.ones((1, 45)) > Y= np.zeros((32, 1)) > > change the exi

Re: [Matplotlib-users] Size of array elements when using Axes3D.plot_wireframe(X, Y, Z, *args, **kwargs)

2012-08-02 Thread surfcast23
Wouldn't X= np.ones((1, 45)) Y= np.zeros((32, 1)) change the existing values of the elements to ones and zeros? Benjamin Root-2 wrote: > > On Thursday, August 2, 2012, surfcast23 wrote: > >> >> Okay thank you! The Matlab code I am basing this on takes arrays of &

Re: [Matplotlib-users] Size of array elements when using Axes3D.plot_wireframe(X, Y, Z, *args, **kwargs)

2012-08-02 Thread surfcast23
? Benjamin Root-2 wrote: > > On Thursday, August 2, 2012, surfcast23 wrote: > >> >> >> >> surfcast23 wrote: >> > >> > In the documentation it says that Axes3D.plot_wireframe(X, Y, Z, *args, >> > **kwargs) takes 2D arrays as the first two

Re: [Matplotlib-users] Size of array elements when using Axes3D.plot_wireframe(X, Y, Z, *args, **kwargs)

2012-08-02 Thread surfcast23
surfcast23 wrote: > > In the documentation it says that Axes3D.plot_wireframe(X, Y, Z, *args, > **kwargs) takes 2D arrays as the first two arguments. Do the arrays have > to have the same size dimensions? > > Any one know? -- View this message in context: http://old.

[Matplotlib-users] Size of array elements when using Axes3D.plot_wireframe(X, Y, Z, *args, **kwargs)

2012-08-01 Thread surfcast23
In the documentation it says that Axes3D.plot_wireframe(X, Y, Z, *args, **kwargs) takes 2D arrays as the first two arguments. Do the arrays have to have the same size dimensions? -- View this message in context: http://old.nabble.com/Size-of-array-elements-when-using-Axes3D.plot_wireframe%28X%

Re: [Matplotlib-users] IndexError: index out of bounds

2012-07-31 Thread surfcast23
I also got the dimensions of the arrays and was wandering if the problem might be there shape data = (101, 512) shape v = (512, 512) shape tdata = (101, 1) shape x = (512,) Benjamin Root-2 wrote: > > On Sun, Jul 1, 2012 at 12:50 PM, surfcast23 wrote: > >> >> Hi, &g

Re: [Matplotlib-users] IndexError: index out of bounds

2012-07-31 Thread surfcast23
[0,:] tdata = vstack([tdata, t]) But I still get the same error as in my original post. Khary surfcast23 wrote: > > I will try initializing starting at 0 > > Benjamin Root-2 wrote: >> >> On Sun, Jul 1, 2012 at 12:50 PM, surfcast23 wrote: >> >>>

Re: [Matplotlib-users] ValueError: x and y must have same first dimension

2012-07-27 Thread surfcast23
Thank you for the help! Daπid wrote: > > On Sat, Jul 28, 2012 at 12:22 AM, surfcast23 wrote: >> Am I reading (bins[1]-bins[0]) correctly as taking the difference >> between >> what is in the second and first bin? > > Yes. I am multipliying the width of

Re: [Matplotlib-users] ValueError: x and y must have same first dimension

2012-07-27 Thread surfcast23
ts values to make both > areas fit: > > plt.plot(bins, N* N*(bins[1]-bins[0])**y, 'r--', linewidth=1) > > > And you will get a nice gaussian fitting your data. > > On Fri, Jul 27, 2012 at 11:12 PM, surfcast23 wrote: >> >> Thanks for catching that

Re: [Matplotlib-users] ValueError: x and y must have same first dimension

2012-07-27 Thread surfcast23
:57 PM, surfcast23 wrote: >> y = mlab.normpdf( nbins, avg, sigma) >> l = plt.plot(nbins, y, 'r--', linewidth=1) >> plt.show() > > You should not change bins there, as you are evaluating the gaussian > function at different values. > > Also, sigma is

Re: [Matplotlib-users] ValueError: x and y must have same first dimension

2012-07-27 Thread surfcast23
Just tried it with nbins set to 216 and I still get the error surfcast23 wrote: > > Hi David, > >I tried your fix > nbins = 20 > n, bins, patches = plt.hist(C, nbins, range=None, normed=False, > weights=None, cumulative=False, bottom=None, histtype='bar&#x

Re: [Matplotlib-users] ValueError: x and y must have same first dimension

2012-07-27 Thread surfcast23
; > As a side comment, your data loading is too complex, and fail prone. I > suggest you to have a look at the numpy function for that, loadfromtxt > or (I like it more), genfromtxt. It would be something like: > > data=np.genfromtxt(F, delimiter=' ') > C=data[:,

[Matplotlib-users] ValueError: x and y must have same first dimension

2012-07-26 Thread surfcast23
Hi I have a code to plot a histogram and I am trying to add a best fit line following this example http://matplotlib.sourceforge.net/examples/pylab_examples/histogram_demo.html but run into this error Traceback (most recent call last): File "/home/Astro/count_Histogram.py", line 54, in

Re: [Matplotlib-users] IndexError: index out of bounds

2012-07-03 Thread surfcast23
I will try initializing starting at 0 Benjamin Root-2 wrote: > > On Sun, Jul 1, 2012 at 12:50 PM, surfcast23 wrote: > >> >> Hi, >> I am translating a Matlab code to python and get the following error >> when >> the codes reaches the plotting sect

[Matplotlib-users] IndexError: index out of bounds

2012-07-01 Thread surfcast23
Hi, I am translating a Matlab code to python and get the following error when the codes reaches the plotting section Warning (from warnings module): File "C:\Documents and Settings\My Documents\PHYSICS\Wave-eqn.py", line 40 w = (D*v) RuntimeWarning: overflow encountered in multiply Trace

Re: [Matplotlib-users] Plot points in a 3D Scatter Plot

2012-06-17 Thread surfcast23
Thanks Ben I will check it out Benjamin Root-2 wrote: > > Khary, > > On Sun, Jun 10, 2012 at 3:30 PM, surfcast23 wrote: > >> >> to matplotlib-use. >> Hi, >> >> I have a data set that is composed of x,y,z coordinates of the center of >> ce

[Matplotlib-users] Plot points in a 3D Scatter Plot

2012-06-11 Thread surfcast23
to matplotlib-use. Hi, I have a data set that is composed of x,y,z coordinates of the center of cells and counts of objects in each contained in cell. I am using the following code to do a scatter plot of the counts per cell. ax = fig.add_subplot(111, projection='3d') ax.scatter(Xa, Ya, Za, z

[Matplotlib-users] Script hanging during plot of Runge-Kutta

2012-02-19 Thread surfcast23
Hi I wrote the following script, but it hangs right after plt.show(). I would really appreciate it if someone could take a look and let me know where I'm messing up. Thanks in advance from numpy import * import matplotlib.pyplot as plt #H=p^2/2-cosq #p=dp=-dH/dq #q=dq=dH/dp t = 0 h = 0.5 pfa =

Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-09-06 Thread surfcast23
Benjamin Root-2 wrote: > > On Tue, Sep 6, 2011 at 12:01 PM, surfcast23 wrote: > >> >> Thanks for everyone responses and help >> >> Che, >> >> You are correct on what I have to do. The problem is that I have a data >> set >> with ~1250

Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-09-06 Thread surfcast23
istogram, because he is not plotting > frequency of observations on the y axis, but data values (means of > each bin). I think what surfcast23 wants is just a bar graph. > > So, surfcast23, I'd suggest you break it down into your two steps. > First, how will you average your values by

Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-09-03 Thread surfcast23
scribe what you want to do? So you now want a histogram? > > > surfcast23 wrote: >> >> Sorry everyone I totally missed something very important. What I need to >> do is first bin the masses(which I don't know how to do). >> >> Chelonian wrote: >

Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-08-25 Thread surfcast23
Sorry everyone I totally missed something very important. What I need to do is first bin the masses(which I don't know how to do). Chelonian wrote: > > On Thu, Aug 25, 2011 at 10:01 PM, surfcast23 wrote: >> >> Hi, >> >>   there is only one column. so I wa

Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-08-25 Thread surfcast23
ves you what I think you said, but really don't think this is what > you mean as it seems a strange thing to want to do. > > sorry i couldn't be of more help > > > surfcast23 wrote: >> >> Hi, >> >>there is only one column. so I want a plot

Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-08-25 Thread surfcast23
each column the average? and > you want to plot each of these averages? So a bar graph? with 8 bars? > > > > surfcast23 wrote: >> >> Hi, >> >>I apologize if my explanation was less than clear. What I have is data >> in a column that runs from

Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-08-25 Thread surfcast23
> mass_sum = np.cumsum(mass) > mass_average = mass_sum/ np.arange(1, len(mass_sum) + 1) > # If you only plot one array or list of values, they are assumed to be the > y > values. > # The x values in that case are the indices of the y value array. > plt.plot(mass_average) &

Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-08-25 Thread surfcast23
Hi, I apologize if my explanation was less than clear. What I have is data in a column that runs from row 1 to row 1268. In each each row there is a number. For example 1 3 5 6 7 8 9 so I want the y axis to run from 1 to 7 ( the number of rows) and the x axis to be the average of the values

Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-08-25 Thread surfcast23
Hi Martin, Thank for the relpy. What I have is a script that reads the data from a large file then prints out the values listed in a particular column. What I now need to do is have the information in that column plotted as the number of rows vs. the mean value of all of the rows. What I ha

Re: [Matplotlib-users] How do you Plot data generated by a python script?

2011-08-24 Thread surfcast23
want. However, > if you are really that new to programming, you may struggle, so I'd > suggest reading first going to scipy.org and reading up on numpy. When > you understand the basics of numpy, matplotlib's documentation should > make a lot more sense. > > Gary >

[Matplotlib-users] How do you Plot data generated by a python script?

2011-08-24 Thread surfcast23
I am fairly new to programing and have a question regarding matplotlib. I wrote a python script that reads in data from the outfile of another program then prints out the data from one column. f = open( 'myfile.txt','r') for line in f: if line != ' ': line = line.strip() # Strips end of li