Origin Ver. and Service Release (Select Help-->About Origin): 8.6G Operating System: Win7
Hi,
I was wondering how to set Origin in a way that the autmatically updated legend of a plot shows only the currently active plots. To avoid misunderstanding: I am talking about plots which are actually shown in the plot. When I have several plots in a layer and some of them are switched of (not displayed), and I update the legend, it shows the complete set of plots, even the switched off ones, which is quite annoying when I play around with them and switch them on and off quickly.
For a one-layer plot with a simple legend you can try this:
Right-click on the Legend and choose Programming Control. Paste the following into the large text box: // BEGIN COPY string str$; count = 1; doc -e DY { get %C -s shown; if(shown) { if(str.GetLength()>0) { str$ = %(str$)%(CRLF)\L($(count)) %($(count)); } else { str$ = \L($(count)) %($(count)); } } count++; } legend.text$=str$; // END COPY Set the "Script, Run After:" drop-down to "Redrawn". Click OK.
Your Legend should only show the dataplots that are actually being displayed. Note that if you use the context menu to select and "Hide Data Plot" or "Hide Others" you will need to use Window : Refresh. You will not need to do the Refresh when you choose "Show All Data Plots" or use the Plot Details dialog.