MathGroup Archive 2005

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

Search the Archive

Re: Re: Setting gridlines thickness in Plot

  • To: mathgroup at
  • Subject: [mg59033] Re: [mg58959] Re: [mg58939] Setting gridlines thickness in Plot
  • From: Omega Consulting <info at>
  • Date: Wed, 27 Jul 2005 01:25:04 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

This is a case where AbsoluteOptions can be very useful.

Plot with the default set of lines.

In[1]:= pl=Plot[x,{x,0,1}, GridLines->Automatic, Frame->True]

AbsoluteOptions gives the explicit setting equivalent to the Automatic 

In[2]:= {lines, ticks} = {GridLines, FrameTicks} /. AbsoluteOptions[pl];

Here's what 1 gridline looks like.

In[3]:= lines[[1,1]]
Out[3]= {0.,{RGBColor[0.,0.,0.5],AbsoluteThickness[0.25]}}

We then alter the lines and ticks to the form we want.

In[4]:= newlines = lines /._AbsoluteThickness->AbsoluteThickness[1.25];

In[5]:= newticks = ticks/._AbsoluteThickness->AbsoluteThickness[1];

And plot again with the new settings.

In[6]:= Plot[x, {x, 0, 1}, GridLines -> newlines, Frame -> True,
     FrameStyle -> AbsoluteThickness[2], FrameTicks -> newticks]

Omega Consulting
The final answer to your Mathematica needs.

On Jul 25, 2005, at 12:12 AM, David Park wrote:

> For the frame there is the option FrameStyle.
> If you look at the Help for Ticks and GridLines you will see that 
> there are
> methods for specifying the style of the Lines. However you then have to
> specify all of the ticks and grid lines.
> David Park
> djmp at
> From: carlos at [mailto:carlos at]
To: mathgroup at
> To: mathgroup at
> The problem:
> The default thickness of framelines, gridlines and tickmarks in Plot []
> is 0.25pt.  This is too thin for typical figure reductions in journals
> & books, and
> may disappear from the printed version.
> The question:
> I want to set  the thickness of frameline, gridlines and ticks to 2,
> 1.25 and 1 pt, respectively.  These are good values for typical paper
> figures.  How do I do
> that?
> (At the moment I do it with Illustrator postprocessing)
> Note: the online help is not much help. There a passing mention on
> setting
> Gridlines thickness with PlotStyle, but no examples.  What would be
> nice is to
> reset the defaults once and for all.
> Thanks for any help.

  • Prev by Date: Re: VersionHistory[ commandName] would be nice (was Mathematica 5.2: The 64-bit and...)
  • Next by Date: Re: Problem with loading SuperWidgetPackage
  • Previous by thread: Re: Setting gridlines thickness in Plot
  • Next by thread: rotate frametick labels