Re: Forcing a Tick at Zero?
- To: mathgroup at smc.vnet.net
- Subject: [mg33829] Re: [mg33800] Forcing a Tick at Zero?
- From: BobHanlon at aol.com
- Date: Fri, 19 Apr 2002 02:28:06 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 4/16/02 5:33:31 AM, siegman at stanford.edu writes:
>The list produced by the following contains labelled ticks at -20, -10,
>0, 10
>and 20 and unlabelled ticks at -15, -5, 5 and 15, as expected:
>
> xticks = Table[{k, If[Mod[k, 10] == 0, ToString[k], " "]}, {k, -20,
>20, 5}]
>
>But the following still doesn't force a labelled tick at x=0 as wanted:
>
> Plot[ - - - - ,Ticks->{xticks,Automatic}, - - - -]
>
xticks = Table[{k, If[Mod[k, 10] == 0, ToString[k], " "]}, {k, -20, 20, 5}];
You can either move the axes out of the way
Plot[x, {x,-20,20},
Ticks->{xticks,Automatic},
AxesOrigin->{-2.5,0}];
or eliminate the axes
Plot[x, {x,-20,20},
FrameTicks->{xticks,Automatic},
Frame->True,Axes->False];
Bob Hanlon
Chantilly, VA USA