Announcement

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

  • How to keep graphs produced open, and on the same window.


    I currently have Stata 17.0. I have the following code:


    Code:
    use "C:\Users\bruno\OneDrive\Documents\Trabajo\Robin\Crises Etats Unis.dta", replace
    
    
    generate annee = tq(1947q1) + _n-1
    format annee %tq
    tsset annee
    
    
     
    gen CycleEEUU = Interet/Profit
    tsline CycleEEUU, yline(.3595736),
    graph save "C:\Users\bruno\OneDrive\Documents\Trabajo\Robin\graph_CycleEEUU", replace
    
    
    gen CycleEEUU2 = KFixe/Profit
    tsline CycleEEUU2, yline(1.480631),
    graph save "C:\Users\bruno\OneDrive\Documents\Trabajo\Robin\graph_CycleEEUU2", replace
    
    gen W_P = Salaire/Profit
    tsline W_P, yline(7.680219),
    graph save "C:\Users\bruno\OneDrive\Documents\Trabajo\Robin\graph_W_P", replace
    
    gen TGG = ((Profit+Interet+Impots_Production)/(Salaire+(CoutsNonSalariaux-Impots_Production-Interet)))
    tsline TGG, yline(.3437265),
    graph save "C:\Users\bruno\OneDrive\Documents\Trabajo\Robin\graph_TGG", replace
    
    gen TasaGralG = ((Valeur-(Salaire+KFixe))/(Salaire+KFixe))
    tsline TasaGralG, yline(.3436966),
    graph save "C:\Users\bruno\OneDrive\Documents\Trabajo\Robin\graph_TasaGralG", replace

    As the commands are executed line by line, the graphs open and then immediately are closed as the next one is produced. At the end of the code, only the last graph is shown.

    I'm wondering how do I tell Stata to keep each graph produced open, and to tell subsequent ones to open in the same windows. The effect desired is to have all these graphs in one window.

    I do not wish to merge them, just to make them appear in different tabs in the same window for the sake of convenience.

    Thank you kindly Stata community.

    Regards




  • #2
    See

    Code:
    help set autotabgraphs
    which requires a Windows OS and that the graphs be named.

    Code:
    help name_option

    Comment


    • #3
      Originally posted by Andrew Musau View Post

      Code:
      help name_option
      I input the name option after the tsline command, but Stata tells me this:
      Code:
      . tsline CycleEEUU, yline(.3595736), name(CycleEEUU, replace)
      name:  operator invalid
      r(198);

      Comment


      • #4
        You added a comma unnecessarily. Use:
        Code:
         
          tsline CycleEEUU, yline(.3595736) name(CycleEEUU, replace)

        Comment


        • #5
          Thank you so much ! I really appreciate the input and help. You guys are amazing !

          Comment

          Working...
          X