필터 지우기
필터 지우기

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

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by