Can anyone have a code about presenting four pictures at the same time? I need to control the position of four picture stimulus through codes. What i want to present is in this photo.
Are you trying to do this in Coder without using Builder components?
No, I focus on builder components. I just want to use coder to control the position of stimulus.
Hello,
you could code the positions of your stimuli in an Excel-file, xpos1, xpos2, ypos1, ypos2 and refer to these variables in position-property of the respective picture-component. Do not forget to set the Position to update for reach trial → change constant to set every repeat.
Alternatively, you could use some code. Insert a code-component before your picture-component. In the Begin Experiment tab, insert the following code:
xpos = [-.2,.2]
ypos = [-.2,.2]
Notice, I am using height as screen unit. If you use a different screen unit, you need to adjust the xpos/ypos-values accordingly.
In the Begin routine tab, add the following code:
shuffle(xpos)
shuffle(ypos)
In your first picture-component enter (xpos[0],ypos[0])
as position and set it to update. In the second picture-component enter (xpos[1],ypos[0])
, in the third (xpos[0],ypos[1])
and finally the fourth picture-component add (xpos[0],ypos[0])
. Don’t forget to set all Position-properties to update.
A good source is the book Building Experiments in PsychoPy by Jonathan Pierce and Michael MacAskill (2018).
Best wishes
It’s nice of you! Your answer is so detailed! Now I’ve learnt two methods to control the position of more than one picture stimulus.
Thanks sincerely!
Best Wishes!