using imagesc to plot a matrix of data
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to see how temperature varies with different input parameters.
I have 2 input parameters which vary between 0.1-0.5 and 0.1-0.2. I have mean temperature for every combination of these parameters in a 5x2 double.
It generates the graph, but I only want the 0.1 interval labels and not the 0.05 intervals. I've tried to set limits on these but I dont want the position of the 0.1 interval labels to move, and I want to keep these in the centre of the box. Is there a way to do this?
C = 0.1:0.1:0.2;
F = 0.1:0.1:0.5;
figure(1)
subplot(1,3,1)
imagesc(C,F,mean_GT)
set(gca, 'YDir','normal')
xlabel ('Restitution')
ylabel ('Friction')
colorbar
title ('ensemble mean GT')
xlim([0.5,0.2]);
set(gca,'XTick',[0.5:0.1:0.2]);
ylim([0.5,0.5]);
set(gca,'YTick',[0.5:0.1:0.5]);
채택된 답변
Chunru
2021년 10월 7일
%C = 0.1:0.1:0.2;
C = [0.1 0.2]; % There are only two points along x
F = 0.1:0.1:0.5;
figure(1)
subplot(1,3,1)
mean_GT = randn(5, 2);
imagesc(C,F,mean_GT)
set(gca, 'YDir','normal')
xlabel ('Restitution')
ylabel ('Friction')
colorbar
title ('ensemble mean GT')
%xlim([0.5,0.2]);
set(gca,'XTick',C);
%ylim([0.5,0.5]);
set(gca,'YTick',F);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!