Plotting#

utilities.plotting.bayesShadedPlot(project, result, options)#

Plots the shaded reflectivities from Bayes output from RAT

Example Usage:

bayesShadedPlot(project, result, 'interval', 65, 'q4', true);
Parameters:
  • project (projectClass) – An instance of the projectClass.

  • result (struct) – The result of the RAT Bayesian calculation.

  • options

    Keyword/value pair to configure plotting, the following are allowed
    • q4 (logical, default: false) indicates if the Y axis should plot Q^4

    • keepAxes (logical, default: false) indicates if the figure should be used without clearing axes.

    • interval (65 or 95, default: 95) Bayesian confidence interval to shade in the plot.

    • showLegend (logical, default: false) indicates if the legend should be shown.

utilities.plotting.plotChain(result)#

Plots MCMC chain from the result of a Bayesian RAT calculation.

Parameters:

result (struct) – The result from a Bayesian RAT calculation.

utilities.plotting.plotHists(result, options)#

Plots the Bayes histogram plot from the chain, with or without smoothing. If selected, smoothing is via a moving average algorithm.

Example Usage:

plotHists(result, 'smooth', false);
Parameters:
  • result (struct) – The result of the RAT Bayesian calculation.

  • options

    Keyword/value pair to configure plotting, the following are allowed
    • figure (‘matlab.ui.Figure’ or int, default: []) figure or number of the figure to use for the plot.

    • smooth (logical, default: true) indicates if moving average smoothing to the plot

utilities.plotting.plotRefSLD(project, result, options)#

Plots the reflectivity and SLD profiles

Example Usage:

plotRefSLD(problem, result, 'showGrid', true, 'q4', true);
Parameters:
  • project (projectClass) – An instance of the projectClass.

  • result (struct) – The result of the RAT calculation.

  • options

    Keyword/value pairs to configure plotting, the following are allowed
    • linearX (logical, default: false) indicates if the X axis should be linear scale instead of log.

    • q4 (logical, default: false) indicates if the Y axis should plot Q^4.

    • showErrorBar (logical, default: true) indicates if the error bar should be shown.

    • showGrid (logical, default: false) indicates if the grid should be shown.

    • showLegend (logical, default: true) indicates if the legend should be shown.

utilities.plotting.plotRefSLDHelper(data, noDelay, linearX, q4, showErrorBar, showGrid, showLegend)#

Helper function to plot the reflectivity and SLD profiles from plot event struct. Most users never need to use this function, rather use useLivePlot for live plotting or plotRefSLD for simple SLD plots.

Example Usage:

plotRefSLDHelper(data, false);

data is a struct created by the RAT plot event. This struct can be created as shown below:

[projectStruct,~,~,~] = parseClassToStructs(project,controls);

data.modelType = project.modelType;
data.reflectivity = result.reflectivity;
data.shiftedData = result.shiftedData;
data.sldProfiles = result.sldProfiles;
data.resampledLayers = result.resampledLayers;
data.dataPresent = projectStruct.dataPresent;
data.subRoughs = result.contrastParams.subRoughs;
data.resample = projectStruct.resample;
data.contrastNames = projectStruct.names.contrasts;

Where project is an instance of the projectClass, controls is an instance of controlsClass and result is the result struct from the RAT calculation.

Parameters:
  • data (struct) – A plot event struct.

  • noDelay (logical, default: true) – Indicates if draw should be delayed.

  • linearX (logical, default: false) – Indicates if the X axis should be linear scale instead of log.

  • q4 (logical, default: false) – Indicates if the Y axis should plot Q^4.

  • showErrorBar (logical, default: true) – Indicates if the error bar should be shown.

  • showGrid (logical, default: false) – Indicates if the grid should be shown.

  • showLegend (logical, default: true) – Indicates if the legend should be shown.

class utilities.plotting.useLivePlot(figureId)#

Sets up a live plot on a given figure. The live plot listens for plot events from the RAT calculation and redraws the plot every time an event is received.

Example Usage:

useLivePlot();   % Opens a new figure for plot
useLivePlot(1);  % Use figure 1 for plot
Parameters:

figureId ('matlab.ui.Figure' or int, default: []) – The number of the figure to use for the live plot.