Plot 函数
1. Plot[Sin[x],{x,0,6Pi}]
2. 同时显示多个函数
Plot[{Sin[x],Sin[2x],Sin[3x]},{x,0,2Pi}]
3. 突出显示函数曲线至底轴区域
Plot[2Sin[x]+x,{x,0,15},Filling→Bottom]
4.突出显示两函数曲线所夹区域
Plot[{Sin[x]+x/2,Sin[x]+x},{x,0,10},
Filling→{1→{2}}]
5.
Plot multiple filled curves,
automatically using transparent colors:
Plot[Evaluate[Table[BesselJ[n,x],{n,4}]], {x,0,10},Filling→Axis]
6.同时显示多张坐标图
{Plot[x^4-x^2+1,{x,-2,2}],Plot[x^4-x^2+1, {x,-2,2},PlotRange→{0,2}]}
7. Use Exclusions to remove points or split the resulting curve:
{Plot[Tan[x],{x,0,15}],Plot[Tan[x], {x,0,15},Exclusions→{Cos[x]= =0}]}
8. Multiple curves are automatically colored to be distinct:
Plot[{x^(1/4),x^(3/4),x^(3/2),x^(7/2)},{x,0,2}]
9. Provide explicit styling to different curves: Plot[{x^(1/4),x^(3/4),x^(3/2),x^(7/2)},{x,0,2}, PlotStyle→{Thick,Automatic,Red,Dashed}]
10. 为图像添加标签
Plot[Sin[x],{x,0,2Pi},AxesLabel→{x,y},PlotLabel→Si n[x]]
11. Provide an interactive Tooltip for each curve: Plot[{Tooltip[Sin[x]],Tooltip[Sin[2x]]},{x,0,2Pi}]
12.
Create filled plots:
Plot[{Sin[x],Cos[x]},{x,0,2Pi},Filling->Axis]
13.
Create an overlay mesh: Plot[Sin[x],{x,0,2Pi},Mesh
→20]
14. Style the curve segments between mesh points:
Plot[Sin[x],{x,0,2Pi},Mesh →
10, MeshShading →{Red,None,Blue}]
15. Link curves to external information:
Plot[{Hyperlink[Sin[x]," /Sine.html"],Hyperlink[Cos[x],"http://mathworld.wolfr /Cosine.html"]},{x,0,10}]
16. Draw no axes:
Plot[Sinc[x],{x,0,10},Axes →{False,True}]
17. Draw the y axis but no x axis:
Plot[Sinc[x],{x,0,10},Axes →{False,True}]
18. Use labels based on variables specified in Plot: Plot[Sinc[u],{u,0,10},AxesLabel →Automatic]
19. Specify the style of each axis: Plot[Sinc[x],{x,0,10},AxesStyle →{Directive[Thick,Dashed,Red],Blue}]
20. Color a curve red when its absolute y coordinate is above 0:
Plot[Sinc[x],{x,0,10},ColorFunction-> Function[{x,y},If[y>0,Red,Black]],
ColorFunctionScaling->False,PlotStyle →Thick]
21.Fill with the color used for the curve: Plot[Sin[x],{x,0,2Pi},ColorFunction-> Function[{x,y},Hue[y]],Filling->Axis]
22. ColorFunction has higher priority than PlotStyle for coloring the curve:
Plot[Sinc[x],{x,0,10},ColorFunction →
"DarkRainbow",PlotStyle →Directive[Red,Thick]]
23.
Fill between curves 1 and 2:
Plot[{Sin[x],Cos[x]},{x,0,2Pi},Filling →{1→{2}}]
24. Fill between curves 1 and 2 with a specific style: Plot[{Sin[x],Cos[x]},{x,0,2Pi}, Filling →{1→{{2},Yellow}}]
25. Fill between curves 1 and y=1/2 with yellow: Plot[{Sin[x],Cos[x]},{x,0,2Pi}, Filling →{1→{1/2,Yellow}}]
26. Explicitly specify the style for different curves: Plot[{Sin[x],Sin[2x],Sin[3x]},{x,0,2Pi}, PlotStyle->{Red,Green,Blue}]
27. Use ContourPlot and RegionPlot for implicit curves and regions:
{ContourPlot[x^2+y^2= =1,{x,-1,1},{y,-1,1}], RegionPlot[1<x^2+y^2<4,{x,-2,2},{y,-2,2}]}
28.
Use Plot3D and ParametricPlot3D
for function and parametric surfaces:
Plot3D[(x^2+y^2)Exp[-(x^2+y^2)],{x,-2,2},{y,-2,2}]
29.ParametricPlot3D[{-2 Cos[u] Cos[v]^3,-2 Cos[v]^2
Sin[u],2 Tan[v]},{u,0,2Pi},{v,-1,1}]
30. ContourPlot3D to make a hyperboloid of one sheet: ContourPlot3D[x^2+y^2-z^2= =1, {x,-3 ,3 },{y,-3 ,3},{z,-3,3}]。