Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Rotating tick marks

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29805] Re: [mg29756] Rotating tick marks
  • From: Omega Consulting <pptssman at yahoo.com>
  • Date: Wed, 11 Jul 2001 01:26:53 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

At 01:26 AM 7/7/2001, Catherine Neish wrote:
>Hi there.
>
>I have created a 2D graphic in which I specified the tick marks on the
>y-axis.  These tick labels are relatively long, and "stick out" horizontally
>from the frame.  Is there any way to rotate them?  As it is right now, the
>figure has a large amount of unnecessary white space surrounding it due to
>these ticks.
>
>I tried to use RotateLabel, but I believe that only applies to the frame
>labels.  Any help you could provide on this matter would be greatly
>appreciated.
>
>Sincerely,
>
>Catherine Neish

There's no way to create rotated Ticks, but you can create rotated text.

In[]:=
pl=Plot[x,{x,0,1}];

Fortunately, you can convert the Ticks into Text with FullGraphics.

In[]:=
fg=FullGraphics[pl];

In[]:=
Cases[fg, _Text,{3}]

Out[]=
{Text[0.2,{0.2,-0.0212367},{0.,1.}],Text[0.4,{0.4,-0.0212367},{0.,1.}],
   Text[0.6,{0.6,-0.0212367},{0.,1.}],Text[0.8,{0.8,-0.0212367},{0.,1.}],
   Text[1,{1.,-0.0212367},{0.,1.}],Text[0.2,{-0.013125,0.2},{1.,0.}],
   Text[0.4,{-0.013125,0.4},{1.,0.}],Text[0.6,{-0.013125,0.6},{1.,0.}],
   Text[0.8,{-0.013125,0.8},{1.,0.}],Text[1,{-0.013125,1.},{1.,0.}]}

You can then tweak the Text you want to rotate. Also, you usually have to 
set the PlotRange.

In[]:=
rot=Show[fg/.Text[expr_,{x_,y_/;(-.1<y<0)},offset_]->
           Text[expr,{x,y},offset,{0,1}],
       PlotRange->{{-.2,1.1},{-.2,1.1}}];



  • Prev by Date: Re: Can This Be Made Cleaner
  • Next by Date: RE: Can Anyone Help With This?
  • Previous by thread: RE: Rotating tick marks
  • Next by thread: Reply: a couple of gripes