Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Serious Problem with GridLines

125 views
Skip to first unread message

David Park

unread,
Aug 2, 2007, 4:00:11 AM8/2/07
to
Pre-Version 6 Mathematica had an obscure option AxesFront that was buried in
the Graphics`FilledPlot` package. This option, when set to True, would
ensure that both the axes and any GRID LINES were always in front of any
other graphics. I always thought that they should make AxesFront a general
Graphics option.

What WRI did instead, in Version 6, is automatically ensure that axes (along
with their ticks and labels) are always in front and they let GridLines take
the hindmost. There is no longer any (simple) way to force grid lines to be
in front.

In the documentation they state: "In some plots, grid lines can be
completely occluded by the image. Mesh can be used instead, to place the
lines above the graphic." But this will only work for plots like
DensityPlot. Generally, Mesh is no substitute at all for GridLines. Consider
the following plot:

ListLogPlot[Table[PartitionsQ[n], {n, 50}],
Filling -> Bottom,
FillingStyle -> Lighter@Orange,
Joined -> True,
Frame -> True,
Mesh -> True,
GridLines -> Automatic,
GridLinesStyle -> LightGray]

Using Mesh only puts dots along the curve. We could obtain a partial
solution by using Opacity on the filling along with darker grid lines:

ListLogPlot[Table[PartitionsQ[n], {n, 50}],
Filling -> Bottom,
FillingStyle -> Opacity[0.6, Lighter@Orange],
Joined -> True,
Frame -> True,
GridLines -> Automatic,
GridLinesStyle -> Gray]

but I prefer to keep the grid lines quite faint.

If we are to lose the choice then it would be much better if GridLines were
treated the same as Axes and were always automatically in front.

--
David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/

Jens-Peer Kuska

unread,
Aug 3, 2007, 6:56:10 AM8/3/07
to
Hi,

if there would not be a bug in FullGraphics[], that remove the
axes labels, than

gr = ListLogPlot[Table[PartitionsQ[n], {n, 50}], Filling -> Bottom,


FillingStyle -> Lighter@Orange, Joined -> True, Frame -> True,

Mesh -> True, GridLines -> Automatic, GridLinesStyle -> LightGray];

Show[FullGraphics[gr], AspectRatio -> 1]

would bring the grid lines in front.

Regards
Jens

David Park

unread,
Aug 4, 2007, 6:22:02 AM8/4/07
to
I reveived a nice answer from Chris Chiasson who passed on an answer from
James Mulnix at WRI Technical Support.

It appears that Graphics now has Method as an option and among the methods
are the following:

Method -> {"AxesInFront" -> True/False}
Method -> {"GridLinesInFront" -> True/False}

and that gives the control we need.


"David Park" <djm...@comcast.net> wrote in message
news:f8s2ub$1q3$1...@smc.vnet.net...

Daniel Flatin

unread,
Aug 6, 2007, 3:47:32 AM8/6/07
to
On 2007-08-04 06:22:02 -0400, "David Park" <djm...@comcast.net> said:

> I reveived a nice answer from Chris Chiasson who passed on an answer from
> James Mulnix at WRI Technical Support.
>
> It appears that Graphics now has Method as an option and among the methods
> are the following:
>
> Method -> {"AxesInFront" -> True/False}
> Method -> {"GridLinesInFront" -> True/False}
>
> and that gives the control we need.

This is nowhere in the package documentation. Three years ago Ted Ersek
published the last update to his Mathematica Tips and Tricks notebook
and website:

<http://www.verbeia.com/mathematica/tips/HTMLLinks/Tricks_Misc_9.html>

In one section he mentioned how some functionality of Mathematica is
not documented anywhere in the distribution, and it appears to have
only gotten worse. He included a URL to a Wolfram documentation page:

<http://support.wolfram.com/mathematica/kernel/Symbols/>

Checking this page for "Method" or for "GridLinesInFront" fails to
reveal anything about this functionality.


Chris Chiasson

unread,
Aug 16, 2007, 4:59:25 AM8/16/07
to
On Aug 6, 2:47 am, Daniel Flatin <dflatin@are_sea_en.com> wrote:

> On 2007-08-04 06:22:02 -0400, "DavidPark" <djmp...@comcast.net> said:
>
> > I reveived a nice answer from Chris Chiasson who passed on an answer from
> > James Mulnix at WRI Technical Support.
>
> > It appears that Graphics now has Method as an option and among the methods
> > are the following:
>
> > Method -> {"AxesInFront" -> True/False}
> > Method -> {"GridLinesInFront" -> True/False}
>
> > and that gives the control we need.
>
> This is nowhere in the package documentation. Three years ago Ted Ersek
> published the last update to his Mathematica Tips and Tricks notebook
> and website:
>
> <http://www.verbeia.com/mathematica/tips/HTMLLinks/Tricks_Misc_9.html>
>
> In one section he mentioned how some functionality of Mathematica is
> not documented anywhere in the distribution, and it appears to have
> only gotten worse. He included a URL to a Wolfram documentation page:
>
> <http://support.wolfram.com/mathematica/kernel/Symbols/>
>
> Checking this page for "Method" or for "GridLinesInFront" fails to
> reveal anything about this functionality.

That is not surprising given that GridLinesInFront is not a symbol
(AFAIK). This is almost certainly something they considered ahead of
time. They probably don't want (what would be) a bunch of option
symbols cluttering up their namespace. However, I think not making
them symbols also has disadvantages. Not being able to enumerate some
options using Name is probably high on the list.


0 new messages