Search code examples
pythonpsychopy

Two different tickHeights on a rating scale in Psychopy


I know that you can customize the tickHeight on rating scales in Psychopy. I want to have two different tickHeights. here's a rough sketch:

Here's a rough sketch:

is this possible? and if so, how do I do it?

This is the code for the rating scale that I have so far:

myRatingScale = visual.RatingScale(myWin, precision=10, showValue=True, low = 1, high = 10, scale ="", tickHeight=5)

Solution

  • It is possible but not easy. If you have a rating scale rs like this:

    rs = visual.RatingScale( ... lots of parameters here ...)
    

    you can create a new line with whatever tick marks as a set of vertices, and then do

    newVertices = [ [x1,y1], .... [xn,yn] ]  # many x,y points -- all up to you
    rs.line.setVertices(newVertices) 
    

    And only then draw the rating scale. I have not tested this but think it will work (or something similar will).