Change axis property in GUIDE

3 visualizzazioni (ultimi 30 giorni)
An Tran
An Tran il 7 Ott 2017
Risposto: Rik il 24 Ott 2017
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:

Risposte (1)

Rik
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.

Categorie

Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by