Announcement

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

  • Graph Titles and Axes no Longer Automatically Aligned

    In the past, any graphs that I exported automatically had centered titles and axes. This suddenly changed, any graphs I export look like the below image, with the titles not centered and the axis labels off-center.

    Click image for larger version

Name:	Graph.jpg
Views:	1
Size:	59.8 KB
ID:	1579511


    This happens for any type of twoway graph, with any scheme and with any dataset. Running Stata 16.1 for Mac, fully updated and that didn't change anything. Has anyone else had this problem?

    This is the code that generates that graph:
    twoway line y x, title("This is the Title") xtitle("XTitle") ytitle("YTitle")

    Many thanks.

  • #2
    My experiment
    Code:
    sysuse auto, clear
    sort weight
    twoway line mpg weight, title("This is the Title") xtitle("XTitle") ytitle("YTitle")
    on my system
    Code:
    . about
    
    Stata/SE 16.1 for Mac (64-bit Intel)
    Revision 14 Oct 2020
    did not show the artifacts shown in your graph.

    Click image for larger version

Name:	image_20103.png
Views:	1
Size:	98.0 KB
ID:	1579523

    Comment


    • #3
      Hi William,
      Thanks, I have exactly replicated your code and continue to have the same problem. If anyone else has any insights it would be much appreciated. "About" also generates the same on my system:
      Stata/SE 16.1 for Mac (64-bit Intel) Revision 14 Oct 2020

      Comment


      • #4
        I want to revisit your original question. In post #1 you wrote

        any graphs I export look like the below image, with the titles not centered and the axis labels off-center.
        Perhaps I did not duplicate exactly what you did. I ran my code, it displayed nicely on screen, and when I saved it as a PNG that I posted here, it still displayed nicely.

        Today I realized you used "export" which perhaps refers to the graph export command. But when I ran the following code the results were unchanged: it displayed nicely on screen, and the PNG displayed nicely. This really isn't a surprise: I expect that graph export is how the save menu is implemented for graphs.
        Code:
        sysuse auto, clear
        sort weight
        twoway line mpg weight, title("This is the Title") xtitle("XTitle") ytitle("YTitle")
        graph export exported_graph.png, as(png) replace
        Does this precisely match what you're doing, or are you using graph export to create your exported graph in some other format?

        Comment


        • #5
          Your code precisely matches what I am doing (I can copy-paste your code directly). The error occurs at the "twoway" command. Graph export simply saves the graph as it is produced by "twoway". The
          export" component is not important, sorry if that was misleading.

          Comment


          • #6
            Since you are running the latest version of Stata, I suggest you contact Stata Technical Services for their advice and assistance. This is really inexplicable. In the September update a Mac-specific change was made to graph export (as described in the output of help whatsnew) but that would seem to have no bearing on your problem. Still ... .

            With that said, a do-it-yourself task that they will likely recommend is to run the Stata Installation Qualification Test (IQT), which verifies that Stata has been installed properly and that any subsequent software updates are also installed properly. Perhaps something went awry in your installation of the September update.

            https://www.stata.com/support/instal...qualification/

            Comment


            • #7
              Enter graph set and look at your font preferences for the graph window. The default is Helvetica.
              -Chinh Nguyen

              Comment


              • #8
                Hi, I have a similar issue with my twoway graphs. I ran this code:

                Code:
                 
                 sysuse auto, clear sort weight twoway line mpg weight, title("This is the Title") xtitle("XTitle") ytitle("YTitle")
                I have also tried the Stata Installation Qualification Test (IQT) and it passed.

                Is there a solution to this issue?
                Attached Files

                Comment


                • #9
                  The code you tried is

                  Code:
                  sysuse auto, clear 
                  sort weight 
                  twoway line mpg weight, title("This is the Title") xtitle("XTitle") ytitle("YTitle")
                  which doesn't produce anything weird on my set-up (Stata 19.50, Windows). And this code should have worked almost identically since Stata 8.

                  You may need to contact StataCorp Technical Services with information such as Stata version, operating system, graph scheme in use.

                  Comment


                  • #10
                    I've had this issue when trying to use an unsupported font.

                    Code:
                    graph set window fontface "Bad Name"
                    sysuse auto.dta, clear
                    sort weight
                    twoway line mpg weight, title("This is the Title") xtitle("XTitle") ytitle("YTitle")
                    To see the list of supported fonts, you should right click on the graph and select "Preferences". There will be a font drop-down box in the dialog that will list all the supported fonts.

                    Comment

                    Working...
                    X