| Author |
Comment/Response |
yehuda
|
07/01/12 03:45am
Actually I liked Michael's solution better than mine, but still it lacks automatization
So, use the following code that will serve better your purpose. You call the function as you call Plot with options etc. It works almost the same (accept if you use the AxesStyle option in the original call, so you shouldn't)
yehuda
(*The code*)
lowPlot[fun_, range_, options___] :=
Module[{g, ar, tt, opts, xx, ymin, ymax},
g = Plot[fun, range, options];
opts = AbsoluteOptions[g, {AspectRatio, Ticks, PlotRange}];
ar = (AspectRatio /. opts);
tt = {(Ticks /. opts)[[1]],
DeleteCases[(Ticks /. opts)[[2]], {y_, ___} /; y < 0]};
{xx, {ymin, ymax}} = (PlotRange /. opts);
Show[g, Ticks -> tt,
AxesStyle -> {Automatic,
If[ymin >= 0, Automatic,
Dashing[{0, -ymin/(ymax - ymin), ymax/(ymax - ymin)}*ar]]}]]
(*and the checking *)
Column[Table[
lowPlot[Sin[t] - i, {t, -2 \[Pi], 2 \[Pi]},
PlotStyle -> Red], {i, -1/2, 1/2, 1/2}]]
URL: , |
|