plot_2d using latitude and longitude
Afficher commentaires plus anciens
I am using plot_2d and coast.m to graph Direct Normal Irradiance (DNI) from the TMY3 dataset. I have prepared 4 column vectors with the average DNI for 959 locations for each quarter of the year. However, the gridding doesn't seem to match up. I've used similar code for another project a couple years back and don't know why the lat/lon on this project doesn't allow for proper map size or for the data to be plotted correctly. Each vector is 959x1, if that helps at all.

%create the spacing for lat/lon to graph
% create nlat/nlon for proper grid spacing
nlat = 959;
nlon = 959;
% create the degrees for lat and lon
dlat = 180/nlat;
dlon = 360/nlon;
% create the lon and lat variables
lat = [-90:dlat:90-dlat];
lon = [-180:dlon:180-dlon];
%produce five images... yearly and four quarters.
%find the min and max of the q1_dni so it can be plotted
cmin = min(q1_dni(:));
cmax = max(q1_dni(:));
% prepare your arguments for the function
figure(1)
variable=q1_dni; % variable you want to plot
units='Wh/m^2'; % units of your variable
figure_number=1; % assign a figure number (integer)
x_axis=lon; % this is the lon vector you created
y_axis=lat; % this is the lat vector you created
cmin=cmin; % this is the minimum value you found
cmax=cmax; % this is the maximum value you found
% you are ready to plot. use the syntax below to plot
plot_2d(figure_number,x_axis,y_axis,variable,cmin,cmax,units);
Réponses (0)
Catégories
En savoir plus sur Map Display dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!