R2017a 'legend' lists all instead of what's asked for. Why? How to fix?

1 visualización (últimos 30 días)
I've got a plotting routine that works fine in R2016b. I've upgraded to R2017a in order to be consistent with a group. Now the 'legend' command is broken.
%--------------------
h_leg2 = legend([h_ctFac01, h_ctFac01Tmn, h_ctFac01VLmt],legLbls);
set(h_leg2,'Location','NorthWest')
plot([Xmn,Xmx],-10*ones(1,2),'k--')
text(79,-12,['Min Tail Tilt'],'FontSize',14)
%--------------------
This snippet now lists a 4th item "data1" with line type "--".
That last item is for marking up the plot, but it is not part of the data to be plotted. It is not supposed to be listed on the legend. The legend is generated first, with a list of 3 specific data items to show, and then the mark up is added later.
==> How can I suppress the 'legend' command from listing everything on the plot?
The techniques I have always used for doing that (as shown above) don't seem to work anymore.
I had another mark-up item that I removed, and 'data2' disappeared, so the 'data1' is not some spurious item actually included in the handle list of 3 items above.

Respuesta aceptada

Walter Roberson
Walter Roberson el 29 de Ag. de 2017
Add 'autoupdate', 'off' to the legend() options.

Más respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by