Select multiple traces in graph via mouse

Hi,

when working in a graph with multiple (100-200) traces - is there a way to select a bunch of traces in order to delete them by the bunch?

From time to time I need to select traces visually (selecting faulty devices after measuring a batch of devices), or in other words, I need to see the data in order to select and sort out the faulty measurements, which are on top of the measurements (traces) I want to compare.
At the moment, the only option to do so is via right-clicking on them one by one and "remove XY from graph".
The "remove from graph..." menu is not applicable here, since I do not know the name / number of the waves of faulty devices - I need to see their behavior in the graph.

When faulty (shorted), all shorted traces are within the same XY region of the graph - is there a way to mark the traces and then right-click -> remove selected traces (by the bunch as opposed to 1 by 1)? For example, drawing a selection rectangle and all traces within the selection can be dealt with by the right-click menu?

I am not sure, if such a feature exists, and if not, it would be a really really usefull addition to Igor...

Best,
IgorPal


 

I am not aware that something like this exists. However, I think you can 'mark' traces in a slightly different way: Right-click on the trace you don't want and select 'Hide'. Do this for all relevant traces. Then finally select Remove From Graph from the right-click menu. All hidden traces are written in italic font now and can be easily selected from the list.

Igor doesn't have anything like this built in, but it gives you the tools to write this on your own.

 

I suggest using a marquee as the input device. For information on how to do this, execute:

DisplayHelpTopic "Marquee Menu as Input Device"

You can use GetMarquee to get the coordinates of the marquee, and then calculate the center of the rectangle. Then get all trace names using TraceNameList and iterate through those trace names. On each iteration, call TraceFromPixel and in the optionsString parameter set ONLY to the trace name in that iteration. Set DELTAX and DELTAY to the distance from the center of the marquee to the edge. You should probably also set WINDOW. If Igor returns a trace name, then you remove it from the graph.

If you do this, it is important that you iterate backwards over the list of trace names so that the name of each trace does not change during the iteration.

I am happy to invite you to use the procedure package I have collected and put together. I apologize that in some places I have labeled the sources and in some places I have not.
They work well on my computer.
For the graph containing a lot of tracks, "traceToggler" may or may not be sufficient for your needs.
Clicking on it will bring up a new panel that lays out all the traces, while each trace is assigned an "X", a "C" and a check to delete, copy or hide the corresponding trace.

The version of procedure package I put here is a personal remodified based on some project or code snippet from other igor users.

PLEASE forgive me if I may not have isted them completely, but please remind me if you find them.

 

the main panel is a personal modifoed version based on chozo's work:

Spectra Trace Offset and Graph Size Tools - Quick-access to common graph and trace modify commands | Igor Pro by WaveMetrics

the tracetoggler also can be find in:

Trace Toggler (wavemetrics.com)

and the code for coping and pasting trace can be accessed in:

copy/paste trace formatting | Igor Pro by WaveMetrics

 

Graphsizepanel_0.zip

Hi Qianlix, it seems your package is based heavily off my Graph Size Tools project, which is totally fine!

However, I would like to ask to the following to avoid confusion:

  • Please write clearly in the help and source files that your package is based on my project, and not written by me or in my responsibility (to address bugs etc.).
  • Please do not link to my project page directly with button names such as 'Src Web', which makes it seem that your package is directly related to my project.
  • It would be nice if you at least mention my project when you post the package here in the forum or somewhere else in the web.

Thanks for your understanding.

For marquee menu fans, I think that this code is pretty much what aclight described:

menu "GraphMarquee"
    "Remove Traces In Marquee"
end

function/S RemoveTracesInMarquee()
    GetMarquee/K
    string strWin = S_marqueeWin
    variable vCentre = (v_top + v_bottom) / 2
    variable hCentre = (v_left + v_right) / 2
    variable delX = abs(v_right - v_left) / 2
    variable delY = abs(v_bottom - v_top) / 2
       
    string strOptions = ""
    wave/T tw = ListToTextWave(TraceNameList(strWin,";",1), ";")
    ReverseTextWave(tw)

    for (strTrace : tw)    
        sprintf strOptions, "WINDOW:%s;ONLY:%s;DELTAX:%g;DELTAY:%g;", strWin, strTrace, delX, delY
        if (strlen(TraceFromPixel(hCentre, vCentre, strOptions)))
            RemoveFromGraph/W=$strWin $strTrace
        endif      
    endfor
end

function ReverseTextWave(wave/T TextWave)
    duplicate/free/T TextWave temp
    int pmax = numpnts(TextWave) - 1
    TextWave = temp[pmax-p]
end

 

In reply to by chozo

hello,

        Thank you chozo. 

        I fully accept your suggestions and requirements, and I am sorry for my inadequacy and recklessness.

        I'll fix them as soon as possible. 

@Qianlix: Thank you for your quick response, and no problem at all! I am happy that part of my project proved useful for you. Please feel free to use whatever code you need as long as there is no confusion. Also, let me know if you have any feature requests! :-)