Is it possible to use gscatter within app designer?
5 views (last 30 days)
I am trying to write package an application for my team to run principal component analysis on commonly produced data sets in the lab. Within Matlab, I use gscatter for this, and it works perfectly. I can produce the plots with an app designer app, however, the plot opens as a new window. I would like to project the plot onto the UIAxes. I need to do this so I can add a UI interface to use the gname function to identify data points. I know how to do this with scatter, or plot, but I cannot find a functional way to project gscatter onto the UIAxes. I have tried several methods. Anyone have an idea?
Benjamin Kraus on 1 Aug 2022
What release of MATLAB are you using?
Starting in R2019b, gscatter should work just find within App Designer, but you need to make sure that you are passing the UIAxes handle as a first-input when you call the gscatter command. The ability to pass a parent as a first input was added in R2019b.
By default the figure used for your App Designer apps have the HandleVisibility set to 'off'. This means that the UIAxes (and regular axes) within the app will never be the "current axes". If you fail to specify the axes handle when calling commands like plot, scatter, or gscatter, this will often open a new figure, or reuse another figure that happens to be open at the time.