GUI for showing different figures with different data

조회 수: 5 (최근 30일)
Michael Andersson
Michael Andersson 2020년 9월 25일
댓글: Michael Andersson 2020년 10월 8일
I have generated a script that is pulling signals from an oscilloscope and it generates 4 different figures (some with subplots) and each has labels, keys and limits. I would like to create a GUI (inserted at the bottom of my code) that simply shows one figure presented with a texted box underneath with some information relating to a particular figure. Then sampling changed the displayed figure with either the press of a keyboard key or with some buttons on the side of the GUI.
I have been looking into examples and tutorials, but haven’t yet found one that takes a previously generated 'completed' figures like this, and display one at a time.
figure(1);
plot(waveform.XData,waveform.YData);
set(gca,'XTick',(min(waveform.XData):waveform.SecPerDiv:max(waveform.XData)))
xlabel('Time (s)');
ylabel('Volts (V)');
title(Raw_signal_in_time);
grid on;
legend(['Sampled data (Average)'],'Location','northeast','Orientation','horizontal');
figure(2);
plot(H,AllFFT_mean,'DisplayName','Oscilloscope Measured Signal'); hold on;
stem(X2,triH,':^m','BaseValue',-140); hold on;
stem(X2,sqrH,':sr','BaseValue',-140); hold on;
grid minor;
a1 = [1:40]';
b1 = num2str(AllPeaks2);
c1 = cellstr(b1);
text(X1, AllPeaks2, c1,'FontSize', 10, 'Rotation', 60,'HorizontalAlignment','left','VerticalAlignment','baseline');
title(FFT_Response_Compare)
xlabel('Frequency (Hz)');
ylabel('Voltage gain (dB)');
xlim([0 2020]);
hold off;
legend([ ]);
Alternative: I just need a way to display my figures in one full screen figure for presentation purposes with some way of tabbing between plots. So other methods outside of using a GUI might work too, but a GUI does look nicer.
Any thoughts and ideas as the best approach would greatly. Will post back if I get mine working.
Thanks

답변 (1개)

Manas Meena
Manas Meena 2020년 9월 30일
In my understanding you want to display your generated figures in an axes one by one using pushbuttons. You can refer to the following link to achieve this.
One potential workaround for displaying multiple images in a scrollable manner is explained in the following link
  댓글 수: 1
Michael Andersson
Michael Andersson 2020년 10월 8일
Since I posted this, I stepped away from using a gui and just went with more basic methods of displaying all of my figures. However that second link you sent looks like a promising method.
Thanks.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by