| Reference | Downloads | Github

TextStim height parameter

My visual.TextStim has trouble to change the height parameter.
Each time I change from default height (tried with either height=18 and height=32), the execution is lasting for ever and nothing appears on the screen.
I use Psychopy 3.0.4 & Python 3.7
Thanks for your help !

Hi @Pber6154, are you building your experiment with Coder or are your using the Builder interface?

Great, can you please provide a minimal working example of your error?

I am doing my experiment with the coder interface.
No I do not have any error, the loading is just lasting forever, and the only change I do from one version to the other is to fix the height parameter to a non default value.

visual.TextStim(win, text=x, color=‘white’, font=‘Arial’, height=32, pos=(0,0), autoLog=False).draw()

If that is all you have in your code, then I think that is the problem. Here is a working example of how you would use TextStim. Note, I changed the screen units to pixels. If you were using Norm or Height units by default, the text would be 18 or 32 times the height of your screen.

from psychopy import visual

# create window
win = visual.Window()  

# Create textstim
text = visual.TextStim(win, 
                        text="This is your text", 

# draw textstim for 60 frames
for frame in range(60):
1 Like

Yes these lines prints these errors :
which are permanent errors I have… :slight_smile:
(but that error is not problematic when height is defined on the default size)

2.1046 	WARNING 	Monitor specification not found. Creating a temporary one...
3.4330 	WARNING 	Couldn't measure a consistent frame rate.
  - Is your graphics card set to sync to vertical blank?
  - Are you running other processes on your computer?

3.5309 	WARNING 	t of last frame was 98.17ms (=1/10)

response are :

  • Is your graphics card set to sync to vertical blank? No
  • Are you running other processes on your computer? No

Thanks, what you are seeing are warnings rather than errors. Here is the documentation to explain what is happening here. For reducing dropped frames, see Reducing dropped frames.

Did you try the code I sent you? Also, have you thought about building your experiment using the Builder interface? There are many benefits to building your experiment in Builder, such as ensuring your stim timing is optimal - see this tutorial for guidance on building your first Stroop task.

Yes, I have tried the lines you sent.
It works well, even when I try to change the height parameter.

What is the default units parameter ? ‘norm’, ‘cm’, ‘deg’, ‘degFlat’, ‘degFlatPos’, or ‘pix’ ?
I use ‘norm’ in the window definition, and I think I misinterpreted it … I used integers in unit=‘norm’ mode, but figures to be used are in [-1.0 ; +1.0] , isn’t ?

Thanks a lot for your help !

Default units are in your experiment settings, or you can use the units in “Preference” in the File menu. I think “norm” are your default units - see the screen unit documentation for an explanation of units.