如何去掉不想要的竖线

来源:互联网 发布:厦门软件协会 编辑:程序博客网 时间:2024/04/29 21:30

通常的绘制正切曲线的代码:

Plot[Tan[x] - 3 x/(3 + 2967/1000000 x^2), {x, -Pi, 2 Pi},  PlotStyle -> Red,  AxesStyle ->{{Arrowheads[.03], Directive[Black, 12]}, {Arrowheads[.03], Directive[Black, 12]}}]

效果:
这里写图片描述

竖线是多余无用的,是Plot本身的特点造成的,去掉的方法是修改Exclusive选项的值:

Plot[Tan[x] - 3 x/(3 + 2967/1000000 x^2), {x, -Pi, 2 Pi},  Exclusions -> Cos[x] == 0,  PlotStyle -> Red,AxesStyle -> {{Arrowheads[.03], Directive[Black,12]}, {Arrowheads[.03], Directive[Black, 12]}}]

效果:
这里写图片描述

0 0
原创粉丝点击