Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
add text to outside plot

Subject: add text to outside plot

From: J G

Date: 1 Apr, 2011 23:22:04

Message: 1 of 5

I would like to add text to a graph but set the location to outside the plotting area.
I tried:

str1 = {'hello'};
text('Location','NorthEastOutside',str1,'FontSize',12);

But this doesn't work. Any suggestions?
Thanks.

Subject: add text to outside plot

From: ImageAnalyst

Date: 2 Apr, 2011 02:10:30

Message: 2 of 5

Try the 'Position' property instead.

Subject: add text to outside plot

From: J G

Date: 3 Apr, 2011 22:00:20

Message: 3 of 5

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <51b7b839-89f1-4b0f-b790-be79d5eec35a@p13g2000yqh.googlegroups.com>...
> Try the 'Position' property instead.

Thanks but this isn't working either. I'm getting the error message:
??? Error using ==> text
Invalid parameter/value pair arguments

Thanks.

Subject: add text to outside plot

From: TideMan

Date: 3 Apr, 2011 22:11:37

Message: 4 of 5

On Apr 4, 10:00 am, "J G" <jemma.geoghe...@gmail.com> wrote:
> ImageAnalyst <imageanal...@mailinator.com> wrote in message <51b7b839-89f1-4b0f-b790-be79d5eec...@p13g2000yqh.googlegroups.com>...
> > Try the 'Position' property instead.
>
> Thanks but this isn't working either.  I'm getting the error message:
> ??? Error using ==> text
> Invalid parameter/value pair arguments
>
> Thanks.

You need to specify the position in terms of the axes you are using:
ylim=get(gca,'YLim');
xlim=get(gca,'XLim')
text(xlim(2),ylim(2),'Outside top right corner',...
   'VerticalAlignment','bottom',...
   "HorizontalAlignment','left')

Subject: add text to outside plot

From: J G

Date: 4 Apr, 2011 00:52:06

Message: 5 of 5

TideMan <mulgor@gmail.com> wrote in message <7e80ad42-9e58-4928-9e40-beb235b0ec08@w9g2000prg.googlegroups.com>...
> On Apr 4, 10:00 am, "J G" <jemma.geoghe...@gmail.com> wrote:
> > ImageAnalyst <imageanal...@mailinator.com> wrote in message <51b7b839-89f1-4b0f-b790-be79d5eec...@p13g2000yqh.googlegroups.com>...
> > > Try the 'Position' property instead.
> >
> > Thanks but this isn't working either.  I'm getting the error message:
> > ??? Error using ==> text
> > Invalid parameter/value pair arguments
> >
> > Thanks.
>
> You need to specify the position in terms of the axes you are using:
> ylim=get(gca,'YLim');
> xlim=get(gca,'XLim')
> text(xlim(2),ylim(2),'Outside top right corner',...
> 'VerticalAlignment','bottom',...
> "HorizontalAlignment','left')

Thanks a lot, this works well.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us