Re: Re: Setting gridlines thickness in Plot
- To: mathgroup at smc.vnet.net
- Subject: [mg59755] Re: [mg59746] Re: Setting gridlines thickness in Plot
- From: Tom De Vries <tom_toad at telus.net>
- Date: Sat, 20 Aug 2005 03:13:44 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On 8/19/05 2:32 AM, "carlos at colorado.edu" <carlos at colorado.edu> wrote:
> I tried this method and it doesnt work at all. Since there is no
> documentation on the subject [neither the inline help nor the
> Mathematica Book covers it] it is difficult to know what is
> gone wrong. Apparently it is an undocumented interaction of
> RGBColor and Gridlines directives.
>
Hello! If you want to add things like thickness to grid lines, you need a
list for each grid line position, in the form {position, style}, where style
is also a list specifying color, thickness , and dashing
I'm sure others will share some elegant thoughts on this. Here are two
examples, my 2 cents worth....
A plot with a few specific gridlines colored and with different thickness
Plot[x, {x, -5, 5},
GridLines -> {
{
{-5, {Hue[0.2], Thickness[0.002]}},
{-1, {Hue[0.4], Thickness[0.005]}},
{1, {Hue[0.6], Thickness[0.007]}},
{5, {Hue[0.8], Thickness[0.009]}}
},
{
{-4, {Hue[0.3], Thickness[0.002]}},
{4, {Hue[0.5], Thickness[0.005]}}
}
}];
Here is another example with differently colored grid lines
Needs["Graphics`Colors`"]
Plot[Sin[x], {x, -Pi, 3Pi},
PlotStyle -> {Purple},
Ticks -> {Table[n Pi/2, {n, -6, 18}], Table[n/5., {n, -5, 5}]},
GridLines ->
{
Table[{# \[Pi]/6, If[Mod[#, 3] == 0, {Pink}, {LightBlue} ]} & /@ Range[-6,
18]],
Table[{#/10, If[Mod[#, 5] == 0, {Pink}, {LightBlue} ]} & /@ Range[-10, 10]]
},
AxesStyle -> {GrayLevel[0.5], Thickness[0.003]},
ImageSize -> 800];
Hope that helps,
Tom De Vries