From: Samoline1 Linke on
Hi,

I want to include a textbox in figure

e.g.


plot(a,b)
H={'Testing textbox'}
text(0.5,0.5,H)

Is this the right command? It's not working for me......I can not have both the figure and the text in the same figure.........How shall I make it to have both plot and the textbox in the same figure?
From: Pekka Kumpulainen on
"Samoline1 Linke" <maganatewoman(a)yahoo.com> wrote in message <hm2s3r$15p$1(a)fred.mathworks.com>...
> Hi,
>
> I want to include a textbox in figure
>
> e.g.
>
>
> plot(a,b)
> H={'Testing textbox'}
> text(0.5,0.5,H)
>
> Is this the right command? It's not working for me......I can not have both the figure and the text in the same figure.........How shall I make it to have both plot and the textbox in the same figure?

The default 'units' property of text object is 'data'.
If your text location 0.5 0.5 is outside the ranges of a and b it will exist, but outside the visible area of the axes. You could try for example:
text(0.5,0.5,H,'Units','normalized')
From: Samoline1 Linke on
"Pekka Kumpulainen" <pekka.nospam.kumpulainen(a)tut.please.fi> wrote in message <hm2v72$liq$1(a)fred.mathworks.com>...
> "Samoline1 Linke" <maganatewoman(a)yahoo.com> wrote in message <hm2s3r$15p$1(a)fred.mathworks.com>...
> > Hi,
> >
> > I want to include a textbox in figure
> >
> > e.g.
> >
> >
> > plot(a,b)
> > H={'Testing textbox'}
> > text(0.5,0.5,H)
> >
> > Is this the right command? It's not working for me......I can not have both the figure and the text in the same figure.........How shall I make it to have both plot and the textbox in the same figure?
>
> The default 'units' property of text object is 'data'.
> If your text location 0.5 0.5 is outside the ranges of a and b it will exist, but outside the visible area of the axes. You could try for example:
> text(0.5,0.5,H,'Units','normalized')

-------------

Thanks a lot and do you have any idea which values will put this textbox under the x-axis........
From: Pekka Kumpulainen on
"Samoline1 Linke" <maganatewoman(a)yahoo.com> wrote in message <hm30ns$stq$1(a)fred.mathworks.com>...
> "Pekka Kumpulainen" <pekka.nospam.kumpulainen(a)tut.please.fi> wrote in message <hm2v72$liq$1(a)fred.mathworks.com>...
> > "Samoline1 Linke" <maganatewoman(a)yahoo.com> wrote in message <hm2s3r$15p$1(a)fred.mathworks.com>...
> > > Hi,
> > >
> > > I want to include a textbox in figure
> > >
> > > e.g.
> > >
> > >
> > > plot(a,b)
> > > H={'Testing textbox'}
> > > text(0.5,0.5,H)
> > >
> > > Is this the right command? It's not working for me......I can not have both the figure and the text in the same figure.........How shall I make it to have both plot and the textbox in the same figure?
> >
> > The default 'units' property of text object is 'data'.
> > If your text location 0.5 0.5 is outside the ranges of a and b it will exist, but outside the visible area of the axes. You could try for example:
> > text(0.5,0.5,H,'Units','normalized')
>
> -------------
>
> Thanks a lot and do you have any idea which values will put this textbox under the x-axis........

On MATLAB command line type
doc text
read it through, it's not that long, you will save that time later on. Click on the link to "Text Properties" in the See Also section at the bottom. There's more.
A hint: Normalized units go from 0 to 1, a small negative value for y-direction would be somewhere below the axes. You'll have to play around to find the position you actually want.
From: Samoline1 Linke on
"Pekka Kumpulainen" <pekka.nospam.kumpulainen(a)tut.please.fi> wrote in message <hm32g4$lc1$1(a)fred.mathworks.com>...
> "Samoline1 Linke" <maganatewoman(a)yahoo.com> wrote in message <hm30ns$stq$1(a)fred.mathworks.com>...
> > "Pekka Kumpulainen" <pekka.nospam.kumpulainen(a)tut.please.fi> wrote in message <hm2v72$liq$1(a)fred.mathworks.com>...
> > > "Samoline1 Linke" <maganatewoman(a)yahoo.com> wrote in message <hm2s3r$15p$1(a)fred.mathworks.com>...
> > > > Hi,
> > > >
> > > > I want to include a textbox in figure
> > > >
> > > > e.g.
> > > >
> > > >
> > > > plot(a,b)
> > > > H={'Testing textbox'}
> > > > text(0.5,0.5,H)
> > > >
> > > > Is this the right command? It's not working for me......I can not have both the figure and the text in the same figure.........How shall I make it to have both plot and the textbox in the same figure?
> > >
> > > The default 'units' property of text object is 'data'.
> > > If your text location 0.5 0.5 is outside the ranges of a and b it will exist, but outside the visible area of the axes. You could try for example:
> > > text(0.5,0.5,H,'Units','normalized')
> >
> > -------------
> >
> > Thanks a lot and do you have any idea which values will put this textbox under the x-axis........
>
> On MATLAB command line type
> doc text
> read it through, it's not that long, you will save that time later on. Click on the link to "Text Properties" in the See Also section at the bottom. There's more.
> A hint: Normalized units go from 0 to 1, a small negative value for y-direction would be somewhere below the axes. You'll have to play around to find the position you actually want.



Thank you very much. That was really helpful