Insert a colorbar on a GUI?
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hey all,
So I have a Matlab GUI with UI controls that takes user input and does stuff with it. However, I'm looking to add a colorbar on my GUI on the right side, where small bars will appear based on the user input to certain fields. But, there isn't any direct way with guide to do so. How might I go about this? Thanks in advance.
Nathanf
0 Kommentare
Antworten (1)
Paulo Silva
am 4 Aug. 2011
first select the current axes, just in case you have more than one axes on your gui, you also must have the handle for it (h=axes)
axes(h) %select the current axes, the h holds the handle for it
colorbar %now the current axes got one colorbar next to it
The colorbar is also one axes although it doesn't appear to be one, if you want to draw something on it create the colorbar like this hc=colorbar.
axes(hc) %select the colorbar as current axes
now you can draw lines on it.
Simple example, not using one GUI but it's similar
spy
hc=colorbar;
axes(hc);
line(xlim,[50 50],'LineWidth',8,'Color',[1 1 1])
%notice the white line on the colorbar
0 Kommentare
Siehe auch
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!