83
100
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 (Source code, 2x.png, png) If a plot does not show up please check Troubleshooting. Where to go next#
  • Safe
  • United States
  • Encrypted
  • 12 yrs old
  • 11,456 Site Rank
  • Report Card

83
100
Alternatively, you can change your configuration parameters interactively (Option #2 above). When you import matplotlib.pyplot as plt, you get access to an rcParams object that resembles a Python dictionary of settings. All of the module objects starting with "rc" are a means to interact with your plot styles and settings:
  • Safe
  • United States
  • Encrypted
  • 12 yrs old
  • 11,204 Site Rank
  • Report Card

83
100
matplotlib.pyplot supports not only linear axis scales, but also logarithmic and logit scales. This is commonly used if data spans many orders of magnitude. Changing the scale of an axis is easy: plt.xscale('log') An example of four plots with the same data and different scales for the y-axis is shown below.
  • Safe
  • United States
  • Encrypted
  • 12 yrs old
  • 11,456 Site Rank
  • Report Card

83
100
You can embed Matplotlib directly into a user interface application by following the embedding_in_SOMEGUI.py examples here. Currently Matplotlib supports PyQt/PySide, PyGObject, Tkinter, and wxPython. When embedding Matplotlib in a GUI, you must use the Matplotlib API directly rather than the pylab/pyplot procedural interface, so take a look at ...
  • Safe
  • United States
  • Encrypted
  • 12 yrs old
  • 11,456 Site Rank
  • Report Card

83
100
Traceback (most recent call last): File "./plot_test.py", line 3, in <module> import matplotlib.pyplot as plt ImportError: No module named matplotlib.pyplot Does python look for matplotlib in different locations? The environment is: Mac OS X 10.8.4 64bit; built-in python 2.7; numpy, scipy, matplotlib is installed with:
  • Safe
  • United States
  • Encrypted
  • 20 yrs old
  • 88 Site Rank
  • Report Card

See more