Announcement

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

  • Remove top and right axes using twoway with by() option

    Hi,

    I am graphing the following histogram. I want to do the following:
    1. I want to remove the top and right axes borders so it should only have the y axis and x axis line instead of the boxes we have now.
    2. I would like to increase the size of the individual city plots
    3. I would like to increase the space between the graphs Bogota-Manila and New York-Paris i.e. add more white space
    4. I would like to change the y-axis numbering from .002 to 0.002 for all the numbers.

    Here is the code I currently have. How do I modify this for that?


    Code:
    twoway (histogram speed if post_covid==0, by(cityname_corrected) color(blue%40) subtitle(, fcolor(white) lstyle(none))) ///        
           (histogram speed if post_covid==1, by(cityname_corrected) color(yellow%60) subtitle(, fcolor(white) lstyle(none))), ///  
           legend(order(1 "Before March 2020" 2 "After March 2020") region(lstyle(none)))
    Click image for larger version

Name:	histogram_pre_post_covid_by_city.png
Views:	1
Size:	50.0 KB
ID:	1676588


  • #2
    I don't see the edit option for my post anymore so posting here. I figured out how to do points 2, 3 and 4. I would appreciate some help with point 1.

    Comment


    • #3
      I'd use quantile plots here when the shifts between distributions are subtle.

      https://www.statalist.org/forums/help#closure documents the fact that you can't edit a post after 1 hour. That's meant to be a feature. One hour is a compromise, as you can quickly correct minor errors or improve wording that you see when you review what you've said. But the administrators found that some people wanted to edit their posts retrospectively in a way that, accidentally and even occasionally on purpose, usually made them hard to follow. That's contrary to the spirit of a forum.

      Comment

      Working...
      X