Weird characters when editing figure
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Alejandro Bustos
am 7 Jul. 2022
Kommentiert: Constantino Carlos Reyes-Aldasoro
am 11 Jul. 2022
Hi. I've recently installed MATLAB R2022a and R2017b on a Windows 10 PC. All seems to work fine, but I get weird characters when editing the title or the axis labels of figures.
I’m attaching screenshots of a simple example to highlight the phenomenon. The aspect of the figure is the usual one: the text is completely legible.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1057960/image.jpeg)
However, when double-clicking in the text for editing it, weird/random characters appear instead of the original text.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1057965/image.jpeg)
I get the same behaviour in both versions of MATLAB and don’t why or how to solve it. Any idea?
0 Kommentare
Antworten (2)
Constantino Carlos Reyes-Aldasoro
am 7 Jul. 2022
I would suggest that you do not edit the text of figures. The whole idea of using Matlab instead of photoshop/gimp/illustrator is that the whole figure should be created in code. Then, in case you need to modify in the future (and you will in most cases!) you only need to re-run the code. To expand, create a file for the figure, e.g. Fig1.m, and then write there all your steps to generate your desired figure. When finished, just click RUN at the top and the figure should be created. I have written a book about Matlab for image processing and the last chapter is just about how to create publication-quality figures. Have a look:
1 Kommentar
Constantino Carlos Reyes-Aldasoro
am 7 Jul. 2022
You can also try this link for the book
you may need access from your institution to open the chapters.
Alejandro Bustos
am 11 Jul. 2022
1 Kommentar
Constantino Carlos Reyes-Aldasoro
am 11 Jul. 2022
Why don't you add the correct text for every figure in your code? That would certainly be faster than having to click and re-write.
Another way to do this is throught he command line. First grab a handle to the axis:
hAxis = gca;
this grabs the handles and creates and empty figure, then modify the title in the command line:
hAxis.Title.String ='This is figure 1';
And then you can do this without having to click there. Now, one last thing, the text is sometimes interpreted as latex, i.e.
hAxis.Title.String ='This is figure 1 where x^{2}_{1}';
This may be causing you problems if you use symbols that are interpreted in latex, if you do not want that interpretation, use 'interpreter','none':
hAxis.Title.String ='This is figure 1 where x^{2}_{1}';
hAxis.Title.Interpreter = 'none';
Hope this helps solve your problem.
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!