psychopy.org | Reference | Downloads | Github

Refining scale markers

I have rating scale but find the triangle marker too big. Is there any way to reduce the size of the marker without effecting the whole scale?
Are there any other markers apart from the triange and circle?

Hi @esandhu, are you referring to the Slider for online studies? If so, I have logged an issue on GitHub to get this fixed

Thank you for your help.

I am using the offline builder and code.

Is there a way to independently change the size of the marker in relationship to the scale?

Best wishes
Eleanor

Oh in that case, you can easily change the size of the marker using a code component. In the “Begin Routine” tab of the code component, assuming your Slider is called slider and you are using height units for sizing:

slider.marker.size=(.1,.1)

Thank you, I managed to do that.

Is there a similar way to control the size of the labels independent of the axis size? When I try I am not successful.

Best wishes
Eleanor

That’s good, to change the label size requires a bit more code. I think label size will be implemented in the Builder component in the future, but for now you have to change the size of each label object using a loop. In the “Begin Routine” tab:

for label in slider.labelObjs:
    label.height = .01  # Or whatever size you want

Hi dvbridges

I’m a beginner in psychopy and I’ve been looking for solutions in this forum. I’ve been trying to reduce the size of my slider marker and found an indication in this answer. I entered the information you gave, but this is giving a sitaxe error. So, what’s wrong?

slider = visual.Slider (win = win, name = ‘slider’,
size = (1.5, 0.2), pos = (0, 0),
labels = (‘nothing’, ‘much’), ticks = (1,100),
granularity = 0, style = (‘slider’,)
color = ‘white’, font = ‘HelveticaBold’,
flip = False, slider.marker.size = (.1, .1))

Thank you :slight_smile:

Hi @rosanes. Are you building your experiment from Builder? If so, then add a code component, and in the “Begin Routine” tab, add slider.marker.size = (.1, .1). If you are coding from scratch, then here is what is happening. You are creating a Slider object called “slider”. Only after the object has been created, can you call the line of code to change the marker size. You would not pass the line of code as an argument to the Class which creates the object because it does not exist at that point. Instead, write the code after you have created the Slider object:

slider = visual.Slider (win = win, name = ‘slider’,
                        size = (1.5, 0.2), pos = (0, 0),
                        labels = (‘nothing’, ‘much’), ticks = (1,100),
                        granularity = 0, style = (‘slider’,)
                        color = ‘white’, font = ‘HelveticaBold’,
                        flip = False)

slider.marker.size = (.1, .1)
1 Like

Hi @dvbridges,
Yes, I’m building from Builder.
It worked! thank you