How to increase spacing between axis ticks in plot with a lot of data

70 Ansichten (letzte 30 Tage)
I have a plot that contains quite a lot of data that has key points where I need to focus on. My plot is a scatter plot, and has two sets of data overlaying one another.
I have set my x and y tick spacing to 0.5, but all this does is just increase the number of grid lines present in the graph. As each tick along my Y axis represents 10cm, this distance is way too much and I am trying to figure out a way to increase the space between each tick mark. So for example, if I were to put a ruler on my screen I would measure 1cm between each 0.5 tick mark. But what I want is the distance between each 0.5m tick mark to be 3cm , or 5cm or whatever I need.
Is there a command or a graph tool I could use to do this?
Example below: The plotted difference between the blue and the red is about 3cm, which is represented way too small on the graph. I want that distance spread out along the Y axis.

Akzeptierte Antwort

Mohammad Sami
Mohammad Sami am 18 Jul. 2022
since your data is only between 62.4 and 62.6, you can limit your y axis to these values using the ylim function.
fakedata = [linspace(62.6,62.4,100)' linspace(62.55,62.45,100)'];
a = axes();
plot(a,fakedata,'.');
ylim(a,[62.4 62.6]);

Weitere Antworten (1)

Chunru
Chunru am 18 Jul. 2022
A figure/screen/paper has limitted size. You may want to display them in subplot to maximize the screen asset.
fakedata = [linspace(62.6,62.4,100)' linspace(62.55,62.45,100)'];
n = size(fakedata, 1);
nsubplot = 4;
nsperplot = ceil(n/nsubplot);
for i=1:nsubplot
idx1 = nsperplot*(i-1) + 1;
idx2 = min(idx1-1 + nsperplot, n);
h(i) = subplot(nsubplot, 1, i);
plot(idx1:idx2, fakedata(idx1:idx2, :),'.');
end
%ylim(a,[62.4 62.6]);

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by