Home > other >  Run the code display ModuleNotFoundError: No module named 'matplotlib. Pylab'
Run the code display ModuleNotFoundError: No module named 'matplotlib. Pylab'

Time:10-07


The anaconda had been reinstall python version 3.7 pycharm 2017.2.3
Save me I've been studying for a few days

CodePudding user response:

The import numpy as np
The import matplotlib as MPL
The from pylab import matplotlib as PLT
Def the main () :
# solve the problem of Chinese garbled
MPL. RcParams [' font. Sans-serif]=[' SimHei]
MPL. RcParams [' axes. Unicode_minus]=False
,1,50) x=np. Linspace (- 1 # generate 50 arithmetic progression between [1, 1]
Y1=2 * x + 1
Y2=x * * 2 + 1
PLT. Figure (num=1, figsize=(8, 5)) # num represents number, figsize represents the chart aspect
PLT. The plot (x, y2, lable="curve") # label legend tag
PLT. The plot (x, y1, label="line", color='red', our linewidth=1.0, graphics.linestyle='-')
PLT. Title (" draw a straight line and curve ") # set title
PLT. Legend () #
Settings illustrationsPLT. The show () # according to draw the results

If __name__=="__main__" :
The main ()

CodePudding user response:

Baidu won't solve this problem?

CodePudding user response:

refer to the second floor like spiders kid reply:
baidu won't solve this problem?
baidu to approach won't solve, if you have the means to bother to teach me how to thank you
  • Related