Plotting a line on same axes as pcolor in GUI

25 views (last 30 days)
Katherine
Katherine on 29 Oct 2011
Answered: Voss on 28 Dec 2021
I'm trying to plot a line on top of my color plot in a GUI made in GUIDE. I would typically use the "hold on" command, but this doesn't work in GUI. Or I would plot(x,y1,x,y2) for two lines. Here's what I've got so far:
p = handles.pAxes;
h = pcolor(p,x,Vi,dos');
set(h,'edgecolor','none')
shading(p,'interp');
colormap(p,'cool');
plot(p,x,vpot);
xlabel(p,'x (A)');
ylabel(p,'E (eV');
Doing this the (x,vpot) plot simply replaces pcolor. Halp!

Answers (1)

Voss
Voss on 28 Dec 2021
hold(handles.pAxes,'on');

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!