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

MathGroup Archive 2009

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

Search the Archive

Re: Setting GridLines style for major and minor grid lines

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100572] Re: Setting GridLines style for major and minor grid lines
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Mon, 8 Jun 2009 02:07:47 -0400 (EDT)
  • References: <h0fvl0$rcj$1@smc.vnet.net>

To draw only the major y-grid lines this simple option works great:

LogLogPlot[x, {x, 1, 10^6}, GridLines -> {None, 10^Range[10]}]

Indeed, I don't think Mathematica does have a major/minor grid
specification, but it's really, really easy to generate yourself (plus
this mechanism gives you much more flexibility):

LogLogPlot[x, {x, 1, 10^6},
 GridLines -> {None,
   Flatten[Table[{i 10^j,
      If[i == 1, GrayLevel[0], GrayLevel[0.9]]}, {j, 0, 6}, {i, 9}],
    1]}]

Cheers -- Sjoerd

On Jun 7, 11:01 am, dg <davide.guari... at gmail.com> wrote:
> I am drawing a log plot. Because it spans many decades, the grid lines
> look horrible in the default setting (they completely overwhelm the
> plot). What I want is to only draw the grid lines for the major grid
> (for the y axis). I was looking at a way to specify the style of the
> gridlines separately for major and minor grid WITHOUT having to
> generate all the gridline locations myself. Unfortunately is seems
> that in Mathematica 7 GridLinesStyle->{xstyle,ystyle} is the only availab=
le
> option. It would be SOOOO MUCH BETTER if Mathematica would have:
>
> GridLinesStyle->{{xMajorStyle,xMinorStyle},{yMajorStyle,yMinorStyle}}
>
> Any other easy way to achieve this?
>
> I find that Mathematica still has many irritating limitations with plots.
> This is only one I have run into.
>
> TIA



  • Prev by Date: Re: Polygon Union
  • Next by Date: Re: Mathematica bug??
  • Previous by thread: Setting GridLines style for major and minor grid lines
  • Next by thread: RE: Setting GridLines style for major and minor grid lines