To matplotlib-users,
When I do:
cd basemap-1.0.7/examples
python3 simpletest.py
Then I get this error message:
Traceback (most recent call last):
File
/usr/local/lib/python3.4/dist-packages/matplotlib-1.3.1-py3.4-linux-i686.egg/matplotlib/backends/backend_gtk3cairo.py,
line 32, in
In the example you provide, bins is returned by the hist command,
whereas in your code, bins is a number that you defined as 20. So,
change:
bins = 20
plt.hist(C, bins, ...
by:
nbins = 20
n, bins, patches = plt.hist(C, nbins, ...
As a side comment, your data loading is too complex, and fail
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', align='mid',
orientation='vertical', rwidth=None, log = False, color=None, label=None)
plt.title()
plt.text(25,20,'M -21.5' '\n'
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', align='mid',
On Fri, Jul 27, 2012 at 9:57 PM, surfcast23 surfcas...@gmail.com 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 a vector, but it
Thanks for catching that sigma was still a vector! I am no longer getting the
errors, but the best fit line is not showing up.Is there something else I am
missing ?
BTW thanks for the heads up on the np.mean and np.standard functions.
Khary
Daπid wrote:
On Fri, Jul 27, 2012 at 9:57 PM,
I guess it is showing, but you have many data points, so the gaussian
is too small down there. You have to increase its values to make both
areas fit:
plt.plot(bins, 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,
That worked beautifully thank you!
Am I reading (bins[1]-bins[0]) correctly as taking the difference between
what is in the second and first bin?
Daπid wrote:
I guess it is showing, but you have many data points, so the gaussian
is too small down there. You have to increase its values to
On Sat, Jul 28, 2012 at 12:22 AM, surfcast23 surfcas...@gmail.com 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 the bins by their total height.
Surely there are cleaner and more general
Thank you for the help!
Daπid wrote:
On Sat, Jul 28, 2012 at 12:22 AM, surfcast23 surfcas...@gmail.com 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 the bins by their total
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 module
On Friday July 9 2010 00:06:05 Shir J. Livne wrote:
Hello,
I keep getting the error ValueError: Need more than 1 value to unpack
every time I try to use the line ax.plot_wireframe(myArray[:,0],
myArray[:,1], myArray[:,2])
What does that error mean?
Hi Shir,
I think you used 1d-arrays
Hello,
I keep getting the error ValueError: Need more than 1 value to unpack
every time I try to use the line ax.plot_wireframe(myArray[:,0],
myArray[:,1], myArray[:,2])
What does that error mean?
Thanks,
Shir
--
Hi List
I cannot figure out how to satisfy this issue to resolve the ValueError:
x and y must have same first dimension.
This is the relevant code:
[code]
for i in range( 0, time + 1 ):
outflow = constant * quantity
quantityChange = inflow - outflow
changeList.append(
On Sun, Mar 21, 2010 at 1:57 PM, AG computing.acco...@googlemail.comwrote:
Hi List
I cannot figure out how to satisfy this issue to resolve the ValueError:
x and y must have same first dimension.
This is the relevant code:
[code]
for i in range( 0, time + 1 ):
outflow = constant *
Thanks for all replies.
I got a solution by copying some files from SVN trunk revision 6155. I did
as follow:
svn co
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib
sudo cp
-b matplotlib/lib/matplotlib/backends/backend_pdf.py
On Wed, Jun 25, 2008 at 8:44 AM, John Hunter [EMAIL PROTECTED] wrote:
I think I have this fixed in svn
Just downloaded 0.98.2 and the code that failed in 0.98.1 works! Thanks!
Cheers
Adam
-
Check out the new
I think I have this fixed in svn -- also, I rewrote your example to
use csv2rec (which returns record arrays). Thought you might be
interested:
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import matplotlib.cbook as cbook
r1 =
On Monday 23 June 2008 23:37:09 Adam Mercer wrote:
Hi
Just upgraded to matplotlib-0.98.1, and a code that worked with 0.98.0
is now failing with the following error:
Please, include a brief standalone script that demonstrates the problem when
reporting problems.
Traceback (most recent call
On Tue, Jun 24, 2008 at 6:43 AM, Johan Mazel [EMAIL PROTECTED] wrote:
I used to have such errors when I was trying to display empty vectors.
But since you're saying that the script work on previous version of
Matplotlib...
I recently made some changes to try and support a use-case where the
On Tue, Jun 24, 2008 at 6:14 AM, Darren Dale [EMAIL PROTECTED] wrote:
Please, include a brief standalone script that demonstrates the problem when
reporting problems.
Sorry should have done that, I've attached an example script (and the
according data files) which exhibits the problem on
Hi
Just upgraded to matplotlib-0.98.1, and a code that worked with 0.98.0
is now failing with the following error:
Traceback (most recent call last):
File ./plot_workout.py, line 126, in module
time_plot = time_axes.plot_date(times_dates, times, 'bo-')
File
22 matches
Mail list logo