Change axis property in GUIDE
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Rik
le 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 commentaires
Voir également
Catégories
En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!