Change axis property in GUIDE
3 views (last 30 days)
Show older comments
Hello,
I am trying to change the axis properties using code. This is what I have so far:
axes(handles.EEGAxes)
axes('XTick',0:5:(cislo)/fvz,'YTick',225:100:pocet*100+200,'YTickLabelMode','manual','YTickLabels',popis(nazvy_kanalu(1:pocet)+1)) % popisky osy y,x
tried this aswell
%set(axes, 'XTick', 0:5:(cislo)/fvz);
%set(axes, 'YTick', 225:100:pocet*100+200);
%set(axes, 'YTickLabelMode', 'manual');
%set(axes, 'YTickLabels', popis(nazvy_kanalu(1:pocet)+1));
the result is still the same (pic below)

How can I remove the extra axis which were created?
This is how it looks like in default state

properties of axis in default state:

0 Comments
Answers (1)
Rik
on 24 Oct 2017
Why not use the set command directly on your handle?
set(handles.EEGAxes, 'XTick', 0:5:(cislo)/fvz);
set(handles.EEGAxes, 'YTick', 225:100:pocet*100+200);
set(handles.EEGAxes, 'YTickLabelMode', 'manual');
set(handles.EEGAxes, 'YTickLabels', popis(nazvy_kanalu(1:pocet)+1));
This should not create a new axis object.
It is always best to use explicit assignments, because if you use functions like gca or gcf, user might have switched to another axis or figure in the mean time, which would render your code non-functional.
0 Comments
See Also
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!