spatial distribution plot in matlab

9 visualizaciones (últimos 30 días)
pranto saha
pranto saha el 22 de Jul. de 2023
Respondida: Rahul el 5 de Sept. de 2024
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.

Respuestas (1)

Rahul
Rahul el 5 de Sept. de 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:

Categorías

Más información sobre Data Distribution Plots en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by