Ability to select and change figure objects similar to what plotedit does, but that can be compiled into an executable.

14 visualizzazioni (ultimi 30 giorni)
I would like to be able to select text or lines in my plots/figures with the mouse and change the font, color, size, position (for text) or color, width, position (for lines).
The function plotedit does this very nicely but it does not work in a compiled executable. It is one of the MATLAB functions that does not work in compiled code and my code must be compiled.
Does anyone have a work-around for this? It doesn't have to have all the functionality of plotedit, but maybe the ability to select, move and change the size and color of text and the color of lines (although, line editing is not as important to me as text editing). Thank you in advance, for any help you can give me. Even partial functionality with code snippets would be useful.
The code snippets would preferably be in MATLAB Script but could be a C, C++ or Python Function callable from MATLAB Script. I'm using MATLAB 2024b Update 2. Thanks Bob

Risposte (1)

dpb
dpb circa 13 ore fa
You would have to write your own plotedit functionality via using the <ButtonDownFcn> callback for the line or text objects of interest and process those to implement the desired functionality. No small task; I've not searched FileExchange to see if anybody has made anything like it available. I'm guessing the first step would be a context-sensitive menu to let the user select the functionality, then dispatch the code to do the deed. I've used the interactive edit tool so little I really don't recall just how it operates; I virtually always do everything programmatically instead.
Depending upon the app, it might be simpler to build a separate menu that lists the elements and lets the user select from there rather than the full-blown interactive route...

Categorie

Scopri di più su Entering Commands in Help Center e File Exchange

Prodotti


Release

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by