| Reference | Downloads | Github

Off-center stimulus display strangeness

Hi all,

I have a new issue where all of my stimuli are displayed relative to an off-center origin – that is, instead of (0,0) being assigned to the center of the window/display, it’s assigned more in the bottom left corner of the window.

I’ve installed psychopy through pip/anaconda. I’ve installed all of the dependencies. (I also reinstalled all of anaconda to try to address this issue)

For example, when I run to the “” demo, the text is displayed off-center (bottom left hand corner). When I run the same script in the standalone psychopy, it displays as expected, with the origin at the center of the window.

Note that uses a new visual window (does not use prefs set in the monitor center), so it shouldn’t be an issue with my monitor prefs as defined in psychopy.

The pprint vars() output for win and msg1 (e.g. the displayed text) is the same for both the command-line (off-center) screen and the standalone (correctly-displayed) screen.

Any ideas why the screen origin would be off-center when run from the command line?

I am running:

Python 2.7.13 |Anaconda custom (x86_64)
OS 10.12.3 (Sierra)


1 Like

That looks like a problem with screen resolutions (e.g. the window is reporting one resolution but is actually another). Looks like you’ve on a mac? With a retina display? What version of PsychoPy?

Yes, on a retina macbook pro.

Commandline psychopy: ‘1.84.2’,
Standalone psychopy: ‘1.85.0rc2’

If I include the following code in the demo,

import wx 
app = wx.App(False)
width, height = wx.GetDisplaySize()

… it returns the same values (1440 x 900) for whether it’s run from the commandline (Still offcenter) or standalone (Centered)

Right yes. In 1.84 we were investigating g the use of retina displays - your display reports 1140x900 but is actually 2280x1800. We were experimenting with using that but the work isn’t complete.

In creating the Window there should be a setting called useRetina but that should be set to False to get rid of this behaviour. What is puzzling is that this should be set to False by default anyway.

Yes, nothing changes when I set it to useRetina=False (however, there is an Attribute Error about Window having no attribute ‘context’ when I set it to True).

If I update the anaconda psychoy to ‘1.85.0’, I still get the same off-center presentation.

I fixed it, though I don’t know what was wrong.

It has something to do with pyglet – I was using a version of pyglet I got through mercurial, rather than pip. Once I deleted the mercurial version and reinstalled pyglet with pip, it displayed normally.

I was able to recreate this problem. Macbook w/ Retina display does the off-center strangeness when pyglet 1.3 is installed. This is the version that’s currently being installed with pip (not sure as of when), so I anticipate more people will have this problem.

Forcing pip to install pyglet 1.2.4 fixes it:

pip install pyglet==1.2.4

I’m using psychopy 1.85.3 – not sure if this issue holds for other versions.

1 Like

For anyone having these kinds of issues with PsychoPy 3, downgrading pyglet may again be the solution. I had a similar problem when using PsychoPy 3.2.3 with pyglet 1.4.4, but no trouble after switching to pyglet 1.3.2.

1 Like

Just installed psychopy3 and can confirm that this issue with off-center presentations persists.
pip install pyglet==1.3.2 fixed it


Wondering if anyone else is having this problem. I’ve tried the newest pyglet, 1.3.2 and 1.2.4; in the newer one, my text stimuli at pos = (0,0) is slightly to the left, and in pyglet 1.3.2 pos = (0,0) is in the upper right corner.
Also, when I open the script in terminal, I get the above result, but when I open the same script in PsychoPy coder, my stim is on the bottom right corner… This is really frustrating…

the script for reference, testing this out:

from psychopy import visual
from psychopy.core import wait
win = visual.Window(
size=[1600, 900], pos = [0,0], fullscr=False, screen=1,
winType=‘pyglet’, allowGUI=True, allowStencil=False,
monitor=‘big’, color=‘black’, colorSpace=‘rgb’,
blendMode=‘avg’, useFBO=True,
units=‘cm’, useRetina = True)
nate = visual.TextStim(win, text = “Hey\nNate”, color = (“HotPink”),
bold=True, pos = (0,0), height = 2)

bump… all my stimuli are off-center even with pos = (0,0)