Main Content

Export Plots in Classification Learner App

After you create plots interactively in the Classification Learner app, you can export your app plots to MATLAB®figures. You can then copy, save, or customize the new figures. Choose among the available plots:scatter plot,并行坐标图,混淆矩阵,ROC curve, andminimum classification error plot

  • Before exporting a plot, make sure the plot in the app displays the same data that you want in the new figure.

  • On the分类学习者tab, in theExport节n, clickExport Plot to Figure。该应用程序从选定的图创建一个图。

    • The new figure might not have the same interactivity options as the plot in the Classification Learner app. For example, data tips for the exported scatter plot show onlyX,Yvalues for the selected point, not the detailed information displayed in the app.

    • Additionally, the figure might have a different axes toolbar than the one in the app plot. For plots in Classification Learner, an axes toolbar appears above the top right of the plot. The buttons available on the toolbar depend on the contents of the plot. The toolbar can include buttons to export the plot as an image, add data tips, pan or zoom the data, and restore the view.

  • Copy, save, or customize the new figure, which is displayed in the figure window.

    • To copy the figure, selectEdit>Copy Figure。For more information, seeCopy Figure to Clipboard from Edit Menu

    • To save the figure, select文件>Save As。Alternatively, you can follow the workflow described inCustomize Figure Before Saving

    • To customize the figure, click the Edit Plot button在图工具栏上。Right-click the section of the plot that you want to edit. You can change the listed properties, which might includeColor,Font,Line Style, and other properties. Or, you can use theProperty Inspector改变图的属性。

As an example, export a scatter plot in the app to a figure, customize the figure, and save the modified figure.

  1. In the MATLAB Command Window, read the sample filefisheriris.csvinto a table.

    fishertable = readtable('fisheriris.csv');
  2. Click theAppstab.

  3. In theApps节n, click the arrow to open the gallery. UnderMachine Learning and Deep Learning, click分类学习者

  4. On the分类学习者tab, in the文件节n, click新会话

  5. 在工作区对话框的新会话中,选择表fishertablefrom theData Set Variablelist.

  6. ClickStart Session。分类学习者creates a scatter plot of the data by default.

  7. Change the predictors in the scatter plot toPetalLengthPetalWidth

    使用预测因子petallength和PetalWidth的Fisher Iris数据中的散点图

  8. On the分类学习者tab, in theExport节n, clickExport Plot to Figure

  9. 在新图中,单击“编辑图”按钮在图工具栏上。右键单击与versicolor虹膜相对应的图中的点。在上下文菜单中,选择Color

    Exported scatter plot for the Fisher iris data with points selected, and the Color option selected in the context menu

  10. In the Color dialog box, select a new color and click好的

    Color dialog box

  11. To save the figure, select文件>Save As。Specify the saved file location, name, and type.

    Exported plot figure window with the Save As option selected in the File menu

相关话题