织梦CMS - 轻松建站从此开始!

欧博ABG-会员注册-官网网址

关于stata作图的各种option

时间:2025-10-17 12:42来源: 作者:admin 点击: 3 次
关于stata作图的各种option,编辑逼人学stata在编辑要求下修改图形,解锁了stata作图好多option,总结一下,经管之家(原人大经济论坛)

2.关于坐标轴

关于坐标轴的命令可以查询

help axis_options

复制代码


然后会出现:

    axis_options are grouped into four classes.

        axis_title_options specify the titles to appear next to the axes.  They also allow you to
            format the title fonts.  See [G-3] axis_title_options.

        axis_label_options specify how the axes should be labeled and ticked.  These options allow you
            to control the placement of major and minor ticks and labels.  axis_label_options also
            allow you to add or to suppress grid lines on your graphs.  See [G-3] axis_label_options.

        axis_scale_options specify how the axes should be scaled -- either logarithmic scaled or
            reverse scaled to run from maximum to minimum.  These options also allow you to change the
            range of the axes and the look of the lines that are the axes, including placement.  See
            [G-3] axis_scale_options.

        axis_choice_options control the specific axis on which a plot appears when there are multiple x
            or y axes.  See [G-3] axis_choice_options.

每一项里都有很多细节可以调整

(1)设置横纵坐标标题的字体、方向和大小等

在ytitle、xtitle、 ttitle或者ztitle的option里用以下格式写命令,其中“某个字体的名字”和“坐标轴的标题”用相应的名称替换:

`"{fontface 某个字体的名字:坐标轴的标题}"'

复制代码


至于ytitle、xtitle、 ttitle或者ztitle是什么参见:

help axis_title_options

复制代码


    axis_title_options         Description
    -----------------------------------------------------
    ytitle(axis_title)         specify y axis title
    xtitle(axis_title)         specify x axis title
    ttitle(axis_title)         specify t (time) axis title
    ztitle(axis_title)         specify contour legend axis title

如果想让坐标轴的标题横过来,需要再加axis_title的option“,orientation(horizontal)”但同时坐标轴的每个字都要分开写,否则一行字都会横过来,相当占地方。调整坐标名称大小的话直接加axis_title的option“size( ) ”,具体字符大小的参数和前面提到的一样。举个例子:

,ytitle(`"{fontface 楷体:地}"'`"{fontface 楷体:方}"'`"{fontface 楷体:财}"'`"{fontface 楷体:政}"'`"{fontface 楷体:一}"'`"{fontface 楷体:般}"'`"{fontface 楷体:预}"'`"{fontface 楷体:算}"'`"{fontface 楷体:支}"'`"{fontface 楷体:出}"'`"{fontface 楷体:(万元)}"',orientation(horizontal)  size( medium  ) )

复制代码



(2)设置横纵坐标轴刻度线的位置

可以选(outside|crossing| inside)

scatter  trade  date, xlabel( ,tposition(inside) ) ylabel( ,tposition(inside) )

复制代码


(3)坐标轴起始值显示为0

需要用到plotregion的option margin

[backcolor=rgb(247, 247, 247)]scatter  trade  date, [/backcolor]plotregion(margin(0))

复制代码



(4)坐标轴是否向外延伸

[backcolor=rgb(247, 247, 247)]scatter  trade  date, [/backcolor]xscale(extend  outergap(5pt) )  yscale(extend)

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-10-18 15:10 最后登录:2025-10-18 15:10
栏目列表
推荐内容