How to add the grid to a figure

  • Follow


Dear all,

I want to wrtie a procedure to get the similar plot as it below.
http://lh6.ggpht.com/duxiyu/SMZ8O2FYDRI/AAAAAAAAACo/HCWygAzvY60/sample.png
Is there a simple method to add the dashed grid like that?

The vertical dashed lines are easy to be added, becase the duration
for all data is three hours and the interval between tow vertical
lines is 3 min.
Therefore, it is easy to use a loop to plot them.

But I cannot find a universal method to plot the horizontal dashed
lines.
Becase for different data interval, the Y values are different for
each other.
The values of horizontal lines are equal to the major ticks.
Meanwhile, according to the different data set, IDL selected the
different major ticks.
So it is difficult for me to build the procedure which can be applied
to all the data.

Best wishes,

Du
0
Reply duxiyu (97) 9/9/2008 2:02:01 PM

duxiyu@gmail.com writes:

> I want to wrtie a procedure to get the similar plot as it below.
> http://lh6.ggpht.com/duxiyu/SMZ8O2FYDRI/AAAAAAAAACo/HCWygAzvY60/sample.png
> Is there a simple method to add the dashed grid like that?
> 
> The vertical dashed lines are easy to be added, becase the duration
> for all data is three hours and the interval between tow vertical
> lines is 3 min.
> Therefore, it is easy to use a loop to plot them.
> 
> But I cannot find a universal method to plot the horizontal dashed
> lines.
> Becase for different data interval, the Y values are different for
> each other.
> The values of horizontal lines are equal to the major ticks.
> Meanwhile, according to the different data set, IDL selected the
> different major ticks.
> So it is difficult for me to build the procedure which can be applied
> to all the data.

Here is an article:

   http://www.dfanning.com/graphics_tips/grid.html

You can also use the [XYZ]Tick_Get keywords to get the 
major tick values.

Cheers,

David
-- 
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
0
Reply news2122 (4023) 9/9/2008 2:14:34 PM


Thanks a lot!

Du

On Sep 9, 4:14=A0pm, David Fanning <n...@dfanning.com> wrote:
> dux...@gmail.com writes:
> > I want to wrtie a procedure to get the similar plot as it below.
> >http://lh6.ggpht.com/duxiyu/SMZ8O2FYDRI/AAAAAAAAACo/HCWygAzvY60/sampl...
> > Is there a simple method to add the dashed grid like that?
>
> > The vertical dashed lines are easy to be added, becase the duration
> > for all data is three hours and the interval between tow vertical
> > lines is 3 min.
> > Therefore, it is easy to use a loop to plot them.
>
> > But I cannot find a universal method to plot the horizontal dashed
> > lines.
> > Becase for different data interval, the Y values are different for
> > each other.
> > The values of horizontal lines are equal to the major ticks.
> > Meanwhile, according to the different data set, IDL selected the
> > different major ticks.
> > So it is difficult for me to build the procedure which can be applied
> > to all the data.
>
> Here is an article:
>
> =A0 =A0http://www.dfanning.com/graphics_tips/grid.html
>
> You can also use the [XYZ]Tick_Get keywords to get the
> major tick values.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

0
Reply duxiyu (97) 9/9/2008 2:52:04 PM

2 Replies
39 Views

(page loaded in 0.167 seconds)

Similiar Articles:













7/30/2012 4:16:15 AM


Reply: