No plot browser functionality for charts derived from matlab.gra​phics.char​tcontainer​.ChartCont​ainer?

2 次查看(过去 30 天)
It seems the plot browser functionality does not work for charts created by subclassing both matlab.graphics.chartcontainer.ChartContainer and matlab.graphics.chartcontainer.mixin.Legend. Selecting View->Plot Browser from the figure window opens the plot browser interface side window, but the window is no longer populated(blank) with the selectable primitives plotted on the figure axes. Has anyone else encountered this and is there a way to restore the base MATLAB plot browser functionality without creating a custom context menu/dialog?

回答(1 个)

Abhinaya Kennedy
Abhinaya Kennedy 2024-1-22
When creating custom charts by subclassing ‘matlab.graphics.chartcontainer.ChartContainer’ and using mixins like ‘matlab.graphics.chartcontainer.mixin.Legend’, the Plot Browser may not recognize the custom elements because it is designed for standard MATLAB plots. To address this:
  • Update MATLAB: Ensure you're using the latest MATLAB version for potential fixes.
  • Use of ‘update’ Method: Custom charts should implement an update method that refreshes the chart when data changes. If this method does not correctly update all graphical elements, the Plot Browser may not show them.
  • Implement Methods: Make sure to implement all required methods for custom chart interaction with the Plot Browser, such as ‘getLegendInfo’.
  • Superclass Methods: If you've overridden superclass methods, ensure you're not blocking Plot Browser functionality and call superclass methods appropriately.
If these steps don't restore Plot Browser functionality, consider using standard MATLAB charts or creating a custom UI component to replicate the Plot Browser's features for your custom chart.
You can navigate to this link to find more information on Plot Browser: https://www.mathworks.com/help/matlab/ref/plotbrowser.html

类别

Help CenterFile Exchange 中查找有关 Results, Reporting, and Test File Management 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by