第四讲 用 Mathematica画函数图形
第四讲 用Mathematica画函数图形
用 Mathematio函数的图形 ●基本的一元函数作图 ●二维作图的可选参数 ●参数方程作图 ●极坐标方程作图 ●三维图形命令
用Mathematica画函数的图形 ⚫ 三维图形命令 ⚫ 二维作图的可选参数 ⚫ 参数方程作图 ⚫ 基本的一元函数作图 ⚫ 极坐标方程作图
基本的一元函数作图 ●命令格式: 自变量的取值范围 Plot[fx],伙xmin,xmax3,可选项] 函数表达式 图形参数的设定 如: Plot [sin[×],伙,2Pi,2Pi}, AspectRatio> Automatic 如: Plot [Exp[1x],{,·1,2}, PlotRange->{-1,5 ●可以同时画多个函数的命令格式 Plot[f1x,2×]} L xmIn,xmax},可选项] 如: Plot [(Sin[x],Sn[2*×]2,Sin[3×3《x,2Pi,2Pi tn: Plot [Evaluate[Table[xAn, n, 4 11,x, 0, 1)1
基本的一元函数作图 ⚫ 命令格式: Plot [ f[x], {x, xmin, xmax}, 可选项] 如: Plot [Sin[x], {x, -2Pi, 2Pi}, AspectRatio->Automatic] 函数表达式 自变量的取值范围 图形参数的设定 如: Plot [Exp[1/x], {x, -1, 2}, PlotRange->{-1,5}] ⚫ 可以同时画多个函数的命令格式 Plot [{ f1[x],f2[x],…}, {x, xmin, xmax}, 可选项] 如: Plot [{Sin[x], Sin[2*x]/2,Sin[3*x]/3},{x, -2Pi, 2Pi}] 如: Plot [Evaluate[Table[x^n,{n,4}]],{x, 0, 1}]
维作图的可选参数 ●第一类参数:与图形显示有关 AspectRatio:改变图形显示的横纵坐标的比例; Frame:是否给图形加边框,默认为 False; PlotRange:用于指定图形在纵坐标方向上的范围; Axeslable:用于给坐标轴加上标记 Axes:指定是否显示坐标轴 True(或 Automatic)显示坐标轴 sA: Plot [Sin(x],(x, .2Pi, 2Pi), AspectRatio->Automatic, Frame->True, AxesLabel->x, Sin(x1, PlotRange->(-2, 2)
二维作图的可选参数 ⚫ 第一类参数:与图形显示有关 ✓ AspectRatio:改变图形显示的横纵坐标的比例; ✓ Frame:是否给图形加边框,默认为False; ✓ PlotRange:用于指定图形在纵坐标方向上的范围; ✓ Axeslable :用于给坐标轴加上标记 ✓Axes: 指定是否显示坐标轴 True(或Automatic)显示坐标轴 如: Plot [Sin[x], {x, -2Pi, 2Pi}, AspectRatio->Automatic, Frame->True, AxesLabel->{x, Sin[x]}, PlotRange->{-2,2}]
维作图的同选参数一 ●第二类参数:对图形的修饰与加工 Pole Style:说明用什么方式画图形 RGBColor:图形的颜色 Thickness:描述线的宽度 Dashing:用于画虚线 √ PlotPoints:用于说明采样点的基本点数 Background:用于指定背景颜色 Automatic实际颜色与 Windows窗口背景色一致 如:Pot[Sin[x],Sin2*x]2sn[3×]/3}{x,·2Pi,2P PlotStyle->RGBColor[1,0,0], RGBColor[0, 1,0], RGBColor[0,0, 11
⚫ 第二类参数:对图形的修饰与加工 ✓ PoleStyle:说明用什么方式画图形; • RGBColor:图形的颜色 • Thickness[t]:描述线的宽度 • Dashing:用于画虚线 ✓ PlotPoints:用于说明采样点的基本点数 Background: 用于指定背景颜色 Automatic 实际颜色与Windows窗口背景色一致 如: Plot [{Sin[x], Sin[2*x]/2,Sin[3*x]/3},{x, -2Pi, 2Pi}, PlotStyle->{RGBColor[1,0,0], RGBColor[0,1,0], RGBColor[0,0,1]}] 二维作图的可选参数