Announcement

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

  • By not so compact

    Hi from New Zealand

    I am getting frustrated with the by() option in graph dot. I have had to resort to using the graph editor-- hence not "reproducible" research tut! tut!


    Code:
    graph dot worm if para <12, over(aid) over(gp) ///
    by(para, imargin(tiny)note("") style(compact) ///
    noiyaxes xrescale iscale(*.8) ///
    legend(ring(0) at(12))) ///
    legend(col(3) rowg(*.5) colg(*.5) tit(Animal ID) ) ///
    asyvars ytit("") lines(lw(thin))
    The issue relates to over(gp) i.e. the "x-axis" over, not the "legend" over, over(aid)

    As shown in the attached pic, I end up with the labels for the categorical groups being repeated for every sub graph - note using compact style. I have tried the various "[no]i..." but still no joy. So resort to removing them w ith the "hide" click
    Click image for larger version

Name:	Dot.jpg
Views:	1
Size:	47.3 KB
ID:	1721457



    I have not posted any data - but i was hoping i am just missing something simple

    Last edited by John Moffat; 21 Jul 2023, 21:40.

  • #2
    I'm not understanding the problem. The most I get is
    The issue relates to over(gp) i.e. the "x-axis" over, not the "legend" over, over(aid)
    As shown in the attached pic, I end up with the labels for the categorical groups being repeated for every sub graph - note using compact style.
    but it doesn't really tell me what you expect Stata to give. And, without a data example (which we ask you to provide!!), nobody can work with it to diagnose the issue. Did you just want the leftmost labels?

    Comment


    • #3
      The Graph Editor is reproducible if you record it. You can either play back the recording or you can call the recorded commands using gr_edit:

      Code:
      sysuse nlsw88,clear
      graph dot wage,   over(race) over(south)  by(industry /// 
          ,imargin(tiny) note("") style(compact) ///
          noiyaxes xrescale iscale(*.8) ///
          legend(ring(0) at(12))) ///
          legend(col(3) rowg(*.5) colg(*.5) tit(ID) ) ///
          asyvars ytit("") lines(lw(thin)) name(gr,replace)
       
      gr_edit .plotregion1.grpaxis[2].draw_view.setstyle, style(no) 
      gr_edit .plotregion1.grpaxis[3].draw_view.setstyle, style(no) 
      gr_edit .plotregion1.grpaxis[4].draw_view.setstyle, style(no) 
      
      gr_edit .plotregion1.grpaxis[6].draw_view.setstyle, style(no) 
      gr_edit .plotregion1.grpaxis[7].draw_view.setstyle, style(no) 
      gr_edit .plotregion1.grpaxis[8].draw_view.setstyle, style(no) 
      
      gr_edit .plotregion1.grpaxis[10].draw_view.setstyle, style(no) 
      gr_edit .plotregion1.grpaxis[11].draw_view.setstyle, style(no)
      Click image for larger version

Name:	gr.png
Views:	1
Size:	76.4 KB
ID:	1721472

      Comment


      • #4
        Josh. Thanks for the response and yes I only want the left most labels as with Scott's post above.. I wanted to achieve this without having to use gr edit.

        Thanks Scott. I was not aware of the record commands with gr edit THANK YOU

        FYI using Stata/SE 17
        Last edited by John Moffat; 22 Jul 2023, 15:52.

        Comment

        Working...
        X