楼主: zlqs1985
8919 5

[作图问题求助] 如何(在graphregion设为白色的时候)显示绘图区边框? [推广有奖]

  • 2关注
  • 17粉丝

已卖:32份资源

副教授

2%

还不是VIP/贵宾

-

威望
0
论坛币
1020 个
通用积分
12.0990
学术水平
2 点
热心指数
6 点
信用等级
2 点
经验
8730 点
帖子
323
精华
0
在线时间
815 小时
注册时间
2008-9-18
最后登录
2023-1-16

楼主
zlqs1985 发表于 2015-12-10 19:35:10 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
各位老师好,我在绘制一幅图的时候需要将graphregion设置成白色,如下图
密度函数
我现在希望有一个边框将这个图括起来(相当于增加一个x-axis和y-axis,但是不显示刻度和标签),应该怎么做,我的代码如下,多谢各位
  1. twoway (histogram pr_ratio_complex if $sample2015, width(2.5) color(eltblue*0.5)) ///
  2.        (histogram pr_ratio_complex if $sample2010, width(2.5) ///
  3.            fcolor(none) lcolor(black)) ///
  4.            (kdensity pr_ratio_complex if $sample2015, lpattern(solid) lcolor(red) lwidth(medthick)) ///
  5.            (kdensity pr_ratio_complex if $sample2010, lpattern(dash)  lcolor(red) lwidth(medthick)) ///
  6.            ,   ///
  7.            xlabel(20(10)100, labsize(small)) ylabel(, angle(horizontal) labsize(small) format(%3.2f)) ///
  8.            legend(order(1 "2015年北京样本" 2 "2010年北京样本" 3 "密度曲线-2015" 4 "密度曲线-2010") ///
  9.        region(lcolor(white)) col(1) size(small) ring(0) pos(1))  ///
  10.            title("Price-to-Rent ratio",size(medium))  ///
  11.            ytitle("Density",size(medium)) graphregion(color(white)) plotregion(margin(0))
复制代码


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Region phreg GRAPH GRAP RAP 如何

沙发
zlqs1985 发表于 2015-12-11 10:31:43
   有会的老师指点一下吧,谢谢

藤椅
niuniuyiwan 在职认证  发表于 2015-12-22 11:09:34
  1. *scheme(s1color) or set scheme s1color

  2. sysuse sp500, clear
  3. #d;
  4. histogram volume, freq normal
  5. ylabel(0(10)60, grid)
  6. subtitle("S&P 500, January 2001 - December 2001")
  7. note("Source:  Yahoo!Finance and Commodity Systems, Inc.") scheme(s2color)
  8. name(g1,replace);
  9. #d cr

  10. sysuse sp500, clear
  11. #d;
  12. histogram volume, freq normal
  13. ylabel(0(10)60, grid)
  14. subtitle("S&P 500, January 2001 - December 2001")
  15. note("Source:  Yahoo!Finance and Commodity Systems, Inc.") scheme(s1color)
  16. name(g2,replace);
  17. #d cr
复制代码



板凳
niuniuyiwan 在职认证  发表于 2015-12-22 11:10:15
  1. *scheme(s1color) or set scheme s1color

  2. sysuse sp500, clear
  3. #d;
  4. histogram volume, freq normal
  5. ylabel(0(10)60, grid)
  6. subtitle("S&P 500, January 2001 - December 2001")
  7. note("Source:  Yahoo!Finance and Commodity Systems, Inc.") scheme(s2color)
  8. name(g1,replace);
  9. #d cr

  10. sysuse sp500, clear
  11. #d;
  12. histogram volume, freq normal
  13. ylabel(0(10)60, grid)
  14. subtitle("S&P 500, January 2001 - December 2001")
  15. note("Source:  Yahoo!Finance and Commodity Systems, Inc.") scheme(s1color)
  16. name(g2,replace);
  17. #d cr
复制代码

g1.png


g2.png


报纸
niuniuyiwan 在职认证  发表于 2015-12-22 11:20:39
  1. //法二:
  2. set scheme s2color
  3. sysuse sp500, clear
  4. #delimit ;
  5. histogram volume, freq
  6. xaxis(1 2)
  7. yaxis(1 2)
  8. ylabel(0(10)60, grid)
  9. xlabel("", axis(2) grid gmax)
  10. ylabel("", axis(2) grid gmax)
  11. xtitle("", axis(2))
  12. ytitle("", axis(2))
  13. subtitle("S&P 500, January 2001 - December 2001")
  14. note("Source:  Yahoo!Finance and Commodity Systems, Inc.")
  15. ;
  16. #delimit cr
复制代码
Graph.png

地板
zlqs1985 发表于 2015-12-26 11:20:59
@niuniuyiwan  十分感谢,正式我需要的

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-24 03:12