MATLAB: How to update Axes LineStyle Order in Matlab Gui

axesfigureguiguidehandleslinestyleset

Dear Community,
I want to change the Linestyle of a Matlab Figure in a Gui. I have a popupmenu with a switch case structure where I can set the property. However, no change occurs whatsoever. I tried whats in commentary with refresdata and so forth, but no change. Do I need to replot all the data with plot (yet I dont know at all times which data I have. Or is there another way for it to update the figure?
Thanks a lot, below the code Ravi
switch get(hObject,'Value')
case 1
set(handles.axes_eis,'LineStyleOrder', '-');
guidata(hObject, handles);
% refreshdata(handles.axes_eis)
% refreshdata(handles.axes_eis,'caller')
% draw now
case 2
set(handles.axes_eis,'LineStyleOrder', '.-');
guidata(hObject, handles);
end
guidata(hObject, handles);

Best Answer

I figured it out. Seems I only need to set the marker of the children in the plot. The Code I used
% --- Executes on selection change in lines_or_points.
function lines_or_points_Callback(hObject, eventdata, handles)
all_child_handles_axes_eis=get(handles.axes_eis,'Children');
all_child_handles_axes_drt=get(handles.axes_drt,'Children');
switch get(handles.lines_or_points, 'Value');
case 1 %LINES
set(all_child_handles_axes_eis(1:end), 'Marker', 'none')
set(all_child_handles_axes_drt(1:end), 'Marker', 'none')
case 2 %POINTS
set(all_child_handles_axes_eis(1:end), 'Marker', '.')
set(all_child_handles_axes_drt(1:end), 'Marker', '.')
end
Related Question