Plotting Piecewise function, ExclusionsStyle not shown completely

Suppose I define

f[x] := Piecewise[{{1.7*10^-6, 150 <= x <= 200}}, 0]


and then plot

Plot[Evaluate[f[x]], {x, 0, 1000}, PlotStyle -> {Red, Thick},
ExclusionsStyle -> {Dashed, Red}]


I get an interrupted dashed vertical line on left

Anyone know why this happens and how to draw the entire dashed line?

-
Just increase your PlotPoints e.g. PlotPoints->100. – Spawn1701D Apr 18 '13 at 21:02
@Spawn1701D Cheers! Can you provide this as an answer so I can accept it? – Name Apr 18 '13 at 21:40
Very trivial to worth an answer. If you want just upvote the comment instead. Cheers! – Spawn1701D Apr 18 '13 at 21:45

Mathematica's plot algorithms are not optimized when values become very large or in your case very small. You could include your plot in a Manipulate to see the behavior when you adjust e.g. PlotPoints

f[x_] := Piecewise[{{1.7*10^-6, 150 <= x <= 200}}, 0];
Manipulate[
Plot[Evaluate[g[x]], {x, 0, 1000}, PlotStyle -> None,
ExclusionsStyle -> {Dashed, Red}, PlotPoints -> n,
PerformanceGoal -> "Quality", Mesh -> All],
{n, 20, 100, 1}]


And now you could replace your function f with an equivalent function g which returns 1 and not the very small number. Then you'll see the the plot behaves much better with different settings for PlotPoints

g[x_] := Piecewise[{{1, 150 <= x <= 200}}, 0]

-