Announcement

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

  • Graph Title Not Responding to Options

    Hi Statalisters,

    I am running STATA 18 on M2 Macbook running Macos Sonoma 14.1. My graph titles will not change size or justification no matter how I specify the options to change them. I believe that I am following the syntax suggestion by the help pages and other users on the forum, but nothing I do (change options, set scheme, graph set) seems to make a difference. Here is the code used to create the graph:

    twoway (bar units_average_Rejected relative_year, sort) ///
    , ytitle("Average Total Units") ///
    ytitle(, justification(left) ///
    alignment(middle)) ///
    ylabel(40(10)80, ///
    labsize(default) ///
    labgap(medium)) ///
    xtitle("Relative Year") ///
    xtitle(, justification(left) alignment(middle)) xlabel(-3(1)6, labgap(medium)) ///
    title("Year_pis Based Average Units by Relative Year", size(large) justification(center)) ///
    subtitle("Rejected", size(medium) justification(center)) ///
    name("avg_rejected", replace)

    And here is the produced graph:
    Click image for larger version

Name:	avg_Rejected.png
Views:	1
Size:	64.8 KB
ID:	1737027


    Is this a technical issue? Should I contact Stata support? I am at a bit of a loss!

  • #2
    what are you wanting to see?

    when I run it, I get the centered large font on the title.

    I'd clean it up and drop the double xtitle and use a comma after "Relative Year"
    Last edited by George Ford; 14 Dec 2023, 10:47.

    Comment


    • #3
      Originally posted by George Ford View Post
      what are you wanting to see?

      when I run it, I get the centered large font on the title.

      I'd clean it up and drop the double xtitle and use a comma after "Relative Year"
      Thanks for the suggestion. I want to get the standard centered large font, not the small, left justified font I currently have. I get the current result no matter the font settings I specify.

      Comment


      • #4
        Hmm. May be a Mac issue.

        Try eliminating the double statements of ytitle and xtitle. Maybe MAC doesn't like that (doesn't matter in Windows). In Windows, I can change size of title etc and it works.

        Code:
        twoway (bar units_average_Rejected relative_year, sort) ///
        , ytitle("Average Total Units", justification(left) alignment(middle)) ///
        ylabel(40(10)80, labsize(default) labgap(medium)) ///
        xtitle("Relative Year", justification(left) alignment(middle)) xlabel(-3(1)6, labgap(medium)) ///
        title("Year_pis Based Average Units by Relative Year", size(large) justification(center)) ///
        subtitle("Rejected", size(medium) justification(center)) ///
        name("avg_rejected", replace)

        Comment


        • #5
          I think you might be right about it being a Mac issue. Your provided code still produces the same poorly formatted result on my machine but it produces the correct format on a coworkers Windows device. Playing around in the graph editor revealed that changing text size will move the graph margins as if the text is changing size but no text change occurs. I suppose this is a flag for STATA technical support!

          Comment


          • #6
            This may be a font issue, see if #13 helps: https://www.statalist.org/forums/for...hs-in-stata-17

            Comment


            • #7
              Andrew Musau Thank you for the link, this thread had the exact answer I needed. For some reason my font was set as default to empty so all scripted font changes were being overwritten.

              Comment

              Working...
              X