Colormapeditor() for UIAxes in App Designer?

14 ビュー (過去 30 日間)
Rod Lopez
Rod Lopez 2021 年 1 月 14 日
コメント済み: Rod Lopez 2021 年 2 月 2 日
I am curious whether or not there is a way that I can edit a colormap for a UIAxes component using the "colormapeditor". I have an app designer app that plots a colormap, and would like a simple solution for allowing the user to edit the map. I am able to perform these edits on a normal figure, but no luck on app.UIAxes. I currently have a menu option callback that calls colormapeditor(app.UIAxes). I do not receive an error, colormapeditor opens and a separate blank figure opens alongside it. What am I missing here? Thank you!!!
  1 件のコメント
Rod Lopez
Rod Lopez 2021 年 2 月 1 日
Update (01 Feb 2021): I found a workaround, but have a warning popping up that I am unable to remove.
I started by copying the app's plot to a blank figure which is hidden from view from the user. Colormapeditor() is then called and makes edits to this figure. A listener in the app updates the app's plot based on this hidden figure, which in turn alters the color map settings based on what the user picks. However, I now get the following warnings, which seems to be related to this listener. Any idea how I might go about fixing them, or perhaps a way to implement colormapeditor() without using this new method?
Warning: Error occurred while executing the listener callback for event MarkedDirty
defined for class matlab.graphics.axis.colorspace.MapColorSpace:
Attempt to modify the tree during an update traversal.

サインインしてコメントする。

採用された回答

Adam Danz
Adam Danz 2021 年 2 月 1 日
編集済み: Adam Danz 2021 年 2 月 1 日
Set the UIFigure's HandleVisibility to ON prior to initializing colormapeditor. Then turn HandleVisibility back off afterwards.
app.UIFigure.HandleVisiblity = 'on';
colormapeditor
When finished,
app.UIFigure.HandleVisiblity = 'off';
  1 件のコメント
Rod Lopez
Rod Lopez 2021 年 2 月 2 日
Thank you, this works perfectly! I did not even think of doing this, as the UIAxes component has its visibility 'on' by default (but not the UIFigure).

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by