# How can I change the radius of a circle pointeur

5 views (last 30 days)
Marie BILLARD on 11 Apr 2017
Commented: Marie BILLARD on 12 Apr 2017
Hi, I'm using the "myginput.m" function and I would like to change the radius of my circle pointer. However, I haven't succeeded. Would anybody have a or the solution ? Thank you in advance.
##### 2 CommentsShowHide 1 older comment
Marie BILLARD on 11 Apr 2017
I found myginput.m function on this link : https://fr.mathworks.com/matlabcentral/fileexchange/12770-myginput So I can change my "arrow" pointer on "circle" pointer. But I don't know how to increase the radius of this circle.

Jan on 11 Apr 2017
Edited: Jan on 12 Apr 2017
This function can set exactly the same pointers as explained in the documentation: See doc figure "pointers" . You cannot set the radius of the circle pointer.
If you want to choose the radius freely, you need to draw the circle by your own.
[EDITED] For creating a 32x32 pointer, see the "PointerShapeCData" point in the posted link.
CData = [ ...
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1; ...
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2; ...
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 0, 0; ...
0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0, 0; ...
0, 0, 0, 0, 0, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0; ...
0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
LUT = [NaN, 1, 2]; % Transparent, black, white
Shape = LUT(CData + 1);
Shape = cat(2, Shape, fliplr(Shape));
Shape = cat(1, Shape, flipud(Shape));
figure('Pointer', 'custom', 'PointerShapeCData', Shape);
This is a circle with 32 pixels diameter with black pixels and a white circle inside. This is visible on light and dark images. If only the black circle is wanted, use: LUT = [NaN, 1, NaN]
Set the 'PointerShapeHotSpot' to [16, 16]. Note, that the center is not exactly at the midpoint of the circle. To get this create a circle with an odd number of pixels.
Marie BILLARD on 12 Apr 2017
ok thank you @Jan Simon

Thorsten on 11 Apr 2017
You have to define your own pointer as a 16 x 16 matrix and then change the line in myginput that changes the pointer to use your pointer. See http://matlab.izmiran.ru/help/techdoc/creating_plots/figure12.html for details how to define a pointer.
Marie BILLARD on 12 Apr 2017
Thank you for your help @Guillaume