Have you installed matplotlib properly? I added an extra line to your code to show the plot. This code works properly in Visual Studio after installing the matplotlib library.
import matplotlib.pyplot as plt import numpy as np x = np.linspace(-10 , 10, 100) y = np.sin(x) plt.plot(x, y, marker="x") plt.show()
Related Posts:
- TypeError: ‘int’ object is not callable
- What exactly does numpy.exp() do? [closed]
- TypeError: ‘int’ object is not callable
- Is a Python dictionary an example of a hash table?
- Why does this iterative list-growing code give IndexError: list assignment index out of range?
- Modifing data while using iterrows() does not work
- difference between command prompt and anaconda prompt
- Do I understand os.walk right?
- Converting dictionary to JSON
- Saving and loading objects and using pickle
- What does ** (double star/asterisk) and * (star/asterisk) do for parameters?
- Conda uninstall one package and one package only
- Cannot find module cv2 when using OpenCV
- Getting TypeError: __init__() missing 1 required positional argument: ‘on_delete’ when trying to add parent table after child table with entries
- TypeError: list indices must be integers, not str (boolean convertion actually)
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- Pandas “Can only compare identically-labeled DataFrame objects” error
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- SyntaxError: multiple statements found while compiling a single statement
- pygame.error: video system not initialized
- TypeError: ‘numpy.float64’ object is not callable
- ValueError: Length of values does not match length of index | Pandas DataFrame.unique()
- ‘str’ object has no attribute ‘decode’. Python 3 error?
- How to find all the indexes of a recurring item in a list?
- Is there a way to delete created variables, functions, etc from the memory of the interpreter?
- Code for Greatest Common Divisor in Python
- ‘DataFrame’ object has no attribute ‘sort’
- How to check Django version
- How to change the font size on a matplotlib plot
- How can I create a dropdown menu from a List in Tkinter?
- How to find all occurrences of a substring?
- how to update spyder on anaconda
- Django upgrading to 1.9 error “AppRegistryNotReady: Apps aren’t loaded yet.”
- Pygame Drawing a Rectangle
- Purpose of `numpy.log1p( )`?
- How do I change the figure size for a seaborn plot?
- How to use pyinstaller?
- Contains of HashSet
in Python - How to take column-slices of dataframe in pandas
- Python: Get the first character of the first string in a list?
- How to convert string to binary?
- Python error load JSON code of google API
- How do I find the duplicates in a list and create another list with them?
- Get ZeroDivisionError: float division in python
- ‘Pip’ is Not Recognized as an Internal or External Command windows 10 CMD
- Failed to load the native TensorFlow runtime – TensorFlow 2.1
- Using headers with the Python requests library’s get method
- ImportError: libSM.so.6: cannot open shared object file: No such file or directory
- explain arguments meaning in res = cv2.bitwise_and(img,img,mask = mask)
- How to normalize a 2-dimensional numpy array in python less verbose?
- Remove xticks in a matplotlib plot?
- “for line in…” results in UnicodeDecodeError: ‘utf-8’ codec can’t decode byte
- TypeError: string argument without an encoding
- How to truncate float values?
- How do I write a “tab” in Python?
- TypeError: ‘builtin_function_or_method’ object has no attribute ‘__getitem__’
- Why does PyQt crashes without information? (exit code 0xC0000409)
- How can I check if character in a string is a letter? (Python)
- raise LinAlgError(“SVD did not converge”) LinAlgError: SVD did not converge in matplotlib pca determination
- How to multiply all integers inside list
- How can I get the named parameters from a URL using Flask?
- Errno 10061 : No connection could be made because the target machine actively refused it ( client – server )
- Python Error – TypeError: input expected at most 1 arguments, got 3 [duplicate]
- A general tree implementation?
- TypeError: expected string or buffer
- How to convert a file into a dictionary?
- RuntimeWarning: overflow encountered in ubyte_scalars
- cannot convert the series to
- Converting a RGB color tuple to a six digit code
- mean, nanmean and warning: Mean of empty slice
- SystemError: new style getargs format but argument is not a tuple?
- Python Set Comprehension
- Split string using a newline delimiter with Python
- Why am I getting ImportError: No module named pip ‘ right after installing pip?
- No module named urllib3
- How to convert index of a pandas dataframe into a column
- Python requests SSL error – certificate verify failed
- How to know/change current directory in Python shell?
- Trying to run Flask app gives “Address already in use”
- UnicodeDecodeError, invalid continuation byte
- Circular list iterator in Python
- creating sets of tuples in python
- Using the AND and NOT Operator in Python [duplicate]
- How can I make one python file run another? [duplicate]
- Error: No module named ‘fcntl’
- “Can’t convert ‘float’ object to str implicitly”
- Python can’t find file
- Plotting graphs in C++
- ‘MyClass’ object has no attribute ‘__getitem__’
- Can’t install Scipy through pip
- How to run python code in Sublime Text 3?
- Random word generator- Python
- How can I install the Beautiful Soup module on the Mac?
- Find index of last occurrence of a substring in a string
- Multiplication function with recursion in Python
- How to change the Spyder editor background to dark?
- Python convert tuple to string
- Does Python have an immutable list?
- __init__() got an unexpected keyword argument ‘user’
- Create dynamic URLs in Flask with url_for()