Superscript minus vanishes using latex interpreter.

When adding text to a plot, why does text(0.1,0.5,'$\tilde{V}^{+}$','Interpreter','latex')
produce the + superscript sign while
text(0.1,-0.5,'$\tilde{V}^{-}$','Interpreter','latex')
does not give any - superscript.

Respuestas (1)

Oleg Komarov
Oleg Komarov el 3 de Mayo de 2011
You are creating text objects on the same position:
t1 = text(0.1,0.5,'$\tilde{V}^{+}$','Interpreter','latex');
t2 = text(0.1,0.5,'$\tilde{V}^{-}$','Interpreter','latex');
To see the second:
  • delete the first
delete(t1)
  • close the figure before calling t2
  • use different position for t2

8 comentarios

Teja Muppirala
Teja Muppirala el 3 de Mayo de 2011
To illiustrate Oleg's point:
text(0.1,0.5,'$\tilde{V}^{+}$','Interpreter','latex','fontsize',200,'color','r')
text(0.1,0.5,'$\tilde{V}^{-}$','Interpreter','latex','fontsize',200,'color','g')
Oleg Komarov
Oleg Komarov el 3 de Mayo de 2011
@Teja: complementary!
Stian Molvik
Stian Molvik el 3 de Mayo de 2011
y coordinate for t2 is -0.5 instead of 0.5 as i wrote earlier. They do not overlap, but still I do not get superscript minus.
Oleg Komarov
Oleg Komarov el 3 de Mayo de 2011
Try to look at your axes then =)
Stian Molvik
Stian Molvik el 3 de Mayo de 2011
It doesn't matter if I try adding only one text object or two, it doesn't make any sense to 'look at the axes'.
The V with tilde above it shows up but the minus is neglected. If I change the - to a +, the + shows up. Is anyone able to display superscript -?
Oleg Komarov
Oleg Komarov el 3 de Mayo de 2011
If you're simply calling:
t1 = text(0.1,0.5,'$\tilde{V}^{+}$','Interpreter','latex');
t2 = text(0.1,-0.5,'$\tilde{V}^{-}$','Interpreter','latex');
Then you '-' minus subscript will be positioned in x = .1 and y = -.5 but you y-axes are [0 ... whatever]
And me and Teja could see it and I bet many others.
Teja Muppirala
Teja Muppirala el 3 de Mayo de 2011
Not to doubt you, but copy and paste these 4 lines into MATLAB. Do you REALLY not see a V with a minus sign there?
clear all;
close all;
figure;
text(0.1 , 0.5,'$\tilde{V}^{-}$','Interpreter','latex','fontsize',200);
If you don't, then I have no idea.
Teja Muppirala
Teja Muppirala el 3 de Mayo de 2011
If you tried the above, and could see the giant V with the minus sign, then it's probably just a case of your axis limits being wrong. In which case, adjust them:
t1 = text(0.1,0.5,'$\tilde{V}^{+}$','Interpreter','latex');
t2 = text(0.1,-0.5,'$\tilde{V}^{-}$','Interpreter','latex');
ylim([-1 1]);

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 3 de Mayo de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by