Advice needed for presenting multiple tables in an organized way

Hi,

May I have your advice on organizing multiple tables, and have them presented in something like a catalog?
It doesn't have to be complicated, but maybe something like Excel.

1. Being able to paste three tables from top to bottom, with a title above each
2. In Excel, I could create "sheet", and I can switch from one set of three tables, to another sheet with another set of three tables
3. Maybe more demanding: Can I colorize each entries according to the magnitude of the value? In excel that could be done with "conditional formatting" with a click.

An example is attached.
It doesn't have to be exactly presented this way, but I am trying to make it easier for someone to browse through different data sets (each sheet is a set).

Example.xls (33 KB)

A multi page layout (Igor 7 or later) with a table on each page might do what you're looking for. You could add additional text to each page using either an annotation or drawing text. Or you could just put all three tables on the same page with text.

As for #3, there's no practical way to do this in Igor. One approach would be to create a control panel with a list box. The list box requires a text wave, but it does allow you to use styled text and can display the styled text. Here's an example (tested with Igor 8) that gives you an idea of what I'm thinking. Paste this code into a procedure window and execute test():

Function/S ColorCodeForValue(value)
    Variable value
   
    String colorCode = ""
   
    if (value < 4)
        colorCode = "\\K(65535, 0, 0)"  // red
    elseif (value >= 4 && value < 7)
        colorCode = "\\K(0, 65535, 0)"  // green
    else
        colorCode = "\\K(0, 0, 65535)"  // blue
    endif
   
    return colorCode + num2str(value)  
End

Function test()
    make/O/n=(10, 1) numbers = p
    make/O/n=(10, 1)/T text
    text = ColorCodeForValue(numbers[p])
    NewPanel /W=(0,0,150,250)/K=1
    ListBox list0,pos={1.00,1.00},size={100.00,200.00},listWave=root:text
End

 

Capture.PNG (8.2 KB)

An Igor table allows you to control formatting on a column-by-column basis but not on a cell-by-cell basis.

For a simple presentation, an option is to use a formatted notebook, possibly as a subwindow in a control panel.

To get started, create a standalone formatted notebook manually and enter and format sample text as you wish manually. Then choose Notebook->Generate Commands, then paste into procedure window to see the commands needed to recreate that notebook.

 

Actually for operation #3, my supervisor gave a good solution by using just the color map, and I code it into the below:

I will explore the other two features suggested above, thanks a lot for the ideas!

function generateNumHeatMap(Matrix,[logScale,decPnt])
    string Matrix
    variable logScale, decPnt
   
    wave inputMat = $Matrix
   
    if (paramisdefault(decPnt))
        decPnt = 2
        endif
   
    display; appendimage inputMat
    ModifyImage $Matrix ctab= {*,*,RedWhiteBlue,0}
    if (logScale == 1)
        ModifyImage $Matrix log=1
        endif
   
    duplicate/o inputMat, dummyMat
    dummyMat[][] = numerizeMap(p,q,inputMat,decPnt)
   
end

Threadsafe function truncateDP(inValue,targetDP)
// targetDP is the number of decimal places we want
    Variable inValue, targetDP
    targetDP = round(targetDP)
    inValue = round(inValue * (10^targetDP)) / (10^targetDP)
    return inValue
end

function numerizeMap(a,b,Matrix,decPnt)
    variable a,b, decPnt
    wave Matrix
   
    variable number = truncateDP(Matrix[a][b],2)
    string numberString = num2str(number)
   
    //ShowTools/A;
    SetDrawEnv xcoord= bottom,ycoord= left,textxjust= 1,textyjust= 1;DrawText a,b,numberString;
    //HideTools
   
    return 0
   
end

 

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More