ModuleNotFoundError in Python library called plot

Asked 2 years ago, Updated 2 years ago, 22 views

The following code appears in the book matrix programmer, but if you do this, you will get the error ModuleNotFoundError: No module named 'plotting'.

Is this library no longer available?
Or is it wrong to call the library

code

>>>from plating import plot

>>S=S={2+2j, 3+2j, 1.75+1j, 2+1j, 2.25+1j, 2.5+1j, 2.75+1j, 3+1j, 3.25+1j}

>>Plot(S, 4)

error message

>>>from plating import plot

ModuleNotFoundError: No module named 'plotting'

python

2022-09-30 19:39

2 Answers

Isn't it a module created by the author and downloaded from the book site?

http://resources.codingthematrix.com/ has several other files: plotting.py


2022-09-30 19:39

When you say "plot" in Python, the plot function of the pyplot module is well known.(For installation instructions, see articles such as [Introduction to Python] Let's create a graph with the plot function!)

S={2+2j, 3+2j, 1.75+1j, 2+1j, 2.25+1j, 2.5+1j, 2.75+1j, 3+1j, 3.25+1j}

In Python, {} is used to represent a dictionary.The code above seems to be substituting S for a list of complex numbers, so

S=[2+2j, 3+2j, 1.75+1j, 2+1j, 2.25+1j, 2.5+1j, 2.75+1j, 3+1j, 3.25+1j]

Isn't that right? (I'm using [ ] instead of { })

This is a list of complex numbers, so I think it is necessary to plot the x-axis as a real number part and the y-axis as an imaginary number part.


2022-09-30 19:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.