How to set x axis in a plot?

1 次查看(过去 30 天)
Hello, I would like to know if is possible to set the X- axis like the plot that I loaded. I make the x-axis in pain just as an example of what I would like to do.

采纳的回答

Chunru
Chunru 2021-11-28
编辑:Chunru 2021-11-28
subplot(6,1,1:5); imagesc([1 8], [14, 22], randi(100,100));
subplot(8,1,8);
imagesc([1 8], 1, [1 2 2 2 2 2 2 3 3]);
set(gca, 'XTick', [], 'YTick', [])
text(4, 1, 'G3');

更多回答(1 个)

Image Analyst
Image Analyst 2021-11-28
rgbImage = imread('peppers.png');
imshow(flipud(rgbImage), 'XData', 1:8, 'YData', 14:22);
axis('on', 'xy')

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by