Announcement

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

  • Graph Question - How to Keep X-Axis Title but Remove Values

    I am creating a twoway graph to showcase a mean outcome by individuals. I am using the following code:

    twoway rcap lb ub variable1 || scatter mean variable1, ///
    xtitle(Variable1) ///
    legend(order(2 "mean" 1 "95% confidence interval") pos(6) ring(1)) ///
    yla(0.1(0.2)0.9, format("%02.1f")) ytitle(Outcome of Interest) title(Outcome of Interest by Variable1)


    I want to keep the x-axis title but remove the individual value labels on the x-axis, ranging from 0-200 (showcased in increments of 50). I added the option xscale(off) to remove the x-axis line values but this removes the values and the x-axis title. I've also tried xscale(noline).

    I've been perusing the Stata manual to no avail. Is it possible to retain the title while removing the x axis values? Thanks!
    Last edited by Claire Silberg; 02 Jan 2024, 13:15.

  • #2
    Code:
    xlab("")

    Comment


    • #3
      I didn't know that xla("") does this -- but it works. See
      Code:
       help axis label options
      for xla(none) as a documented alternative.

      You can do this but why would you want to do it?

      I'd also advise against an axis title like Variable1 -- which is utterly informative.

      Perhaps you're just being cagey about work in progress.

      Comment


      • #4
        Great, this code works. Nick, I'm just being cagey about my real variable name/simplifying the real variable name. Appreciate the prompt responses and thank you both!

        Comment

        Working...
        X