简体   繁体   English

将主标题放在 plot 八度音阶中的简单方法(内置函数)

[英]Easy way(builtin function) to put Main title in plot in octave

I'm using octave for plotting subplots in same plot and want to add general title isn't there any builtin function like sgtitle in matlab as in that this old question there was a solution but not using any cool builtin functions and octave dosen't.also here Octave - Bugs: bug #55019, new sgtitle function I find there is sgtitle in octave but can't find doc or package name or any thing...is it not fully implemnted yet or some alternative??? I'm using octave for plotting subplots in same plot and want to add general title isn't there any builtin function like sgtitle in matlab as in that this old question there was a solution but not using any cool builtin functions and octave dosen't .also here Octave - Bugs: bug #55019, new sgtitle function我发现 octave 中有sgtitle但找不到 doc 或 package 名称或任何东西???...

I'm asking about package or bultin function not implementation I'll write or copy from someone我问的是 package 或 bultin function 不是实现我会写或从某人那里复制

Depends on your definition of "builtin function" vs 'workaround'.取决于您对“内置函数”与“解决方法”的定义。

A full-window title is simply a title positioned with respect to an empty 'whole window' axis, as opposed to subtitles which are positioned with respect to subplots which take up only a fraction of the window at specific positions.全窗口标题只是相对于空的“整个窗口”轴定位的标题,而不是相对于在特定位置仅占 window 一小部分的子图定位的字幕。

Therefore the 'builtin' way to add a title on an empty whole-window axis, is to simply add a title on an empty whole-window axis.因此,在空的整个窗口轴上添加标题的“内置”方法是简单地在空的整个窗口轴上添加标题。

t = 0:0.01:2*pi;
hold on
s1 = subplot( 2, 2, 1 ); plot( t, sin(t) ); set( s1, 'title', 'Sine of t' );
s2 = subplot( 2, 2, 2 ); plot( t, cos(t) ); set( s2, 'title', 'Cosine of t' );
s3 = subplot( 2, 2, 3 ); plot( t, tan(t) ); set( s3, 'title', 'Tangent of t' );
s4 = subplot( 2, 2, 4 ); plot( t, cot(t) ); set( s4, 'title', 'Cotangent of t' );
S  = axes( 'visible', 'off', 'title', 'Trigonometric Functions' );
hold off

In my opinion, this is as 'builtin' as it gets (in that, I don't think of setting a title on a main axes object to be any less of a builtin functionality than setting a title on the individual subplot axes objects).在我看来,这是“内置”的(因为,我不认为在主轴 object 上设置标题比在单个子图轴对象上设置标题更不是内置功能) .

If by 'builtin' you meant "I'd like to use a single-word command to do this instead of relying on built-in graph properties", then no, octave does not provide such a convenience function.如果“内置”的意思是“我想使用一个单词命令来执行此操作,而不是依赖于内置的图形属性”,那么不,八度不提供这样的便利 function。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM