MATLAB: Surfl chart; datetime on y-axis, letters on x-axis

datetimesurflsymbolsx axisxtickxticklabely axisytickyticklabel

Hi, i am trying to make a 3d surface chart (surfl) out of a x-by-y table named 'cum_pl', which contains daily P&L numbers for x days and for (y-1) markets. The table contains dates of DateTime type in the first column (column header = 'Date'). The table contains the Ticker symbols in the header row (cum_pl.Properties.VariableNames). The rest of the matrix contains the daily P&L for each market, for each day.
I use surfl(cum_pl{:, 2:end}) to initially plot the P&L figures in a surface chart. However, i can't seem to manage to show the datetimes on the y-axis (e.g.,format 'dd-mm-yy'), and the tickers on the x-axis, using the YTick, YTickLabel properties of the gca object.
See a small picture of the cum_pl table attached. I am using Matlab 2016a.
Hope someone can help out, thanks in advance!
Steven

Best Answer

surf supports datetime in R2016b, but not in R2016a.
In 16a, you can convert datetimes to datenums and use datetick, or you can set the tick locations yourself and assign the labels by converting the datetime to text using cellstr.
Hope this helps.