Filter löschen
Filter löschen

Text in MATLAB plot with negativ coordinates

2 Ansichten (letzte 30 Tage)
Ben
Ben am 3 Jul. 2013
Hello
I am trying to plot text into my existing MATLAB plot. The text should be on the left side of my y-axis. However if I use text(-0.075,0.3,'bla'), the text will always intersect with the y axis no matter what value I choose for the y coordiante. I managed to position the text under the x-axis but somehow it just does not work for my y axis.
Maybe there is an issue with the normalized coordinates of the plot?
Note: Same thing happens when i try to move ylabel to the left
  1 Kommentar
Ben
Ben am 3 Jul. 2013
The problem has been resolved. The problem was that I am pretty lame today and i did not realize I am not working with normalized coordinates...

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Chad Gilbert
Chad Gilbert am 3 Jul. 2013
It might sound paradoxical, but if you set the horizontalalignment to 'right', instead of the default, 'left', your text should line up nicely. E.g.:
hdl = text(x,y, 'example');
set(hdl,'horizontalalignment','left');

Kategorien

Mehr zu Data Import and Export 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!

Translated by