Change axis property in GUIDE
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Rik
il 24 Ott 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 Commenti
Vedere anche
Categorie
Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!