[Matplotlib-devel] Please I am getting error message when running this code in Python.

Benjamin Root ben.v.root at gmail.com
Mon May 16 14:29:35 EDT 2016


I suspect it is the extra backslash there in the plt.text() call.

On Tue, May 3, 2016 at 1:34 AM, vishal <vishal.goundar at gmail.com> wrote:

> >>> import numpy as np
> import matplotlib.pyplot as plt
>
> mu, sigma = 100, 15
> x = mu + sigma * np.random.randn(10000)
>
> # the histogram of the data
> n, bins, patches = plt.hist(x, 50, normed=1, facecolor='g', alpha=0.75)
>
>
> plt.xlabel('Smarts')
> plt.ylabel('Probability')
> plt.title('Histogram of IQ')
> plt.text(60, .025, r'$\mu=100,\ \sigma=15$')
> plt.axis([40, 160, 0, 0.03])
> plt.grid(True)
> plt.show()
> SyntaxError: multiple statements found while compiling a single statement
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/Please-I-am-getting-error-message-when-running-this-code-in-Python-tp47047.html
> Sent from the matplotlib - devel mailing list archive at Nabble.com.
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20160516/764f56fb/attachment.html>


More information about the Matplotlib-devel mailing list