Multiple gratings on screen

Hello,
I know it’s a trivial problem but I am stuck with visual.GratingStim.
I’d like to present multiple gratings on the screen in a regular pattern (as a simple grid). And I’m having problems with the stimuli disposition.
Basically I am stuck with the

visual.GratingStim.pos.

The number of gratings should cover the entire screen, with some space between them.
Some time ago, I created this (see below), but it was time ago and now I am stuck:

w_background_gratings|690x388

I would like a pattern like this.
How to achieve this? :cold_sweat:

I’ve already created a window with several grating stimuli randomly positioned on the screen, but I need them in a regular pattern.

Thank you for your help,
Marco

Hi @MarcoN, take a look at the element array stim (see docs), which allows you to draw many stimuli efficiently. The elementTex and elementMask parameters can provide the gratings. There is also a demo in the Coder view, showing how to use an ElementArrayStim.

1 Like

Thank you. I was just editing my post telling that I know I can use for visual.ElementArrayStim the nElements parameter.
I switched to this stimuli since I can make the pattern with this.

Is there any possibility to do something similar using visual.GratingStim?

Anyway thank you for your reply. I will use this instead.