Designate legend text in Matlab
1 answer
The tab (\ t) command doesn't seem to work when providing rows for records in a table. However, you might be able to fix the problem if you are working in a latex environment, define each record as a one-line table form and define that the first column has a specific width (for example, 1 cm):
plot(eye(2)); % example plot
h=legend('\begin{tabular}{p{1cm}r}first:&1\end{tabular}',...
'\begin{tabular}{p{1cm}r}second:&2\end{tabular}'); % table entries in latex
set(h,'interpreter','latex'); % set interpreter
+2
source to share