spatial distribution plot in matlab

조회 수: 6 (최근 30일)
pranto saha
pranto saha 2023년 7월 22일
답변: Rahul 2024년 9월 5일
I am new in matlab, and currently i want to plot some data in my plot. but i am unable to do this, I want to make a plot like this
i have temperatureData
size of temperatureData = 46 x 241 x 4
in y axis i will show 46 point, x axis 241 point, i need 4 plot for last 4 data. is it possible to make this graph with this data, or i need to modify my data,
if i can , how to do this, please help.

답변 (1개)

Rahul
Rahul 2024년 9월 5일
I understand that you have some 'temperatureData' of size 46 x 241 x 4. You want to plot the 'temperatureData' in the way shared by you in the question above.
You can achieve the desired result by following the mentioned code:
figure;
% 'temperatureData' is considered to be a 46 x 241 x 4 matrix as mentioned
% in the question
for i = 1:4
% Extract the 2D slice for the current plot
dataSlice = temperatureData(:, :, i);
subplot(2, 2, i);
contourf(dataSlice, 'LineStyle', 'none');
colorbar;
end
You can also consider using 'imagesc' function instead of the 'contourf' function above for your use-case.
You can refer to the following documentations to know more about these functions and styling:

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by