spatial distribution plot in matlab
8 views (last 30 days)
Show older comments
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 Comment
Answers (1)
Rahul
on 5 Sep 2024
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:
0 Comments
See Also
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!