Announcement

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

  • Coefplot: Increase gap size between subgraphs, decrease font size of subgraph labels, and remove legend

    In coefplot, can someone please tell me how to:
    1) Increase the gap size between subgraphs (I need to do this because, in my real data, the rightmost x-axis label in the left subgraph overlaps with leftmost x-axis label in the right subgraph).
    2) Decrease size of font of subgraphs labels ("Trunk" and "Weight" in the example below)
    3) Remove the legend in the bottom of the graph ("price_t", "mpg_t" and "headroom_t". Somehow this is removed when I only make 1 subgraph and use 'legend(off)', but remains even though I specify 'legend(off)' in what I believe is the global options.

    Here is an example:
    Code:
    sysuse auto, clear
    reg price trunk
    estimates store price_t
    reg mpg trunk
    estimates store mpg_t
    reg headroom trunk
    estimates store headroom_t
    
    reg price weight
    estimates store price_w
    reg mpg weight
    estimates store mpg_w
    reg headroom weight
    estimates store headroom_w
    
    coefplot ///
        (price_t, aseq(Price)) ///
        (mpg_t, aseq(Miles per gallon)) ///
        (headroom_t, aseq(Headroom)) ///
        , bylabel(Trunk) || ///
        (price_w, aseq(Price)) ///
        (mpg_w, aseq(Miles per gallon)) ///
        (headroom_w, aseq(Headroom)) ///
        , bylabel(Weight) || ///
        , swapnames legend(off) xline(0) byopts(xrescale)
    I know this is many request, just help with one of them would improve my graph. Thanks!

  • #2
    coefplot is from SSC, as you are asked to explain (FAQ Advice #12). See highlighted:

    Code:
    sysuse auto, clear
    reg price trunk
    estimates store price_t
    reg mpg trunk
    estimates store mpg_t
    reg headroom trunk
    estimates store headroom_t
    
    reg price weight
    estimates store price_w
    reg mpg weight
    estimates store mpg_w
    reg headroom weight
    estimates store headroom_w
    
    set scheme s1mono
    coefplot ///
        (price_t, aseq(Price)) ///
        (mpg_t, aseq(Miles per gallon)) ///
        (headroom_t, aseq(Headroom)) ///
        , bylabel(Trunk) || ///
        (price_w, aseq(Price)) ///
        (mpg_w, aseq(Miles per gallon)) ///
        (headroom_w, aseq(Headroom)) ///
        , bylabel(Weight) || ///
        , swapnames legend(off) xline(0) byopts(xrescale imargin(*10)) ///
        nokey subtitle(,size(vsmall)) 
    Res.:

    Click image for larger version

Name:	Graph.png
Views:	1
Size:	35.1 KB
ID:	1713486

    Last edited by Andrew Musau; 12 May 2023, 17:19.

    Comment


    • #3
      Andrew Musau once again, thank you for your effective help

      Comment

      Working...
      X