フィルターのクリア

How to make a text string follow a "text outline" path on a graph

6 ビュー (過去 30 日間)
Ben
Ben 2020 年 12 月 24 日
コメント済み: Image Analyst 2020 年 12 月 28 日
Hello. In Mathematica, I can use the following Mathematica code to generate a text outline path, and get the 2D points of the text outline. Can I do same thing in MATLAB?
Thanks a lot!
% Mathematica code (not MATLAB):
text = Text[Style["A", Bold]];
tg = DiscretizeGraphics[text, _Text, MaxCellMeasure -> 0.005];
pts = MeshCoordinates[tg];
pts = pts[[Last[FindShortestTour[pts]]]];

回答 (1 件)

Image Analyst
Image Analyst 2020 年 12 月 24 日
Try this:
x = linspace(0, 4*pi, 50);
y = sin(x);
plot(x, y, 'b.-', 'MarkerSize', 15);
hold on;
for k = 1 : length(x)
textHandle = text(x(k), y(k), ' Moving text', 'Color', 'r', 'FontSize', 12, 'FontWeight', 'bold');
pause(0.2);
% Now erase the text to prepare for next time.
delete(textHandle);
end
  1 件のコメント
Image Analyst
Image Analyst 2020 年 12 月 28 日
Ben, I thought it worked great. Why do you not approve?

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

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by