I have a plot that has 528 points on the x-axis. The x-axis is labelled by mmm yyyy. I want to plot data over it, but the data is in monthly form. I want to take each of the monthly data points and plot it at the beginning of the month as a dot.
% Axis and plot
t = 731:1258; % 20120101 to 20130611
y = reshape(dataPoint_Anom1x1(:,:,731:end),[],1); % Size 528x1
x = datenum(2009, 12, 31) + t; % Convert t into serial numbers
plot(x, y); % Plot data
hold on
The part below is what I'm having trouble with. The dataPoint_Clim1x1 is size 12x1. (1,1) corresponds to January, (2,1) corresponds to February, etc. I need to plot the corresponding month's climatology point as a dot at the beginning of each month between January 2012 and June 2013.
%%%% Plot climatology on the same graph
dataClim_1x1 = dataClim(u,v,:); % Array that only contains points 1 degree away from 72.5E and 67.25S
B = mean(dataClim_1x1); % Average along the column
dataPoint_Clim1x1 = mean(B,2); % Average along the row
x_dataClim = ???
y_dataClim = reshape(dataPoint_Clim1x1, [],1); % Change dataPoint_Clim1x1 into a 1 column matrix
plot(x_dataClim,y_dataClim) % y_dataClim is only 12x1.
So the plot command right above is wrong. Do I just need to somehow set up the x-axis so that it plots every month with datenum somehow? I don't want to use a secondary axis though.