画半立方抛物线

# Import the module for plotting
# _*_ coding:utf-8 _*_

import numpy as np
import matplotlib.pyplot as plt

if __name__=='__main__':
    a=1
    t=np.linspace(-1,1,num=10000)
    x=np.power(t,2)
    y=np.power(t,3)*a
    # plt.figure(figsize=(4, 8), facecolor='w')
    plt.plot(x,y,'r-', linewidth=0.5)
    my_x_ticks = np.arange(-0.5, 1, 0.5)
    my_y_ticks = np.arange(-1, 1.5, 0.5)
    plt.xticks(my_x_ticks)
    plt.yticks(my_y_ticks)
    plt.savefig('半立方抛物线.jpg')
    plt.grid()
    plt.show()

你可能感兴趣的:(数学)