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'
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
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.
© 2024 OneMinuteCode. All rights reserved.