Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*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 2002

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

Search the Archive

RE: Tick marks at frame edges

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32274] RE: [mg32235] Tick marks at frame edges
  • From: "David Park" <djmp at earthlink.net>
  • Date: Wed, 9 Jan 2002 23:37:46 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Jun Lin,

Using the CustomTicks command in the DrawGraphics package, available at my
web site, this is fairly easy. Here is an example:

Needs["DrawGraphics`DrawingMaster`"]

f[t_] := t^2

Draw2D[
 {Draw[Sin[f[t]], {t, 0, 2}]},
 Frame -> True,
 FrameTicks -> {Automatic, Automatic,
     CustomTicks[Sqrt[#1] & , {0, 4, 1, 4}],
     Automatic}];

The lower tick marks are now evenly spaced and go from 0 to 2. The upper
tick marks are quadratically spaced and go from 0 to 4 in steps of 1 with 4
subdivisions. The first argument in CustomTicks is a pure function that maps
from the tick value to the actual plot coordinate, in this case the inverse
of f.

Evaluating the CustomTicks command and pasting it directly into a regular
Plot statement I get a form you can evaluate without DrawGraphics.

Plot[Sin[f[t]], {t, 0, 2}, Frame -> True,
  FrameTicks -> {Automatic, Automatic,
    {{0, 0, {0.00625, 0}, {}}, {1, 1, {0.00625, 0},
      {}}, {Sqrt[2], 2, {0.00625, 0}, {}},
     {Sqrt[3], 3, {0.00625, 0}, {}},
     {2, 4, {0.00625, 0}, {}}, {1/2, "", {0.00375, 0},
      {}}, {1/Sqrt[2], "", {0.00375, 0}, {}},
     {Sqrt[3]/2, "", {0.00375, 0}, {}},
     {Sqrt[5]/2, "", {0.00375, 0}, {}},
     {Sqrt[3/2], "", {0.00375, 0}, {}},
     {Sqrt[7]/2, "", {0.00375, 0}, {}},
     {3/2, "", {0.00375, 0}, {}}, {Sqrt[5/2], "",
      {0.00375, 0}, {}}, {Sqrt[11]/2, "", {0.00375, 0},
      {}}, {Sqrt[13]/2, "", {0.00375, 0}, {}},
     {Sqrt[7/2], "", {0.00375, 0}, {}},
     {Sqrt[15]/2, "", {0.00375, 0}, {}}}, Automatic}];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/
> From: Jun Lin [mailto:jl_03824 at yahoo.com]
To: mathgroup at smc.vnet.net
>
>
> I tend to plot a curve, y=y(x), where x is also a function of another
> variable, t, x=x(t). So, I want to arrange this curve in a frame such
> that the lower edge of the frame is tick-marked according to t, say
> from 0 to 1, and that the upper edge of the frame is tick-marked
> according to x, say from x(t=0) to x(t=1). I am appreciating with any
> help.
>
> Jun Lin
>



  • Prev by Date: Re: Holding Arguments in a Second Argument List
  • Next by Date: Re: Re: ORDINARY DIFFERENTIAL EQUATION
  • Previous by thread: Re: Tick marks at frame edges
  • Next by thread: arguments/realtime3d