0

I am trying to display a spectogram in a UIAxes using app designer in MATLAB 2018. The best method I've seemed to find is a workaround where I display a colored image of the spectogram as below. I've used an empty UIFigures position so that all my graphs have the same position and size as shown in ax.

ax = uiaxes(app.UIFigure,"Position",app.UIAxes.Position);
[S,F,T] = spectrogram(y,w);
imagesc(ax, F, T, log(abs(S'))); %plot the log spectrum
set(ax,'YDir', 'normal'); % flip the Y Axis so lower frequencies are at the bottom 
colorbar(ax) 

This however is not ideal and I would like to retain the interactivity of the plot, or at least have a better looking result. Is there a better way to go about this?

This is what it looks like so far - as you can see its not great: enter image description here

Dev-iL
  • 23,742
  • 7
  • 57
  • 99
Intent Filters
  • 189
  • 1
  • 15
  • What's exactly what you don't like about your solution? You create a `uiaxes` and get the image displayed there. That sounds right – Luis Mendo Jan 15 '19 at 13:30
  • Its not interactive. Normally a spectagram figure allows the user to zoom in etc, considering all my others graphs are interactive, I would prefer this one to be as well. – Intent Filters Jan 15 '19 at 13:47
  • @IntentFilters What if you can't have both a "UIFigure" and "Interactive"? Or if it would be extremely difficult to make the UIFigure interactive? – Dev-iL Jan 15 '19 at 14:22

0 Answers0