MATLAB: Cant i see the radiobuttons

guiradiobuttons

I'm working on an assignment where I create a GUI that has a an axis and then radio buttons to change the type of line, color, etc. However, when I add the uicontrol objects, they are not appearing on the GUI. The button group appears, but the individual buttons with text do not.
Here is my code for setting up the buttongroup:
mainplot.rb(1)=uibuttongroup('Visible','off','SelectionChangedFcn',{@radiobutton,1},'position',[.05 .12 .1 .3]);
and here is the code to set up on of the buttons:
red=uicontrol(mainplot.rb(1),'style','radiobutton','string','Red','position',[.1 .4 .1 .1],'units','normalized');
I tried setting the whole group to Visible, but that didn't work either. Also, for the postitioning, are the first two numbers the distance from the bottom-left of the figure window, or the bottom-left of the button group window? I think that's the issue I'm having. but I dont know for sure. I've tried many different sets of values, just to try to get it into view, to no avail. I am using 2020a, if that helps

Best Answer

From the documentation,
Setting Property Units
Note that if you are setting both the FontSize and the FontUnits properties in one function call, you must set the FontUnits property first so that the MATLAB software can correctly interpret the specified FontSize. The same applies to figure and axes units — always set the Units property before setting properties whose values you want to be interpreted in those units. For example,
f = figure('Units','characters','Position',[30 30 120 35]);