Got Questions? Get Answers.
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:
how to add a minor grid in a graph in matlab

Subject: how to add a minor grid in a graph in matlab

From: stellakr08

Date: 3 Sep, 2008 12:04:59

Message: 1 of 3

Hello I want to add minor grid in matlab but with the step i want and i dont know the command. For example my ticks is from 0 to 400 and the step is 50 so the grid start with a step of 50 but i would like to have minor grid with a step of 25...how can i do that...Can someone inform me please?

Subject: how to add a minor grid in a graph in matlab

From: Walter Roberson

Date: 3 Sep, 2008 16:36:00

Message: 2 of 3

stellakr08 wrote:
> Hello I want to add minor grid in matlab but with the step i want and i dont
> know the command. For example my ticks is from 0 to 400 and the step is 50 so
> the grid start with a step of 50 but i would like to have minor grid with a step
> of 25...how can i do that...Can someone inform me please?

You can use

grid minor

to turn on the minor grid, but Matlab does not supply any axes property to
allow you to control the spacing explicitly: it always automatically determines
the spacing it will use for the minor grid lines.

There might perhaps be a Matlab File Exchange (FEX) contribution that would
assist in this?

--
Q = quotation(rand);
if isempty(Q); error('Quotation server filesystem problems')
else sprintf('%s',Q), end

Subject: how to add a minor grid in a graph in matlab

From: heiko_marx@hotmail.com

Date: 4 Sep, 2008 13:03:40

Message: 3 of 3

On 3 Sep., 18:36, Walter Roberson <rober...@hushmail.com> wrote:
> stellakr08 wrote:
> > Hello I want to add minor grid in matlab but with the step i want and i dont
> > know the command. For example my ticks is from 0 to 400 and the step is 50 so
> > the grid start with a step of 50 but i would like to have minor grid with a step
> > of 25...how can i do that...Can someone inform me please?
>
> You can use
>
> grid minor
>
> to turn on the minor grid, but Matlab does not supply any axes property to
> allow you to control the spacing explicitly: it always automatically determines
> the spacing it will use for the minor grid lines.
>
> There might perhaps be a Matlab File Exchange (FEX) contribution that would
> assist in this?
>
> --
> Q = quotation(rand);
> if isempty(Q); error('Quotation server filesystem problems')
> else sprintf('%s',Q), end

Hi.

Another way might be to set the major tick to the minor tick positions
you want, to have a controllable tick, and label only the major
ticks.

Heiko

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