MathGroup Archive 2005

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

Search the Archive

Re: Re: GridLines

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55283] Re: [mg55245] Re: GridLines
  • From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
  • Date: Fri, 18 Mar 2005 05:34:04 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

 

>-----Original Message-----
>From: adamizer [mailto:adam.smith at hillsdale.edu] 
To: mathgroup at smc.vnet.net
>Sent: Thursday, March 17, 2005 9:30 AM
>To: mathgroup at smc.vnet.net
>Subject: [mg55283] [mg55245] Re: GridLines
>
>Give this a try:
><<Graphics`Colors`
>
>I just load the above package to avoid having to use the
>RGBColor[1,0,0] form for the different colors.  I took the liberty of
>showing how to dash the grids as well as change the colors.
>
>Plot[Sin[x], {x, 0, 10},
>    GridLines -> {{Automatic, {Dashing[{0.05, 0.05}],
>            Yellow}}, {Automatic, {Dashing[{0.1, 0.1}], Green}}}];
>
>I have noted at least one buggy behavior.  The color only works with
>the Automatic option.  Without the color and dashing one can specify
>specifically where to put the grids (similar to Ticks) with a list such
>at:
>
>GridLines ->{{0,Pi,2 Pi,3 Pi},{-1,-0.5,0,0.5,1}}
>
>Which works fine.  But I could not get Mathematica to do the
>user-defined grid and colors.  Maybe someone else out there knows how.
>
>Adam Smith
>Steve Gray wrote:
>> 1. Help says that the default color of GridLines is light blue, but
>mine are black. ?? LightBlue
>> would be much better.
>> 2. Is there a way to control the color of GridLines in Show? There
>seems to be no such thing as
>> GridStyle, GridColor, GridLineStyle, etc.
>> 
>> Thank you for any info.
>
>


You then have to repeat the styles for each grid line spec.:


Plot[Sin[x], {x, 0, 10}, 
  GridLines -> {Map[
        Prepend[{{Dashing[{0.05, 0.05}], Yellow}}, #] &, {2, 5, 8}], 
      Map[Prepend[{{Dashing[{0.1, 0.1}], Green}}, #] &, {-.5, .5}]}, 
  Background -> GrayLevel[.9]]

-- or:

Plot[Sin[x], {x, 0, 10}, 
  GridLines -> {Outer[Sequence, {2, 5, 8}, {{Dashing[{0.05, 0.05}],
Yellow}}, 
        1], Outer[Sequence, {-.5, .5}, {{Dashing[{0.1, 0.1}], Green}},
1]}, 
  Background -> GrayLevel[.9]]


--
Hartmut Wolf


  • Prev by Date: Re: How can I compute the Fourier transform of a unit disk and a unit ball analytically by using Mathematica?
  • Next by Date: Re: Add new option to Notebook[]
  • Previous by thread: Re: GridLines
  • Next by thread: bug in series expansion routines.