Re: controlling the size of tick marks
- To: mathgroup at smc.vnet.net
- Subject: [mg16925] Re: controlling the size of tick marks
- From: "P.J. Hinton" <paulh>
- Date: Thu, 8 Apr 1999 02:32:34 -0400
- Organization: "Wolfram Research, Inc."
- Sender: owner-wri-mathgroup at wolfram.com
On 6 Apr 1999, Richard S Hsu wrote: > I tried the example you gave and got a error message. > > In[1]:= enlargeTicks[grObj_Graphics] := Module[{fulopts, tcklst}, > fulopts = FullOptions[grObj]; > tcklst = Ticks /. fulopts /. {loc_, lab_, len:{_, _}, > sty:{___}} -> {loc, lab, 2*len, sty}; > grObj /. Graphics[prims_, (opts__)?OptionQ] :> > Display[$Display, Graphics[prims, Ticks -> tcklst, > opts]]] > > In[2]:= Plot[Sin[x], {x, 0, 2Pi}, DisplayFunction -> enlargeTicks] > Show::gmed: No graphics output medium specified. The source of this user's problem was that I had negelected to test this code with a shell-based interface, where motifps would be rendering the PostScript rather than the notebook front end. In that case, $Display is set to not set in such a way that this method will function properly. Here is a rewrite of the code that should work with both methods. enlargeTicks[grObj:Blank[Graphics]] := Module[{fulopts, tcklst}, fulopts = FullOptions[grObj]; tcklst = Ticks /. fulopts /. {loc_, lab_, len:{_, _}, sty:{___}} -> {loc, lab, 2*len, sty}; grObj /. Graphics[prims_, (opts__)?OptionQ] :> $DisplayFunction[Graphics[prims, Ticks -> tcklst, opts]]] -- P.J. Hinton Mathematica Programming Group paulh at wolfram.com Wolfram Research, Inc. http://www.wolfram.com/~paulh/ Disclaimer: Opinions expressed herein are those of the author alone.