2

I am trying to take an interesting course offered by Coursera on linear algebra. The course is in Python. I'm familiar with R instead.

It seems like to follow the course I can't assume that plotting is going to be as easy as calling plot().

In particular, there is this command in one of the first lectures:

>>>L = [2 + 2j, 3 + 2j, 1.75 + 1j]
>>>from plotting import plot
>>> plot(L)

which works fine for the instructor, but results in the following error when I try:

>>> from plotting import plot
Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    from plotting import plot
ImportError: No module named 'plotting'

I went to the help pages, and it mentions that plotting in Python uses the internet browser, and advising to check which browser is the default. I use Opera (don't ask...), and it seems as though it is one of the recognized browsers.

If it is just a matter of installing the 'plotting' module as the error message clearly spells out, can I ask how this is done?

NOTE: I have circumvented this issue by simply downloading anaconda and then, from the cmd prompt calling IP Notebook typing: > ipython notebook at the prompt. A browsers should open with the jupyter interface; ipython notebook is phenomenal, allowing scientific plotting, markdown and latex in a local webserver interface that is clean and nice. During the session the cmd windows should remain open. Also, to save projects to a folder, the directory should be changed to that folder before starting the session, also using the cmd line. This is what it looks like:

enter image description here

4
  • plotting is not a pypi package. Is it something course specific? Commented Dec 6, 2015 at 1:22
  • Did you resolve this? Even I am not able to find the plotting package.. Commented Jan 6, 2016 at 13:13
  • No. I didn't. It's a shame because the course was really enticing. Commented Jan 6, 2016 at 13:25
  • Off topic, but did they take off the course "Coding the matrix" from coursera? I am unable to find it. Commented Jun 14, 2017 at 10:10

5 Answers 5

3

Download the plotting.py from http://resources.codingthematrix.com/ to resolve this.

Sign up to request clarification or add additional context in comments.

4 Comments

thank you. I have downloaded this file, but I don't know how to incorporate it into python. I'm attaching a screen capture of where I'm stuck (in a few secs).
run python from the directory where this file is copied to.
It opens Google Chrome, but the image deployed is blank.
download all the files mentioned in the Playing with C section
1

I think you need to install sympy http://docs.sympy.org/dev/modules/plotting.html check the documentation and installing deatils https://github.com/sympy/sympy/wiki/Download-Installation

2 Comments

Thank you for your answer. I have been knocking my head against this last night and this morning. I downloaded and unzipped the file sympy-docs-html-0.7.2-py3k.zip. Then I tried both withing python and powershell (Windows) to run python -m pip install SomePackage==1.0.4 without success. What am I doing wrong?
0

I don't know there's a library called plot. But you can find something similar here:Wiki-NumericAndScientific-Plotting

Comments

0

The plotting.py is having a procedure to remove the file at exit. I added a dummy print command after call to plot() to delay the method from firing and was able to see the plot in debugging session. The remove at exit procedure can be removed only that it would be creating Temporary files on machine each time plot() is run.

from plotting import plot plot([1+2j]) print('Wait')

Comments

0

I take also a course by Coursera on Statistics and I had the same problem but I solved the problem by using this code:

import matplotlib.pyplot as plt

data = [3,4,2,4,3,5,3,6,4,3]
plt.hist(data);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.