Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Grid in log-scale figures

Subject: Grid in log-scale figures

From: steiner@ieee.org (Rene' STEINER)

Date: 25 Jun, 2001 11:35:31

Message: 1 of 2


  Hello!

  Is there a way to precisely state which grid lines are drawn when
using log-scale figures? Depending on the number of ticks, Matlab
plots grid lines between two tick marks or not.

  E.g., using the following code on my 800x600 resolution Win NT-PC,
ML 6.0 plots grid lines between the powers of 10 (indicating [1e0 2e0
3e0 ... 8e5 9e5 1e6]) :

figure;
set(gca,'XScale','log','XLim',[1e0 1e6],'XGrid','on');
set(gca,'XTick',[1e0 1e1 1e2 1e3 1e4 1e5 1e6]);

  However, using

set(gca,'xtick',[1e0 1e2 1e3 1e4 1e5]);

just draws grid lines where I want them to be (i.e. at the powers of
10).

  Any guess how to switch off the additional grid lines in the first
case?

  
  Happy Matlabing,

    Rene'


--
Rene' STEINER steiner@ieee.org www.sbox.TUGraz.at/home/s/steiner
Space Research Institute Austrian Academy of Sciences
Spouse, n.: Someone who'll stand by you through all the trouble you
            wouldn't have had if you'd stayed single.

Subject: Grid in log-scale figures

From: Ali

Date: 12 Jun, 2012 13:13:07

Message: 2 of 2

steiner@ieee.org (Rene' STEINER) wrote in message <3b37199a.16239811@news.oeaw.ac.at>...
>
> Hello!
>
> Is there a way to precisely state which grid lines are drawn when
> using log-scale figures? Depending on the number of ticks, Matlab
> plots grid lines between two tick marks or not.
>
> E.g., using the following code on my 800x600 resolution Win NT-PC,
> ML 6.0 plots grid lines between the powers of 10 (indicating [1e0 2e0
> 3e0 ... 8e5 9e5 1e6]) :
>
> figure;
> set(gca,'XScale','log','XLim',[1e0 1e6],'XGrid','on');
> set(gca,'XTick',[1e0 1e1 1e2 1e3 1e4 1e5 1e6]);
>
> However, using
>
> set(gca,'xtick',[1e0 1e2 1e3 1e4 1e5]);
>
> just draws grid lines where I want them to be (i.e. at the powers of
> 10).
>
> Any guess how to switch off the additional grid lines in the first
> case?
>
>
> Happy Matlabing,
>
> Rene'
>
>
> --
> Rene' STEINER steiner@ieee.org www.sbox.TUGraz.at/home/s/steiner
> Space Research Institute Austrian Academy of Sciences
> Spouse, n.: Someone who'll stand by you through all the trouble you
> wouldn't have had if you'd stayed single.

set(gca,'XMinorGrid','Off');

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us