Set Axis With Interval

700 views (last 30 days)
Vinicius Antunes
Vinicius Antunes on 30 Jul 2014
Hello Everybody!
I want to know how can I set the axis using interval, for example:
>> a = rand(10);
>> plot(a)
>> Min = 2;
>> Max = 4;
>> set(gca,'XLim',[Min:0.15:Max]) -> Doesn't work!!
I know that the correct syntax is "set(gca,'XLim',[Min Max])" but, I want to use interval.
Ideas?
Thank you!

Accepted Answer

Ben11
Ben11 on 30 Jul 2014
Maybe use XTick:
set(gca,'XLim',[2 4])
set(gca,'XTick',(2:0.15:4))
  3 Comments
Stelios Fanourakis
Stelios Fanourakis on 13 May 2019
Hi. How can someone estimate the average of y values for every interval of the x axis as you state it?

Sign in to comment.

More Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 30 Jul 2014
set(gca,'xtick', your_interval)
  2 Comments
Stelios Fanourakis
Stelios Fanourakis on 13 May 2019
Hi. How can someone estimate the average of y values for every interval of the x axis as you state it?

Sign in to comment.

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by