Announcement

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

  • squeezed graphs in graph combine

    I am trying to replicate the code for combing graphs using graph combine, but the size of the produced graph is very small. How can I fix this?
    sysuse auto
    local graphs ""
    forval i = 1/20 {
    scatter mpg weight, name(g`i', replace) nodraw
    local graphs "`graphs' g`i'"
    }
    graph combine `graphs', col(3) xsize(1.5) ysize(20) iscale(*2)
    graph export graphs.png, height(16000)
    Attached Files

  • #2
    Your code can be run easily (thanks!) but it is evidently not what you really want to do.

    You're asking for 20 graphs combined in 3 columns and insisting that the combined result is narrow horizontally and long vertically.

    Evidently graph combine just does what it is told and does not remove shared axis information. The result is bizarre, or a graphical Giacometti

    https://en.wikipedia.org/wiki/Alberto_Giacometti

    -- but what else did you expect?

    So, simply, I am surprised that you seem surprised but puzzled about your real question.

    Comment


    • #3
      Sorry Nick, you are right. Now assume I make 40 graphs with normal size of xsize=4 & ysize=5 and save the output as pdf. All the graphs then are squeezed in one page while I want them to be larger and in 2-3 pages. I attached the pdf.
      Attached Files

      Comment


      • #4
        graph combine has no notion of pages. Split the graphs in groups 14, 13, 13 or whatever makes sense. In any case, there may be scope for better displays making use of by() in one way or another, but it depends what you want to do. See for example

        https://www.statalist.org/forums/for...ailable-on-ssc

        https://www.statalist.org/forums/for...ailable-on-ssc

        -- but there is no magic to making 40 graphs readable beyond giving them the space they need.

        Comment


        • #5
          Thanks very much Nick for your reply.

          Comment

          Working...
          X