MathGroup Archive 2003

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

Search the Archive

RE: Position of tick labels in 2D plots

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38813] RE: [mg38800] Position of tick labels in 2D plots
  • From: "David Park" <djmp at earthlink.net>
  • Date: Tue, 14 Jan 2003 06:11:05 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Damon,

Use a Frame and suppress two of the sides. Here is an example for a negative
sine wave. When the ticks are put along the top of the frame the labels are
automatically above.

xticks = Join[Table[{x, x, {0, 0.00625}}, {x, 0, 3, 0.5}],
      Table[{x, "", {0, 0.00375}}, {x, 0, 3, 0.1}]];

yticks = Join[Table[{y, y, {0, 0.00625}}, {y, -1, 0, 0.2}],
      Table[{y, "", {0, 0.00375}}, {y, -1, 0, 0.04}]];

Plot[-Sin[x], {x, 0, Pi},
    Frame -> {False, True, True, False},
    FrameTicks ->
      {None,
        yticks,
        xticks,
        None},
    ImageSize -> 400
    ];

The DrawGraphics package at my web site has a CustomTicks function that
makes it a little easier to specify ticks and also to produce
transformations to the tick scales.

Needs["DrawGraphics`DrawingMaster`"]

xticks = CustomTicks[Identity, {0, 3.5, 0.5, 5}, CTTickSpecs -> {0,
0.00625},
      CTUnLabTickSpecs -> {0, 0.00375}];

yticks = CustomTicks[Identity, {-1, 0, 0.2, 5}, CTTickSpecs -> {0, 0.00625},
      CTUnLabTickSpecs -> {0, 0.00375}];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/



From: D.J. Wischik [mailto:djw1005 at cus.cam.ac.uk]
To: mathgroup at smc.vnet.net

I have a 2D plot, whose PlotRange is {{0,10},{-5,0}}. Since all the action
takes place in the lower right hand quadrant, I would like the tick
marks and the numbers on the axes to be positioned outside this quadrant:
thus
       2   4   6   8
       |   |   |   |
     ----------------
     |
 -2 -|
     |
 -4 -|
     |

I am using the Ticks option, to ensure that the tick marks are drawn
above the x-axis and to the left of the y-axis. The tick labels for
the y-axis are automatically drawn to the left of the y-axis, but
those for the x-axis default to below the x-axis.

How can I change this behaviour?

Damon Wischik.



  • Prev by Date: Re: Position of tick labels in 2D plots
  • Next by Date: Re: successive over relaxation
  • Previous by thread: Re: Position of tick labels in 2D plots
  • Next by thread: RE: Position of tick labels in 2D plots