How to specify equal distance interval in matlab plots
Show older comments
I have a set of data. I want to plot this data at equal intervals but this data is clustered at some location (top and bottom axis). I am using this command (1:3:length(vel)) but this is reading every 3rd data, but at a specific location I want more data and on the other side I want less data. How can I do this?
I have attached a code below mentioning the data and the figure also. In this figure I want less data on both top and bottom (Important to show this also on graph) x-axis while in between the axises I want more data point. How Can I do this.
data = xlsread("hello.xlsx");
vel = data(:,1);
Min = data(:,3);
Mod = data(:,5);
Maj = data(:,7);
Col = data(:,9);
plot(vel,Min,'--k+', 'MarkerSize',7,'linewidth', 1.5,'MarkerIndices',1:3:length(vel))
hold on
plot(vel,Mod,'--bo', 'MarkerSize',7,'linewidth', 1.5,'MarkerIndices',1:4:length(vel))
plot(vel,Maj,'--gs', 'MarkerSize',7,'linewidth', 1.5,'MarkerIndices',1:5:length(vel))
plot(vel,Col,'--r*', 'MarkerSize',7,'linewidth', 1.5,'MarkerIndices',1:6:length(vel))
hold off
%grid on
Thanks in advance...
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Identification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!