Add title to current axes

27 次查看(过去 30 天)
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 个评论
Ashish Sheikh
Ashish Sheikh 2015-2-25
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??
Guillaume
Guillaume 2015-2-25
What a stupid interview question! Why not use the tool that's specifically designed for the job?

请先登录,再进行评论。

采纳的回答

Jos (10584)
Jos (10584) 2015-2-25
set(get(gca, 'title'), 'string', 'My First Title')
  2 个评论
Ashish Sheikh
Ashish Sheikh 2015-2-25
I think this might be an answer for the question i have asked ... Thanksss
dpb
dpb 2015-2-25
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')

请先登录,再进行评论。

更多回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Title 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by