Info

This question is closed. Reopen it to edit or answer.

Paste MATLAB numerical value onto an existing image

1 view (last 30 days)
Is it possible to paste a numerical value onto an existing image without using insertText? I want to label the displacement of a beam by using a picture of the beam, with the displacement values showing on the image at the correct location after the script is run. How would I go about doing this? Thank you.

Answers (1)

Walter Roberson
Walter Roberson on 19 Nov 2017
Yes, it is possible. You can render the text into a uicontrol style text, after which there are ways (or at least used to be ways) to ask to render just that control as an image. You would then overwrite parts of the image with the pixels from the rendered text.
The method for rendering a uicontrol to image is not coming to mind at the moment, and I am not finding it as I browse around the HG2 methods for uicontrol. It might be that this only worked for HG1; it will take me a bit of time to dig up the old technique (and I need to go shopping now.)
The alternate method would be to text() into an axes and capture that as an image.

Tags

Community Treasure Hunt

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

Start Hunting!