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()

猜你喜欢

转载自blog.csdn.net/zfjBIT/article/details/87348379