psychopy.org | Reference | Downloads | Github

Have my stimuli appear across the entirety of the screen, not just a smaller location

Hello everyone,

I am making good progress with my visual search task and I have managed to create two sets of random distractors of Red and Green Letter T’s, however due to the code I have implemented, rather than use the entire screen, the distractors only appear in a small subset in the center of the screen

As you can see from the image the items are located relatively closely together and they can overlap at times.

This is my code (see below) I used to create my stimuli. I know why it’s happening, because I use Norm units (I find norm units the easiest to understand) So the random function is picking a number between 0-1 and then subtracting 0.5 in order to balance the display, I have tried messing around with other values but then my stimuli are no longer centered. Would it be more optimal to switch to pixels, and if so, what would my random function become?

Also would it be more efficient to use an element arraystim to create a screen of various targets and a singular distractor?

T_textlargeRed =
T_textlargeGreen=

targetPos=(random()-0.5, random()-0.5)

for x in range(10):
T_textR = visual.TextStim(win=win, name=‘T_textR’,
text=‘T’,
font=‘Open Sans’,
pos=(random()-0.5, random()-0.5), height=0.1, wrapWidth=None, ori=0.0,
color=‘red’, colorSpace=‘rgb’, opacity=None,
units = ‘norm’,
languageStyle=‘LTR’,
depth=0.0)

    T_textlargeRed.append(T_textR)

print(T_textlargeRed)

for letter in T_textlargeRed:
letter.setAutoDraw(True)

Did you know that norm units go from -1 to +1 in each dimension?

Hi, thanks for the assistance again! Yes, I read about the types spacial units yesterday to refresh my memory. random() is between 0 and 1, with -0.5 added to x and y to create a spread that is not skewed towards left/right of the monitor. I just realised I never tested just random() without any minus-05

Maybe I have misunderstood, but if random() selects a random number 0-1, then I need to increase the number I minus from this to create a better spread, say -1 in order to account for norm ranging from between -1 to 1

In my readings yesterday I actually wondered whether random()-0.is the optimal way to randomize my stimuli, rather randomrange() maybe better, as I no longer need to perform a calculation on the outcome of random(), but rather set the range between -1 and 1 then have some step size that would create enough random permutations, do you think this would make more sense?

Kind regards,

Rob