| Reference | Downloads | Github

Text stim appears in a narrow column, rather than centre-justified left-to-right paragraph


OS: Windows 10
PsychoPy v. 1.90.1

Hi all, first post on here. I am relatively new to PsychoPy.

In any case, I am trying to display text that is being drawn from a separate conditions file (.xlsx). When the text appears, however, it is being squashed into a narrow column - so the text runs the entire length of the screen, from top to bottom. Of course, this is not what I want. I want the text to appear as a centre-justified paragraph.

I have double and triple checked and formatted the Excel conditions file to ensure that there is nothing dodgy there. I have also checked the height, orientation, etc, on PsychoPy. I can’t seem to get it to work!

Any help would be appreciated. Thank you.



This is probably an issue with using the wrong units. Check what units are specified for the stimulus and/or the default units for the experiment and or the default units for PsychoPy (they apply hierarchically if not defined at a lower level).


Thank you, Michael, for your reply.

Unfortunately, altering the units did not resolve the issue.

I have tried playing around with it to isolate the problem. When I enter free text into the text component directly, then there is no issue with it. However, when the text is being drawn from a separate Excel conditions file, then the text is squashed into a narrow column. (Please see below). Could this be a problem with the formatting in Excel?


Probably not formatting per se, but perhaps explicit line breaks between words within a cell. You need to export to a text format like .csv and view it in a simple text editor that shows invisible characters (like spaces and return characters). Excel hides a lot of this stuff.


Hi Michael, thank you for this tip - it has resolved my issue. I have been trying to fix this for days (!).

Yes, unbeknownst to me, when the conditions file was saved as .xlsx Excel was adding hidden characters in the string, hence the weird formatting of the text in PsychoPy. When the conditions file was converted to .csv, I noticed that Excel had added some characters that I did not initially include (such as ‘?’ and ‘!’ marks). Once I removed these, the text was displaying as normal in PsychoPy.

So from now on I will be saving all my conditions files as .csv.

Thanks again!