Announcement

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

  • Adjusting title size in coefplot

    Hi all,

    I have a question regarding Ben Jann's user-written package 'coefplot', downloaded from SSC.

    I'm trying to plot subgraphs together in one graph, and want to increase the size of the titles of each subgraph. While I am able to get it to work for the overall title, it does not work for the subtitles. Below is my code:

    Code:
    matrix input B = (0, -0.003, 0.009, 0.021, 0.018, 0.022, 0.035, 0.009, -0.005, -0.008, 0.007, 0.020 \ 0, 0.006, 0.011, 0.012, 0.015, 0.015, 0.016, 0.019, 0.020, 0.020, 0.020, 0.021)
    
    matrix input C = (0, -0.003, -0.005, -0.014, -0.014, -0.025, -0.015, -0.042, -0.115, -0.106, -0.092, -0.061 \ 0, 0.002, 0.005, 0.008, 0.010, 0.011, 0.012, 0.013, 0.014, 0.015, 0.015, 0.016)
    
    coefplot mat(C), bylabel("Old lower skilled", size(*1.2)) ///
        || mat(B), bylabel("Young higher skilled", size(*1.2)) ///
        se(2) vertical yline(0, lcolor(gray) lpattern(solid)) xlab(1 "10" 2 "11" 3 "12" 4 "13" 5 "14" 6 "15" 7 "16" 8 "17" 9 "18" 10 "19" 11 "20" 12 "21") byopts(title("{bf:(A) Employment}", size(*1.2) color(black))) xline(3.5 6.5, lstyle(foreground) lpattern(shortdash) lcolor(gray)) recast(connected) ciopts(lcolor(black) recast(rcap)) color(black) graphregion(col(white)) bgcol(white) xlab(, nogrid) ylab(, nogrid)  nooffset nokey msize(small) mcolor(black)
    The figure it produces is this:
    Click image for larger version

Name:	Emp.png
Views:	1
Size:	35.2 KB
ID:	1767380


    How can I increase the size of the subtitles "Old lower skilled" and "Young higher skilled"?

    Many thanks.

  • #2
    PS: Relatedly, is there a way to get rid of the grey shaded boxes within which the subtitles appear, and just have the titles on the white background?

    Comment


    • #3
      Thanks for the data example.

      Code:
      matrix input B = (0, -0.003, 0.009, 0.021, 0.018, 0.022, 0.035, 0.009, -0.005, -0.008, 0.007, 0.020 \ 0, 0.006, 0.011, 0.012, 0.015, 0.015, 0.016, 0.019, 0.020, 0.020, 0.020, 0.021)
      
      matrix input C = (0, -0.003, -0.005, -0.014, -0.014, -0.025, -0.015, -0.042, -0.115, -0.106, -0.092, -0.061 \ 0, 0.002, 0.005, 0.008, 0.010, 0.011, 0.012, 0.013, 0.014, 0.015, 0.015, 0.016)
      
      coefplot mat(C), bylabel("Old lower skilled") ///
          || mat(B), bylabel("Young higher skilled") subtitle(, size(*1.2) bcolor(none)) ///
          se(2) vertical yline(0, lcolor(gray) lpattern(solid)) xlab(1 "10" 2 "11" 3 "12" 4 "13" 5 "14" 6 "15" 7 "16" 8 "17" 9 "18" 10 "19" 11 "20" 12 "21") byopts(title("{bf:(A) Employment}", size(*1.2) color(black)))  xline(3.5 6.5, lstyle(foreground) lpattern(shortdash) lcolor(gray)) recast(connected) ciopts(lcolor(black) recast(rcap)) color(black) graphregion(col(white)) bgcol(white) xlab(, nogrid) ylab(, nogrid)  nooffset nokey msize(small) mcolor(black)
      Click image for larger version

Name:	Graph.png
Views:	1
Size:	32.5 KB
ID:	1767385

      Comment


      • #4
        Thanks very much Andrew!

        I was also wondering if there is a way to adjust the position of the overall title? I want to ensure that it is exactly in the centre. At the moment it seems slightly more towards the left.
        Last edited by Ashani Abayasekara; 11 Nov 2024, 16:18.

        Comment

        Working...
        X