Announcement

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

  • Skewed labels (categorical axis)

    This may be Windows rather than Stata. I drew boxplots split by date batches. To avoid overlapping I angled the batch labels: "graph box yar, over(batch, angle(20)))" . When I did copy and paste from the graph window into a document, the labels were at an angle but not along the axis; they were in a line diagonally across the graph! Making them smaller and at angle(0), the graph copied correctly. My preferred solution was to save the graph as jpg which inserted into the document with angled labels correctly placed.

    For the record, Stata 16.1 pasting into LibreOffice 25.2. Any comments welcome.


    Attached Files

  • #2
    In Stata 16 you can use putdocx to export the graphs into word and then transfer to Libre Office document (note, I think it should be ", label(angle(20))"):

    Code:
    sysuse bplong, clear
    
    putdocx clear
    putdocx begin
    
    graph box bp, over(when, label(angle(20)))
    graph export "one.jpg", replace as(jpg)
    
    graph box bp, over(sex, label(angle(20)))
    graph export "two.jpg", replace as(jpg)
    
    putdocx paragraph
    
    putdocx image ("one.jpg")
    putdocx image ("two.jpg")
    
    putdocx paragraph
    
    putdocx save BoxplotToWord, replace

    Comment


    • #3
      Thanks for correction - i overdid "simplifying". It was over(batch, label(labsize(*.7) angle(30))). I don't think putdocx helps, as the saved jpg just inserts into LibreOffice correctly.

      Comment


      • #4
        Posted my comment twice - no delete function?
        Last edited by R Allan Reese; 13 Apr 2026, 03:00.

        Comment


        • #5
          R Allan Reese Please see https://www.statalist.org/forums/help#closure

          You cannot delete posts. We (you and I and I hope everyone else) agree that being able to delete a post that was just an accidental duplicate would be a good thing.

          But StataCorp host this site, and they have decided that wanting to delete posts is usually inappropriate. So, you can edit your post for one hour, and many of us do that, to reduce typos, improve clarity, and so on.

          Inappropriate reasons for deleting posts in the past have (it seems) included:

          1. I realised I asked a silly or stupid question and it's embarrassing or likely to affect my prospects. -- Someone else may have the same question and in any case deleting a question messes up the thread you started.

          2. As the question has now been answered, it can be deleted. -- That misunderstands the nature of the site, which is a resource for all, not a helpline that happens to be public.

          3. By accident I posted confidential data. -- That is indeed a good reason to ask the Statalist administrators for an edit. See CONTACT US below (if you can't see it, find a machine on which you can).

          That is not a complete list, but you can add other possibilities mentally yourself.

          Stack Exchange offers a different model in which once members have sufficient reputation (points gained for good questions, good answers or some other actions) they can edit other members' answers. It works surprisingly well, although it is subject to many constraints

          Comment

          Working...
          X