83
100
4. It could be that it's running your default Python installation instead of the one installed with Anaconda. Try prepending this to the top of your script: #!/usr/bin/env python. If that does not work, try installing matplotlib with pip, then try again: pip install matplotlib. Let me know if that works for you.
  • Safe
  • United States
  • Encrypted
  • 20 yrs old
  • 88 Site Rank
  • Report Card

83
100
Linux package manager #. If you are using the Python version that comes with your Linux distribution, you can install Matplotlib via your package manager, e.g.: Debian / Ubuntu: sudo apt-get install python3-matplotlib. Fedora: sudo dnf install python3-matplotlib. Red Hat: sudo yum install python3-matplotlib.
  • Safe
  • United States
  • Encrypted
  • 12 yrs old
  • 11,456 Site Rank
  • Report Card

83
100
Install using conda: conda install-c conda-forge matplotlib Further details are available in the Installation Guide. Draw a first plot# Here is a minimal example plot: import matplotlib.pyplot as plt import numpy as np x = np. linspace (0, 2 * np. pi, 200) y = np. sin (x) fig, ax = plt. subplots ax. plot (x, y) plt. show
  • Safe
  • United States
  • Encrypted
  • 12 yrs old
  • 11,456 Site Rank
  • Report Card

See more