Announcement

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

  • Graph

    Hi, I've have a problem with a graph. Many time ago, I did "Grafico_ILD" graph but I don't rembember the instruction.
    Today, I used this code
    Code:
    . twoway (scatter ild tempomesi if trattato==0, msymbol(circle_hollow)) (scatter ild tempomesi if trattato==1, msymbol(circle_hollow)) (line ild tempomesi if trattato==0, lcolor(navy) lpattern(solid) connect(ascending) cmissing(n)) (line ild tempomesi if trattato==1, lcolor(maroon) lpattern(solid) connect(ascending))
    but I obtained the second graph. The problem in the second graph is the lines bad quality. How can I resolve my problem? I'm using Stata 12
    Thanks
    Attached Files

  • #2
    Hi Marco,

    I am not quite clear on your issue, so I will try to rephrase it for you and you can let me know. You have tried to reproduce a graph, but the quality/resolution of the graph is not like it was previously. Does this sound correct?

    You can save the graph using different file types, some which are larger files sizes but offer higher resolution. You could try saving these as different file types to find a compromise between quality and size.

    Comment


    • #3
      Hi Matt, i'm sorry and I will try to explain better my problem. Many time ago, I did the first graph and now I'd like to make it again. But I don't remember the code: I've tried to use the code above but I've obtained the second graph. The second graph has a worse lines quality. Do you know which kind of instruction can I use to obtain the first graph again? I think that the problem is about at some graph_option but I don'know which one

      Comment


      • #4
        Marco Lazzeretti I do not see a line quality difference on my browser, but if this is related to the dpi/resolution of graphs then consider exporting to svg, pdf, or eps (vector graphs) to avoid issues. (via the -graph export- command).

        If you are asking about why the graphs look different due to differences in the legend (which is squeezing the space for the y-axis), then, for the legend, you'll need to specify legend labels only for the lines, not the scatterplot points (or keys for 3 and 4, leaving out 1 and 2) with something like:


        Code:
         twoway (scatter ild tempomesi if trattato==0, msymbol(circle_hollow)) (scatter ild tempomesi if trattato==1, msymbol(circle_hollow)) (line ild tempomesi if trattato==0, lcolor(navy) lpattern(solid) connect(ascending) cmissing(n)) (line ild tempomesi if trattato==1, lcolor(maroon) lpattern(solid) connect(ascending))  , legend(order(3 "Pirfinidone untreated" 4 "Pirfinidone treated") r(1))
        Finally, if this really is the same analysis and you expect the same graph then something is amiss.... there is something that has changed in the data.
        Note that the lines differ in length, particularly where ILD (y-axis) values are between c. 5 and 20. The data here are definitely different.
        Eric A. Booth | Senior Director of Research | Far Harbor | Austin TX

        Comment


        • #5
          No, I'm speaking about the lines that connect the points. In graph "Grafico_ILD(wrong)", I have stepped lines; in the other one, I have good lines

          Comment


          • #6
            As I mentioned, looks to me like something to do with the resolution of the figures. The file upload info on your post indicates that the first figure (the jagged one) is 1/2 the size of the second one (35kb vs 78 kb), so I'm not surprised it is lower-res. I dont think this is something you can change via the twoway command. I'd look into exporting with pdf, svg, or eps formats to see if this helps.
            Beyond that we dont have any information about your export commands, OS, or Stata version so I'm not sure what other advice is possible.
            Eric A. Booth | Senior Director of Research | Far Harbor | Austin TX

            Comment


            • #7
              I've understood: it's a different resolution between Windows and Mac. Thank you

              Comment

              Working...
              X