How to omit legend entry matlab answers matlab central. Remove legend items from figure matlab answers matlab. Im working on my first gui and i am having trouble getting the legend to clearhide when i hide a figure. Based on your location, we recommend that you select. How to remove entries from an existing figure legend. I cant run your code, but that should work in r2016a. Deleting legend entries in matlab plots matlab has been a constant source of annoyance and rage since i started writing my thesis. Delete elements in a array matlab answers matlab central. This figure has 12 curves with its respective legend entries. Learn more about cell arrays, double entries, delete matlab. I cant easily regenerate the legend from the command line because the real plot is complicated, but if there is a way to manually edit the legend command and delete. This tutorial show how to transport or move signals from simulink scope to the matlab graph where you can add title, x and y labels, legend and you dont get th. For example, plot three lines and return the line objects as array p. The curve was easy to delete just selecting it with the cursor and pressing delete, but when i try to delete its legend, i can only delete the name.
I am not able to rerun the legend command after all plots are drawn because the legend is generated within a function, and the additional lines are plotted at the command line. Ignoring extra legend entries learn more about error, legend, legend entries, legend entry, extra legend entry. This is an old question, but this works in matlab 2015a, delete the lines you want to remove from the legend, delete the legend, and then ctrlz to bring the legend back, and the legend should come back with only the legend entries removed. Using it in a dual screen environment, trying to export figures, and the source file editors obscure keyboard shortcuts often brought me close to insanity.
Remove legend entries from figure window matlab answers. I am able to hide the axes and the data plot using cla but i. I am editing my figure graphically in the figure window, and id like to know how to remove legend entries. However, i want to delete one of the curves and its legend. Choose a web site to get translated content where available and see local events and offers.
957 1204 542 1498 193 537 531 808 1623 996 103 1181 1092 836 1100 1609 1169 271 350 824 60 610 1576 1227 1087 1040 10 418 1150 419 1037 1012 157 1476 632 919 759 1131 626 42 1264 1412 204 748 243 472 630 1217 185