Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

How to obtain FrameTicks List from an existing Plot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103749] How to obtain FrameTicks List from an existing Plot?
  • From: "Nasser Abbasi" <nma at 12000.org>
  • Date: Mon, 5 Oct 2009 07:36:11 -0400 (EDT)
  • References: <20091003104738.LCJ3I.416659.imail@eastrmwml34> <200910040935.FAA07794@smc.vnet.net> <34c814850910040911w2849b5aaq94d5bdd5aba8220e@mail.gmail.com>
  • Reply-to: "Nasser Abbasi" <nma at 12000.org>

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: Paper heading: does not work?
  • Next by Date: Re: Incorrect symbolic improper integral
  • Previous by thread: confused about == vs === in this equality
  • Next by thread: Re: confused about == vs === in this equality