Showing seaborn plot in OpenSesame
in OpenSesame
Dear everyone,
I am working on an experiment in which I want to show a custom feedback at the end of a sequence for each participant based on their responses in that sequence. Ideally, this feedback is a visual one, e.g., in a plot. For this reason, I have tried using a combination of pandas (for creating dataframes - but perhaps I can use DataMatrix as well) and seaborn (for plotting). Can anyone tell me how to show (seaborn) plots in OpenSesame canvas? Thanks in advance!
Wisnu

Comments
Hi Wisnu,
I don't think you can use seaborn or matplotlib to draw on the canvas, but your probably will be able to bypass the problem, by making your plot and saving it as an image on your pc. Then, right after, you can use the canvas.image function to load this image again and draw it on the canvas.
Does that make sense?
Eduard
Hi Eduard,
Thanks for your response. Is it possible to create the plot while the experiment is running? I assume your suggestion would be to create a custom function in the inline script to make the plot and save it in the experiment file pool. Am I correct?
To give a more precise idea, I am building a learning experiment in which participants need to study x-ray images of various lung diseases by blocking (e.g., four exemplars of one disease in one block) and interleaving (e.g., the first four exemplars of four different diseases in one block). At the end of each block, I would like to ask the participants to rate their mental effort they spent for the previous block using a custom form. This part can be arranged relatively straightforwardly in OpenSesame.
At the end of the experiment, I would like to show mental effort ratings in blocking and interleaving units during the experiment of that particular participant. My idea was to show the ratings in a plot using the variables for mental effort ratings and condition that have been stored in OpenSesame. I thought I could use available python packages to help me do this. However, if there is a more OpenSesame way to achieve what I want, I would be more than happy to try it.
Wisnu
Hi Wisnu,
Is it possible to create the plot while the experiment is running?
Yes, that is possible (even though effectively the experiment is pausing while the plots are being made, but that's not what you are concerned about, right?)
I assume your suggestion would be to create a custom function in the inline script to make the plot and save it in the experiment file pool.
Yes, that is what I mean. You don't necessarily need a function, a simple script would be fine. For example, whatever your data is:
In summary, you basically know what to do, it is about time to do it :) Good luck, and if you get stuck, let us know.
Eduard