358 3

[作图问题求助] stata画图如何将(单位:元)显示在图的最右侧 [推广有奖]

  • 1关注
  • 2粉丝

讲师

12%

还不是VIP/贵宾

-

威望
0
论坛币
48732 个
通用积分
75.5240
学术水平
2 点
热心指数
2 点
信用等级
2 点
经验
47973 点
帖子
83
精华
0
在线时间
666 小时
注册时间
2017-6-20
最后登录
2024-5-15

100论坛币
Stata绘图时,X轴上除了显示标题,还想在最右侧显示“单位:元”,如何做到呢? v2-a5d4b46f8246c8d45f798ca3367b11d3_r.jpg

  1. [size=14px]* Example generated by -dataex-. To install: ssc install dataex[/size]
  2. [size=14px]clear[/size]
  3. [size=14px]input double(france germany hungary italy japan korea)[/size]
  4. [size=14px]6.17   .95  3.01  7.03 11.49 21.97[/size]
  5. [size=14px]6.51   .43  2.62  6.99 12.16 21.13[/size]
  6. [size=14px]6.51  -.86  3.21  6.58 12.56 20.17[/size]
  7. [size=14px]5.66 -1.87   3.2  5.88 12.75 19.31[/size]
  8. [size=14px]4.87 -2.09  5.81     6 12.03 18.41[/size]
  9. [size=14px]3.59 -2.67  5.84   4.8  10.9 17.13[/size]
  10. [size=14px]3.17 -2.27  4.92  4.06  9.96 16.13[/size]
  11. [size=14px]3.94 -1.69  4.26  3.41  9.27 15.22[/size]
  12. [size=14px]3.62 -1.93  2.53  2.91  8.64 14.43[/size]
  13. [size=14px]4.06 -1.63  2.12  2.27  7.98  15.4[/size]
  14. [size=14px]4.66 -1.33   .32  1.44  7.12 15.23[/size]
  15. [size=14px]4.58 -1.32  -.23  1.32  6.39 17.04[/size]
  16. [size=14px]4.58 -1.27 -1.07  1.49  6.22 16.11[/size]
  17. [size=14px]3.42 -1.52  -2.1   .68  5.85 14.09[/size]
  18. [size=14px]3.87 -1.36 -2.11   .96  5.67  12.8[/size]
  19. [size=14px]3.78 -1.44 -1.85   .52  5.23 11.27[/size]
  20. [size=14px]4.04 -1.01 -1.97   .21  4.68 10.58[/size]
  21. [size=14px]4.2  -.33  -1.8   .36  4.61  9.95[/size]
  22. [size=14px]4.25  -.04 -1.72   .52  3.99  9.87[/size]
  23. [size=14px]4.04   -.1 -2.15   .54  3.47   9.9[/size]
  24. [size=14px]   4  -.33 -1.94   .44  2.91 10.37[/size]
  25. [size=14px]3.94  -.92 -1.85   .15  2.89 10.93[/size]
  26. [size=14px]3.69  -.92 -2.61   .36  2.55 11.07[/size]
  27. [size=14px]2.96 -1.25 -3.19  -.05  2.24 10.63[/size]
  28. [size=14px]3.13 -1.46 -3.02  -.36  2.56 10.32[/size]
  29. [size=14px]3.23 -1.54 -3.23  -.53  1.83  9.98[/size]
  30. [size=14px]3.22 -1.19 -3.69  -.45  2.18  9.46[/size]
  31. [size=14px]3.21  -.71 -3.79  -.46  1.91  9.13[/size]
  32. [size=14px]3.47  -.85 -4.24  -.72  1.72  8.52[/size]
  33. [size=14px]3.56  -.95 -4.71   -.5  1.16  7.95[/size]
  34. [size=14px]4.06  -.99 -3.76  -.31  1.52  7.47[/size]
  35. [size=14px]3.99 -1.26 -3.47  -.37   1.2  6.42[/size]
  36. [size=14px]3.72 -1.64 -3.56  -.41   .97  5.28[/size]
  37. [size=14px]3.42 -1.96 -4.07  -.74   .44  4.72[/size]
  38. [size=14px]4.21 -1.58 -3.67   .31   .21  4.33[/size]
  39. [size=14px]3.96 -1.93 -3.81  -.13  -.49  3.92[/size]
  40. [size=14px]4.45 -1.97  -3.2   .11  -.35  4.09[/size]
  41. [size=14px]4.17  -1.9 -3.49  -.09  -.55  4.43[/size]
  42. [size=14px]4.17 -2.11 -3.13  -.04  -.85  4.18[/size]
  43. [size=14px]4.03 -2.41 -3.43  -.24 -1.02  3.96[/size]
  44. [size=14px]4.12 -2.26 -3.99  -.29 -1.56  4.04[/size]
  45. [size=14px]4.03 -2.21 -3.99  -.69 -2.22  4.09[/size]
  46. [size=14px]3.57 -2.29 -3.99 -1.24 -2.35  3.89[/size]
  47. [size=14px]3.42  -2.5 -3.72 -1.39 -2.52  3.44[/size]
  48. [size=14px]3.57 -1.85  -3.4 -1.66  -2.8  3.24[/size]
  49. [size=14px]2.67 -2.28 -4.02 -2.72 -3.02  2.89[/size]
  50. [size=14px]2.43 -1.54 -3.26 -2.47 -3.44  2.26[/size]
  51. [size=14px]1.97 -1.82 -3.83 -3.35 -4.32  1.41[/size]
  52. [size=14px]1.77 -1.56 -3.87 -3.32 -4.82   .52[/size]
  53. [size=14px]1.53 -1.46 -3.78 -3.31 -5.42  -.04[/size]
  54. [size=14px]end[/size]
  55. [size=14px] [/size]
复制代码

最佳答案

Liss_H 查看完整内容

方法1: 画图后,打开该gph图片,右键进入“graph Editor“,有”add text“功能,可以在你想要的任意位置添加文字。 方法2: twoway y x, text(_y _x "Add TEXT") 使用text() option.其中 _y和_x分别是你想让text出现在的y轴和x轴对应的位置。比如你的x轴对应着y=0,x轴最大值对应x=2000,那就 text(-10 2000 "Add text")
关键词:Stata tata generated generate install
沙发
Liss_H 学生认证  发表于 2023-4-24 18:17:49 |只看作者 |坛友微信交流群
方法1:
画图后,打开该gph图片,右键进入“graph Editor“,有”add text“功能,可以在你想要的任意位置添加文字。

方法2:
twoway y x, text(_y _x "Add TEXT")
使用text() option.其中  _y和_x分别是你想让text出现在的y轴和x轴对应的位置。比如你的x轴对应着y=0,x轴最大值对应x=2000,那就
text(-10 2000 "Add text")

使用道具

藤椅
Liss_H 学生认证  发表于 2023-4-25 10:52:17 |只看作者 |坛友微信交流群
  1. tw line y x , xtitle(, place(e))
复制代码


help textbox_options
然后看placement(compassdirstyle). This is: location of textbox override

使用道具

Liss_H 发表于 2023-4-25 10:52
help textbox_options
然后看placement(compassdirstyle). This is: location of textbox override
谢谢,placement option是可以让text显示在特定的方位,但是我想“收入”和“单位:(千元)”显示在同一行,“收入”显示在中间,单位显示在最右侧。

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-17 20:44