Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Removing bottom of y axis' topicStudent Support Forum > General > "Removing bottom of y axis"

< Previous CommentHelp | Reply To Comment | Reply To Topic
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: ,

Subject (listing for 'Removing bottom of y axis')
Author Date Posted
Removing bottom of y axis Ryan 06/29/12 10:29am
Re: Removing bottom of y axis Michael 06/29/12 8:12pm
Re: Removing bottom of y axis yehuda 06/30/12 3:20pm
Re: Removing bottom of y axis yehuda 07/01/12 03:45am
< Previous CommentHelp | Reply To Comment | Reply To Topic