Add title to current axes

How one can add title to the plot without using "TITLE" Command???? You cannot even use the figure GUI ?
Can anyone give me an answer?

3 Comments

What's wrong with using title, specifically? What are you trying to do that you're having difficulty with?
h=title(hAx,...
puts the title on the axes referred to by the axes handle hAx...
Because This was asked in one of my interviews. I know only these two ways to give title to a plot ?
I am curiosu to know if there is any other way??
What a stupid interview question! Why not use the tool that's specifically designed for the job?

Sign in to comment.

 Accepted Answer

set(get(gca, 'title'), 'string', 'My First Title')

2 Comments

I think this might be an answer for the question i have asked ... Thanksss
Still, if you can use set, why can't you use title? It also can accept a handle and is less complex syntax.
title(gca,'Your title text')

Sign in to comment.

More Answers (1)

dpb
dpb on 25 Feb 2015
Just reread the question -- guess I didn't follow before. Yes, "TITLE" is included as an option under the "Insert" menu item on figures.

Tags

Asked:

on 24 Feb 2015

Commented:

dpb
on 25 Feb 2015

Community Treasure Hunt

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

Start Hunting!