Insert a colorbar on a GUI?
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Paulo Silva
il 4 Ago 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 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!