MathGroup Archive 2005

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

Search the Archive

Re: GridLines issue

  • To: mathgroup at
  • Subject: [mg57218] Re: [mg57172] GridLines issue
  • From: "David Park" <djmp at>
  • Date: Sat, 21 May 2005 02:39:33 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Using the DrawGraphics package from the Mathematica page on my web site
below I would do this in the following manner.


Draw2D[{Draw[Sin[x], {x, 0, 6Pi}]},
    Frame -> True,
    FrameTicks -> {CustomTicks[Identity, {0, 6Pi, Pi, 4}],
        CustomTicks[Identity, {-1, 1, 0.2, 5}, CTNumberFunction -> Chop],
        CustomTicks[Identity, {0, 6Pi, Pi, 4}, CTNumberFunction -> ("" &)],
        CustomTicks[Identity, {-1, 1, 0.2, 5}, CTNumberFunction -> ("" &)]},
    GridLines -> {CustomGridLines[Identity, {0, 6Pi, Pi/2}, {Gainsboro}],
        CustomGridLines[Identity, {-1, 1, 0.2}, {Gainsboro}]},
    PlotLabel -> "Plot With Custom Grid and Ticks",
    Background -> Linen,
    ImageSize -> 450];

I made several modifications from your initial specification. I used a plot
frame instead of Axes. With an axes plot such as this the x-tick labels
appear right in the middle of the plot and step all over the curve. If you
look in Science magazine, for example, you will never see axes plots but
always frame plots.

Secondly, instead of using Red for the grid lines I used Gainsboro, which is
a very light gray. Again, Red grid lines would step all over the curve. It
is the curve and not the grid lines that is important. By using light gray
or Gainsboro we are using Edward Tufte's principle of "minimum effective
difference" to put in ancillary information.

David Park
djmp at

From: marloo3 at [mailto:marloo3 at]
To: mathgroup at

hi all
how could i color the gridlines in the plot:
Plot[Sin[x], {x, 0, 6Pi},
    Ticks -> {{0, Pi/2, Pi,3Pi/2, 2Pi},
      GridLines -> Automatic];
 only in Red while the plot in Black, and to make the gridlines pass
only on the spacings of Pi/2 for all the plot range and pass horizontally on
spacings of 0.2 and not of 0.5 as it is automatically.


  • Prev by Date: Re: Export, Import, Convert Types Again?
  • Next by Date: Re: Export, Import, Convert Types Again?
  • Previous by thread: Re: GridLines issue
  • Next by thread: Export, Import, Convert Types Again?