Create Custom Data Tips with imagesc

28 ビュー (過去 30 日間)
Tyler Gerhardson
Tyler Gerhardson 2021 年 1 月 22 日
コメント済み: Tyler Gerhardson 2021 年 1 月 25 日

採用された回答

Shubham Rawat
Shubham Rawat 2021 年 1 月 25 日
Hi Tyler,
Yes you can modify the data tip of a figure generated with imagesc using the .DataTipTemplate property.
You may modify the following code to use DataTipTemplate property.
C = [0 2 4 6; 8 10 12 14; 16 18 20 22];
clims = [4 18];
i = imagesc(C,clims); % scaled color image object in variable 'i'
d = datatip(i,2,2); % by this data tip show up in image
% without using the above line it will show up the error.
c = i.DataTipTemplate(); % DataTipTemplate is used as function
c =
DataTipTemplate with properties:
DataTipRows: [1×3 matlab.graphics.datatip.DataTipTextRow]
Interpreter: 'tex'
FontSize: 10
FontAngle: 'normal'
FontName: 'Helvetica'
Hope this Helps!
  1 件のコメント
Tyler Gerhardson
Tyler Gerhardson 2021 年 1 月 25 日
Great, thanks!
Didn't realize I needed to call datatip() prior to. Didn't appear needed for scatter() & plot() which is why I was getting tripped up.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeExploration and Visualization についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by