psychopy.org | Reference | Downloads | Github

Different rating scale displays between Mac and windows

Hi,
I am porting code initially written on a Mac to a Dell laptop. I am using PsychoPy 3.2.4 on Python 3.7 on the laptop; PsychoPy 3.2.0 on the Mac. )
Unfortunately, the display on the laptop is all wonky and I can’t figure out why. I can fiddle with parameters to make standard text look ok on the laptop but when I call the rating scale, the scale’s text (labels or scale) are considerably offset to the left from the scale itself.

mywin = visual.Window([900, 900], monitor="testMonitor", units="deg")
myScale = range(10)


rateIt = visual.TextStim(win=mywin, text=('How real was that?'),font='', pos=(0,0),
depth=0, rgb=None, color=(1.0, 1.0, 1.0), colorSpace='rgb', opacity=1.0, contrast=1.0, units='deg', 
ori=0.0, height=None, antialias=True, bold=False, italic=False, alignHoriz='center',
fontFiles=(), wrapWidth=None, flipHoriz=False, flipVert=False, languageStyle='LTR', name=None, autoLog=None)

mstart =random.choice(myScale)
ratingScale = visual.RatingScale(win = mywin, low=0, high=10, precision= 1, 
pos=(0, -0.4), markerStart=mstart,acceptPreText =None,
showValue = None, showAccept = None, 
#labels=("Not", "Totally"),
#textSize=0.25,
leftKeys='left', rightKeys='right',acceptKeys ='return', maxTime=5)

while ratingScale.noResponse:
    rateIt.draw()
    ratingScale.draw() 
    mywin.flip()
  
mywin.close() 

How can I fix this?

Thank you.

I am bumping this because I have yet to solve the problem (not for lack of trying).

First screenshot is from the Mac:

Second from Windows:

Thanks in advance.

I tried putting your script in a .py file and running it (after adding the necessary imports to the top - you might want to include them in the future to make it easier for others to try your script out). Things look basically the same on my Mac as in your first screenshot, as expected. I note that in your script you use the ‘testMonitor’:

mywin = visual.Window([900, 900], monitor="testMonitor", units="deg")

You should probably add monitor settings that are specific to the computer that you are using (click the monitor settings icon in the toolbar at the top of the Coder View). Also, you might want to try out how things work if you change from the “deg” units to e. g. “px”. I’m not saying that you shouldn’t use “deg”, because they are generally preferred as far as I know, but just to understand more what’s going on it’s good to experiment I think.

This was a quick stab from someone not so experienced, sorry if I missed the mark.

Hi, thanks but I am looking for an actual reason behind the wonky display. I can jerry rig a solution but that wouldn’t suffice for an experiment.

Anyone else?

Cheers

That’s interesting. It’s the inverse of the problem I typically see which is that pyglet and retina displays don’t always get along. See thread linked below.

My guess is that it’s still basically an issue of it correcting for something in both cases when it only needs to on the Mac, and so everything is getting bigger and distorted on windows. That said, I can’t figure out why it would be doing it that way rather than working on windows and failing on Mac! It may have to do with the monitor you’re using, are the settings for it comparable across the two?

1 Like

Ok, thank you for pointing me to that thread post. I have now tried my code in the psychopy shell - it looks fine there.

It’s when I run it in Spyder that the problem appears. The same issue with the offset text appears with both my code and all the demos in Spyder, on Windows. Everything looks great in the psychopy shell.

I’m not really sure how to work around this. For now, I’ve just removed all text and run the scale as a VAS but I don’t think that’s the best solution for the experiment. The afore-mentioned jerry-rigging isn’t ideal either, because I will likely have to port the experiment to yet another computer…
Cheers,
L.

Ok, so like the previous poster with a similar problem, I downgraded the pyglet version on the Windows laptop to the one on the mac (1.4.10 to 1.3.2) and stims appear to show up at the right positions. Jeebus, what a relief. I don’t know if it’s the best solution but it beats recoding everything in Matlab/PTB.

1 Like