MathGroup Archive 2009

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

Search the Archive

Re: How to obtain FrameTicks List from an existing Plot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103776] Re: [mg103749] How to obtain FrameTicks List from an existing Plot?
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Mon, 5 Oct 2009 13:17:18 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

t = Range[5];
p = ListPlot[t, Frame -> True];

FrameTicks /. AbsoluteOptions[p]


Bob Hanlon

---- Nasser Abbasi <nma at 12000.org> wrote: 

=============
I have a need to obtain the FrameTicks list from an existing plot. The reason I want to do this, is because I need to slightly modify the ticks, and then redraw the plot with the new Ticks. This would be much easier than having to generate the Ticks myself in the first place.

This is an example:

t = Range[5];
p = ListPlot[t, Frame -> True]

But when I look at FullForm[p], I see no list would would look like the FrameTicks, which should be something like  =
[{x1,label},{x2,label},.....]

Here is the full form of p

In[103]:= FullForm[p]
Out[103]//FullForm= FullForm[Graphics[{Hue[0.67, 0.6, 0.6],
    Point[{{1., 1.}, {2., 2.}, {3., 3.}, {4., 4.},
      {5., 5.}}]}, {AspectRatio -> GoldenRatio^(-1),
    Axes -> True, AxesOrigin -> {0, Automatic},
    Frame -> True, PlotRange -> Automatic,
    PlotRangeClipping -> True}]]

Again, I was hoping to obtain the [{x1,label},{x2,label},.....] list from Mathematica (let it do the hardwork), and then I wanted to just 'shift' the position of the ticks a little by having a loop with adds some delta to each x_i, then I would redraw the ListPlot with my new FrameTicks.

If FrameTicks are not in the FullForm[], then they must be hiding somewhere else, but where?

Any idea if this is possible?

Thank you,
--Nasser



  • Prev by Date: Re: Re: confused about == vs === in this equality
  • Next by Date: Colorfunction + parametricplot3d + plotrange = ?
  • Previous by thread: Re: using fourier transforms in mathematica
  • Next by thread: Colorfunction + parametricplot3d + plotrange = ?