0
votes

Here is a very simple MWE :

figure
x = 1:10;
plot(x)
title('mytitle','interpreter','none')

And the result with no title showing : enter image description here

I am under Windows 7, Matlab R2015a. I do want the interpreter to be set to 'none' because I will be working with titles containing consecutive underscores - which would fail in Latex. And when I open the figure properties dialog and double-click on the title, it appears and is editable. Once I unselect it though, it disappears again. Help...

1
Why open the figure properties dialog? Also can't reproduce on OS X - Suever
I opened the figure properties dialog to check whether the title would appear in it. And if I do Insert > Title, the title "mytitle" pops up and I can edit it. But once I unselect it, by clicking anywhere on the graph, it disappears again. As if it was sent to the background of everything. - Ben
To add some info : if I set the interpreter to 'latex', the title shows up properly (as long as it respects latex syntax). Unfortunately, I am working with someone else's code at the moment and cannot change variable names so they respect latex syntax. - Ben
That seems like a strange bug. You could always replace all _ with \textunderscore: title(strrep('my__title', '_', '\textunderscore '), 'interpreter', 'latex') - Suever
Wait so what is the title that you used in your initial post? Is that an overloaded function? If so, it's not really a MWE. - Suever

1 Answers

0
votes

The problem here was that Matlab's default font was Helvetica, which is not available on my computer. So make sure to use a font available on your computer, by using the FontName argument if needed.

You can also set the default text font (here Courier) through :

set(0,'defaultTextFontName','Courier')