How to maintain the colormap of two different figures when using GUI
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi there,
I have the problem that my GUI is not able to maintain the original colormap that I ask. I have two different figures, one in gray and another in jet. Plotting in sequence trough independent push-buttons, first the gray displays correctly. When I plot the jet, displays correctly as jet, but also the one that was all fine as gray, turns into jet.
At the beginning I was programming so that both images display using the same push button. Hopping that using independent buttons, did not improve.
It should be a simple fix. Any help please?
Thanks
%The code for OpeningFcn
axes(handles.Axis_1)
ylabel('Distance (mm)')
xlabel('Distance (mm)')
axes(handles.Axis_2)
ylabel('Distance (mm)')
xlabel('Distance (mm)')
% Code for figures
axes(handles.Axis_1)
grayscale1 = mat2gray(log_scale, [-45 -5]);
imagesc(x_axis,axial_distance_water,grayscale1);
colormap(gray);
colorbar;
axis image
xlabel('Lateral length (mm)')
ylabel('Depth (mm)')
axes(handles.Axis_2)
imagesc(x_axis,distance_subset,(slope4(20:end,:)));
colormap(jet);
colorbar;
axis image
xlabel('Lateral length (mm)')
ylabel('Depth (mm)')
Antworten (0)
Siehe auch
Kategorien
Mehr zu Colormaps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!