Search code examples
matlabpsychtoolbox

How do I fix the "Unsupported point size requested in Screen('DrawDots')" error?


I have a program which requires the use of the DrawDots function:

[minSmoothPointSize, maxSmoothPointSize, minAliasedPointSize, maxAliasedPointSize] =
Screen('DrawDots', windowPtr, xy [,size] [,color] [,center] [,dot_type][, lenient]);

My line of code looks like this: Screen('DrawDots', scr,[x,y],r*2,color,[],2)

However, when I run the code I get the following error related to this function:

PTB-ERROR: You requested a point size of 49.200000 units, which is not in the range (1.000000 to 20.000000) supported by your graphics hardware.
Error in function DrawDots:     Usage error
Unsupported point size requested in Screen('DrawDots').

The computer I am running this on is brand new, but only has an integrated graphics card (Intel UHD Graphics 630). However, the code works on other computers with a lower quality integrated graphics cards with no problem (Intel HD Graphics 620), so I am wondering if there is some other issue going on.

I have tried switching Matlab to run off of OpenGL rather than the graphics card itself, but that did not work and I got the same error. And, I tried running the program when the OS was set to a lower screen resolution, but that also didn't work. I am running Matlab 2016b on all of the PCs I have tested the code on.

Any suggestions for how to get around this issue would be much appreciated. Thank you.


Solution

  • Two suggestions to try:

    1) Use the Psychtoolbox Shader implementation (use '3', instead of '2' in final parameter to the DrawDots call):

    Screen('DrawDots', scr,[x,y],r*2,color,[],3)
    

    2) Use the FillOval function instead, though this requires 4 parameters for each dot (since FillOval can also draw ovals which aren't circles), so note the difference when specifying the coordinates:

     Screen('FillOval', scr, color, CenterRectOnPointd([0 0 r*2 r*2], x, y));
    

    I'm not sure if you're trying to plot a single dot, or multiple dots in one call, but DrawDots and FillOval also differ slightly in how the parameters of the multiple dots are specified.