Tiny data tips in live scripts

5 ビュー (過去 30 日間)
Will Rabinovich
Will Rabinovich 2021 年 4 月 14 日
回答済み: Monisha Nalluru 2021 年 4 月 21 日
I am having a problem using datatips to interactively get values off a plot in a livescript.
If I leave the plot at its default size, the text in the datatip box is at a readable size. However, if I increase the size of the plot using
set(gcf,'Position',[x0 y0 width height])
the text size of the tooltip box becomes tiny and unreadable.
If I open the plot in its own figure window, the text size is larger and readable again. In addition, I have looked up ways to increase the font size of the tool tip and tried them out, but they don't seem to work.
How do I get readable datatip text in the live script?

回答 (1 件)

Monisha Nalluru
Monisha Nalluru 2021 年 4 月 21 日
From my understanding you want to increasing the FontSize in datatip.
The can be done by using FontSize property of datatip.
As an example
plot(1:10);
set(gcf,'Position',[0 0 700 700])
ax = gca;
chart = ax.Children(1);
d = datatip(chart);
d.FontSize = 30;
The above code will set the datatip fontsize as 30 from plot.

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by