# Stata 绘图技巧总结（四）

## 改变图形的外观

### margin：边距

• margin(top_bottom)：medium on the top and the bottom but zero on the left and right.

• margin(sides): medium on the left and right but zero on the top and bottom.

## 吊灯图

• 非常适合处理效果的可视化
• 首先制作一些数据

• diff specifies that the y axis should show the difference between yvar1 and yvar2, i.e. yvar1 - yvar2.
• mean specifies that the x axis should show the mean of yvar1 and yvar2.

• ratio specifies that the y axis should show the ratio of yvar1 and yvar2, i.e. yvar1 / yvar2.
• base(#) specifies a baseline for comparison if either diff or ratio is specified. With diff, base has default 0. With ratio, base has default 1.

## 构建图像

• 显示一幅已经关闭的图

• nofill: show only the combinations of nsw and division.

• asyvars: specifies that the first over() group be treated as yvars.
• ring(0): 控制图例位于绘图区域内
• blabel(bar, format(%4.2f) pos(outside)): 在柱条上方添加数字标签