Legends in MATLAB®

How to configure and style the legend in Plotly with MATLAB®.


Positioning Legends Inside the Plot

fig = figure;
plot([1 2 3 4 5 6 7 8],[1 2 5 6 3 3 2 5]);
hold on
plot([1 2 3 4 5 6 7 8],[1 6 2 3 4 7 7 8]);
legend('blue trace','orange trace');

fig2plotly(fig);

Positioning Legends Outside the Plot

fig = figure;
plot([1 2 3 4 5 6 7 8],[1 2 5 6 3 3 2 5]);
hold on
plot([1 2 3 4 5 6 7 8],[1 6 2 3 4 3 7 8]);
legend('blue trace','orange trace','Location','BestOutside');

fig2plotly(fig);