MathGroup Archive 2006

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

Search the Archive

Re: Re: Re: Colored Tick Labels?


Of course, that workaround doesn't help much if your ticks labels were
less compatible with base 10, eg,
    Ticks->{{Pi/7, 2 Pi/7, 3Pi/7, ...


On Jun 8, 2006, at 3:53 AM, Bruce Miller wrote:

> A workaround for this is to Rationalize the numbers you are borrowing.
>
> In[2]:= plt = Plot[Sin[t], {t, 0, 2},PlotLabel -> 1,
>      Ticks->{{1/2,1,3/2,2},Automatic}];
>
> In[3]:= AbsoluteOptions[plt, PlotLabel]
>
> Out[3]= {PlotLabel -> 1}
>
> In[4]:= ao = AbsoluteOptions[plt,Ticks][[1,2,1]]
>
> Out[4]= {{0.5, 0.5, {0.00625, 0.},
>      {GrayLevel[0.], AbsoluteThickness[0.25]}},
>
>    {1., 1., {0.00625, 0.},
>      {GrayLevel[0.], AbsoluteThickness[0.25]}},
>
>    {1.5, 1.5, {0.00625, 0.},
>      {GrayLevel[0.], AbsoluteThickness[0.25]}},
>
>   {2., 2., {0.00625, 0.},
>      {GrayLevel[0.], AbsoluteThickness[0.25]}}}
>
> In[5]:= Plot[Cos[x],{x,0,2}, Ticks->{Rationalize[ao],Automatic}];
>
>
> Bruce Miller
> Technical Support
> Wolfram Research, Inc.
> support at wolfram.com
> http://support.wolfram.com/
>
>
>
> On Jun 6, 2006, at 5:27 AM, Gianluca Gorni wrote:
>
>> Unfortunately it seems that AbsoluteOptions[] applies N[]
>> to all its output. Tick labels that were not floating-point
>> numbers will get corrupted.
>>
>> For example try with
>>
>> AbsoluteOptions[Plot[Sin[x], {x, 0, Pi}, Ticks -> {{E}, {1/2}}], 
>> Ticks]
>>
>> Any exact numeral in PlotLabel will be affected too.
>>
>> I sent a report to wri about this in 2003.
>>
>> Gianluca Gorni
>>
>> On 4 giu 2006, at 07:10, bghiggins at ucdavis.edu wrote:
>>
>>>  Not sure I have a complete answer, but here are some possibilities 
>>> to
>>> examine:
>>>
>>> Suppose you have the following plot
>>>
>>> plt = Plot[Sin[x], {x, -1, 1}]
>>>
>>> You can extract the Ticks from this plot using AbsoluteOptions and
>>> then
>>> modify them. In the following example I make the x tick values Blue
>>> and
>>> the y tick values Red
>>>
>>> myTicks = {(Ticks /. AbsoluteOptions[plt,
>>>             Ticks])[[1]] /. {x_Real, y_Real, z__} -> {x, StyleForm[y,
>>>         FontColor ->  Blue], z}, (Ticks /. AbsoluteOptions[plt,
>>> Ticks])[[
>>>         2]] /. {x_Real, y_Real, z__} -> {x,
>>>             StyleForm[y, FontColor -> Red], z}}
>>


  • Prev by Date: Re: rules for using functions as basis vectors
  • Next by Date: Re: Using a list as a variable
  • Previous by thread: Re: Re: Re: Colored Tick Labels?
  • Next by thread: RE: Colored Tick Labels?