How to do a line plot with four variables?
1 view (last 30 days)
Show older comments
I have four variables in excel sheet , time, temp, lat and lon. I have to plot temperature data (which is on different grids i.e. lat, lon as in excel sheet). I want to take number of grids longitude 1 to 144 and latitude 1 to 73. And on this grid I have to plot temp data. I am not so perfect in MATLab. I have tried a lot but I am not getting how to do it. I've tried some commands like geoshow, load topo, m_map , but not succeeded. Kindly, help me. I've attached the excel sheet with this.
Thanks and Regards
0 Comments
Accepted Answer
Image Analyst
on 15 Aug 2015
I'm not sure how you want to handle the year (column 1), but this is what I have so far:
[numbers, txt, raw] = xlsread('book1.xls');
temp = numbers(:, 2);
x = numbers(:, 3);
y = numbers(:, 4);
% Create an image
myTempImage = zeros(max(y), max(x));
for row = 1 : length(x)
% Assign temperature at row y, column x:
myTempImage(y(row), x(row)) = temp(row);
end
imshow(myTempImage, [], 'InitialMagnification', 1600);
axis on;
myColorMap = jet(256);
myColorMap(1,:) = [0,0,0];
colormap(myColorMap);
colorbar;
More Answers (0)
See Also
Categories
Find more on Annotations 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!