python matplotlib 绘制曲线

# -*- coding: utf-8 -*-

"""

Created on Fri Feb 15 10:32:31 2019

@author: Administrator

"""
import numpy as np

import matplotlib.pyplot as plt

x = np.linspace(0, 0.75*np.pi, np.pi * 100,endpoint=True)

y=np.sin(x)

z=np.cos(x)

F1 = 2*y

F2 = z + 3*y

F3 = 3*z + 5*y

plt.figure(figsize=(8,4))

plt.plot(x,F1,'r--',label="$F1$",color="red",linewidth=2)

plt.plot(x,F2,'b--',label="$F2$")

plt.plot(x,F3,'g--',label="$F2$")

plt.xlabel("0")

plt.ylabel("p")

plt.title("Matplotlib First Demon")

plt.legend()

plt.show()

python matplotlib 绘制曲线_第1张图片

你可能感兴趣的:(Python)