# 怎么用matlab把表格画成曲线图,如何用电脑画出一个公式的图表，如折线图

2.1 折线图&散点图 Line and scatter plots

2.1.1 折线图 Line plots(关联一组x和y值的直线)

import numpy as np

import pylab as pl

x = [1, 2, 3, 4, 5]# Make an array of x values

y = [1, 4, 9, 16, 25]# Make an array of y values for each x value

pl.plot(x, y)# use pylab to plot x and y

pl.show()# show the plot on the screen

pl.legend((plot1, plot2), (’label1, label2’), 'best’, numpoints=1)

import numpy as np

import pylab as pl

x1 = [1, 2, 3, 4, 5]# Make x, y arrays for each graph

y1 = [1, 4, 9, 16, 25]

x2 = [1, 2, 4, 6, 8]

y2 = [2, 4, 8, 12, 16]

plot1 = pl.plot(x1, y1, ’r’)# use pylab to plot x and y : Give your plots names

plot2 = pl.plot(x2, y2, ’go’)

pl.title(’Plot of y vs. x’)# give plot a title

pl.xlabel(’x axis’)# make axis labels

pl.ylabel(’y axis’)

pl.xlim(0.0, 9.0)# set axis limits

pl.ylim(0.0, 30.)

pl.legend([plot1, plot2], (’red line’, ’green circles’), ’best’, numpoints=1)# make legend

pl.show()# show the plot on the screen

excel中如何用控件选择折线图

IIS+mysql +php 如何使用Jgraph画出折线图？

01-14

10-23 3912
07-22 9754
03-12