Heat map from csv data
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nelson Cardemil
el 4 de Ag. de 2022
Comentada: Star Strider
el 5 de Ag. de 2022
I need to import data from a csv file, which contains hourly temperature data in a year (8760 values in one column), in order to create a 24x365 matrix to make a heatmap like the image
0 comentarios
Respuesta aceptada
Star Strider
el 5 de Ag. de 2022
Try this —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1088620/results.csv', 'VariableNamingRule','preserve')
Hours = reshape(T1.Hour, 24, []);
T_del_C = reshape(T1.('T delivered (C)'), 24, []);
xv = datetime(2021,1,0, 'Format','MMM') + days(1:size(T_del_C,2));
yv = Hours(:,1);
figure
surf(xv,yv,T_del_C, 'EdgeColor','none')
colormap(turbo)
view(0,90)
axis('tight')
It comes reasonably close to the plot image in the original post.
Make approopriate changes to get the result you want.
.
4 comentarios
Star Strider
el 5 de Ag. de 2022
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!