Help plotting specific points

조회 수: 10 (최근 30일)
Seairah Demers
Seairah Demers 2022년 7월 30일
답변: Walter Roberson 2022년 7월 30일
I'm trying to make the x-axis have the points be: 6.0,6.2,6.4,6.6,6.8,7.0,7.2,7.4
and have the y-axis have the points: 0.010,0.011,0.012,0.013,0.014,0.015,0.016,0.017
But I want the specific values of: 0.0126,0.0123,0.0122,0.01186,0.0116,0.0115,0.0114,0.0111 to show up marked on the graph. How would I do this?
I want it to look similar to the graph below.

채택된 답변

Walter Roberson
Walter Roberson 2022년 7월 30일
x = [6.1, 6.085, 6.16, 6.22, 6.515, 6.605, 6.685, 6.75];
y = [0.0126,0.0123,0.0122,0.01186,0.0116,0.0115,0.0114,0.0111];
pointsize = 20;
scatter(x, y, pointsize, 'ro', 'filled', 'MarkerEdgeColor', 'k')
xticks([6.0,6.2,6.4,6.6,6.8,7.0,7.2,7.4])
yticks([0.010,0.011,0.012,0.013,0.014,0.015,0.016,0.017])
xlim([6.0, 7.4]);
ylim([0.01, 0.018])

추가 답변 (1개)

Cris LaPierre
Cris LaPierre 2022년 7월 30일
편집: Cris LaPierre 2022년 7월 30일
plot the data as you normally would (see Ch 9 of MATLAB Onramp if you need help with that). I'd recommend scatter. Then to modify the appearance, use the following functions:

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by