MIES icon indicating copy to clipboard operation
MIES copied to clipboard

SF: Allow to tweak trace properties

Open t-b opened this issue 3 years ago • 3 comments

When plotting

data(
cursors(A,B),
select(channels(AD),sweeps())
)

the user wants to highlight i.e. the first and last sweep specifically with a different color/marker/linestyle. This is currently not possible.

One could add an operation like

tweak(input, [tweakSet(), ...])

which would return its first argument unchanged data-wise, like store, but adds metadata which the plotter can then interpret.

tweakSet would look like

tweakSet(select(...), plotMode(...))

where plotMode (mode in the sense of ModifyGraph) is one of:

line([color(...)], [style])
markers([color(..)], [marker])
liama([color(...)], [style], [marker]) # short for Lines And Markers

with

color(red, [A]) # named HTML color
color(R, G, B, [A]) # range: 0 - 1 (floating)

which returns always Igor style 16bit RGBA colors.

We would then also need a special value for the first and last sweep.

In the whole this could then look like:

tweak(
data(
cursors(A,B),
select(channels(AD),sweeps())
)
,
tweakSet(
select(channels(), [0]),
liama(color(red), 1) # dashed line
),
tweakSet(
select(channels(), [inf]),
markers(color(blue), 13) # square with dot
),
)

This makes the first sweeps a red dashed line, and the last sweep will have square with dots marker style.

For now I would only implement the required parameters for the mode operations.

t-b avatar Oct 25 '22 18:10 t-b

@t-b I have a shortcut for this PR that I think will cover most use cases without user input: modify the trace opacity for the formulas being plotted with 'with'. Opacity = 100% for formulas that return an average, whereas formulas that return individual results have an opacity of 10%.

timjarsky avatar Jan 05 '23 17:01 timjarsky

Automatically do that if both average and normal traces are present.

t-b avatar Jan 09 '23 22:01 t-b