Programmatically Plotting Multiple Y-waves on Category Plot

Hi All,

 

I am writing some Igor code to automatically create category plots with the addition of a 'top axis' and dummy x variables in order to make figures which show both mean +/- error bars and the individual replicate measures for each group. An example of the type of plot can be found here: https://images.app.goo.gl/C2JbcbGmx4JqLojg9.

I have been making these plots by creating a category plot with waves containing means, errors and labels. Next, I take waves which contain individual replicates for each bar of the category plot and create dummy x variables with the gnoise function to create 'jitter'. Each x-y wave pair is then appended to the plot using the 'top axis.' With some x-offsetting and axis hiding, I can get the figure that I am aiming for.

I have code that can take the raw waves, containing the individual replicate measures and some user input, to derive means, SD's, SEM's, text waves for labels etc for plotting on a category plot. This code is nice because it eliminates much of the mundane data restructuring I have to do, but I would like to be able to input some information and have a mostly complete plot made automatically.

My current dilemma is that I cannot dynamically/programmatically plot multiple waves on a category plot using:

Display y_wave vs text_label_wave

because I do not know, a priori, how many waves and what their names would be before running the code. I have tried to make a running list, as a string with a comma separator, of the wave names I am creating in the code but I get errors when I pass the string over to the Display command. I've tried passing the string with a "$" hoping that would help, but it did not.

After searching through the forums, I found a post which suggested the following, after calling the Display function:

AppendToGraph/B=CategoryAxis ...

but that creates a "free" x-axis, which doesn't give me the desired look.

Before I spend more time looking for work-arounds, I was hoping someone on here can give me a hint about programmatically creating a category plot without a priori knowledge of the names or numbers of waves we would plot. I may just have to let the code structure my data and create the plot by hand, but it would be darn handy to have something like this pop-up with some simple user inputs. Journals are now requiring/requesting plots which show each individual measure in addition to means +/- error so I think this type of function would be very useful for academics using IgorPro.

 

Thanks,

Yan

You don't have to use /B=<axis name>. AppendToGraph without any axis flags works just like Display except it doesn't make a new graph window.

Also, if you are using Igor 8, instead of the XY plot superposed on the category plot, you could use a box or violin plot. They can both show the raw data with jitter.

Hi John,

Thanks for getting about this!

As per usual, I over complicated the thing greatly. Using AppendToGraph without flags works great!