Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to put tick and labels inside the graph

    Dear Statalisters,

    Is it possible to obtain something like this?

    Code:
    sysuse auto, clear
    
    twoway (scatter mpg price), xtitle(, orientation(horizontal))  ylabel(, angle(horizontal) tposition(inside)  lposition(inside)) */ additional trick here
    Desired result:

    Click image for larger version

Name:	Graph.png
Views:	1
Size:	107.7 KB
ID:	1437582


  • #2
    This is an unusual request. I don't think that there is a specific ylabel option for this but you can use the text option in twoway

    Code:
    sysuse auto, clear
    twoway (scatter mpg price), xtitle(, orientation(horizontal)) ///
    ylabel( 10 " " 20 " " 30 " " 40 " ", tposition(inside)) ///
    text(10 0 "10" 20 0 "20" 30 0 "30" 40 0 "40", place(e))


    Click image for larger version

Name:	ylabel.png
Views:	1
Size:	19.5 KB
ID:	1437737

    Comment


    • #3
      Many thanks, Andrew.

      Yes, this is a nice alternative, even though it can be difficult to implement it for large-scale analysis.

      Thank you so much.

      All the best,

      Tiago

      Comment

      Working...
      X