How to maintain the colormap of two different figures when using GUI
조회 수: 1 (최근 30일)
이전 댓글 표시
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)')
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!