Announcement

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

  • Axis titles bleeding into plot area

    Hello! First time poster, thank you all for your helpful advice in the past. And apologies if this is duplicative, but I didn't see another thread.

    I am encountering a new problem with my twoway plots. For some reason, the axis labels are being drawn in the plot area itself, as in this hbar:

    use http://ssc.wisc.edu/sscc/pubs/bargraphs/bar_example.dta, clear
    graph hbar, over(sat)

    Click image for larger version

Name:	Graphproblem.png
Views:	1
Size:	94.0 KB
ID:	1704183

    The labels should all be to the left of the axis line but they go onto the plot. It's happening for simple things like this, but also for more complicated ones like coefplot. I'm assuming a permanent margin setting got tweaked somewhere.

    set_default graphics doesn't resolve the issue.
    Any ideas? Thanks!

  • #2
    What scheme are you using? That is not the default s2color. Try updating your installation.

    Code:
    update all

    Comment


    • #3
      Hi Andrew,
      Thanks for that idea. I tried it, and also tried to reset graphics settings to factory defaults. No luck, same result! For what it's worth I'm working with Stata 16.1.

      update all
      set_defaults _all

      use http://ssc.wisc.edu/sscc/pubs/bargraphs/bar_example.dta, clear
      graph hbar, over(sat)
      Click image for larger version

Name:	Graphproblem2.png
Views:	1
Size:	100.6 KB
ID:	1704301

      Comment


      • #4
        You may have to reinstall Stata or contact Technical Services for assistance. If the issue is just the margin, a workaround may be increasing the outer margin gap.

        Code:
        sysuse auto, clear
        set scheme s1mono
        scatter mpg weight, saving(gr1, replace)
        scatter mpg weight, saving(gr2, replace) ysc(outergap(*30))
        gr combine gr1.gph gr2.gph, col(1)
        Click image for larger version

Name:	Graph.png
Views:	1
Size:	24.3 KB
ID:	1704399

        Last edited by Andrew Musau; 04 Mar 2023, 12:54.

        Comment


        • #5
          Thanks again Andrew.
          I tried both suggestions (that extra ysc option and reinstalling Stata from scratch)...same result! I'll reach out to Stata tech support.
          tko

          Comment

          Working...
          X