Hi
I am new to Igor programming and this is my first question here.
I have a generated a set of waves, using different equations that I am working with.
I have also created slider controls for the different parameters that are present in the equation. I am trying to make a macro that will enable the user to change the parameters with the slider and see the effects on the graph.
I have a choice of four waves to display. Displaying all of them clutters the graph. I would like to create a toggle button to choose if a given wave is displayed in my graph or not. I have created the button and the procedure. I used the commands appendtograph and Removefromgraph and was able to append a wave and remove a wave. I am not able to query if the wave is already displayed in the graph. Therefore I keep adding multiple copies of the wave or I reach an error where the I try to remove the wave when it is not present in the graph.
My question is : How can I find out if a given wave is displayed in the graph or not. Is there a command for this?
Thanks
veto
My question is : How can I find out if a given wave is displayed in the graph or not. Is there a command for this?
One simple way is to use the built-in function WaveList(matchStr,";","WIN:winName") where winName is the name of the window you want to query. The matchStr could be the name of the wave of interest, and in that case the list returned by wavelist would have one item if the wave is displayed and zero items if it is not displayed. matchStr could also be "*" to get a list of all the waves in the graph. You could then use, for example, listmatch to find out if a wave of interest is plotted.
I think a limitation of WaveList is that it will only list waves in the graph that are in the current data folder. For a list of all waves displayed in the graph, regardless of data folder, use TraceNameList.
A possibly alternate way to approach what you're doing is to simply hide the traces rather than remove & append them all the time. See this example panel:
http://www.igorexchange.com/node/4633
The upside is that the axes can keep the scaling range needed for all the waves.
June 7, 2018 at 10:04 am - Permalink
WaveList(matchStr,";","WIN:winName")
where winName is the name of the window you want to query. The matchStr could be the name of the wave of interest, and in that case the list returned by wavelist would have one item if the wave is displayed and zero items if it is not displayed. matchStr could also be "*" to get a list of all the waves in the graph. You could then use, for example,listmatch
to find out if a wave of interest is plotted. One simple way is to use the built-in functionJune 7, 2018 at 10:38 am - Permalink
WaveList
is that it will only list waves in the graph that are in the current data folder. For a list of all waves displayed in the graph, regardless of data folder, useTraceNameList
.June 7, 2018 at 10:45 am - Permalink
June 7, 2018 at 10:48 am - Permalink
June 8, 2018 at 12:13 am - Permalink
June 11, 2018 at 07:38 am - Permalink