如何去掉不想要的竖线

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

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]}}]

效果:

你可能感兴趣的:(plot)