Announcement

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

  • graph combine gives error "series 3 not found"

    Hi,

    I am trying to create a combined graph of (separate) min, max and midnight temperature and precipitation with series for 1940 and 2022 in York (i.e. just 4 individual graphs).

    I have used the following code:

    Code:
    twoway (sc min_temp month_day if lad_name=="York" & year==1940, yaxis(1) msize(tiny) legend(label(1 "1940"))) || ///
        (sc min_temp month_day if lad_name=="York" & year==2022, yaxis(1) msize(tiny) legend(label(2 "2022"))), title("Min temp in York") name("min_temp", replace)
    
    twoway (sc max_temp month_day if lad_name=="York" & year==1940, yaxis(1) msize(tiny) legend(label(1 "1940"))) || ///
        (sc max_temp month_day if lad_name=="York" & year==2022, yaxis(1) msize(tiny) legend(label(2 "2022"))), title("Max temp in York") name("max_temp", replace)
        
    twoway (sc Temperature_Midnight month_day if lad_name=="York" & year==1940, yaxis(1) msize(tiny) legend(label(1 "1940"))) || ///
        (sc Temperature_Midnight month_day if lad_name=="York" & year==2022, yaxis(1) msize(tiny) legend(label(2 "2022"))), title("Midnight temp in York") name("midnight", replace)
        
    twoway (sc total_precip month_day if lad_name=="York" & year==1940, yaxis(1) msize(tiny) legend(label(1 "1940"))) || ///
        (sc total_precip month_day if lad_name=="York" & year==2022, yaxis(1) msize(tiny) legend(label(2 "2022"))), title("Precipitation in York") name("precip", replace)
        
    graph combine min_temp max_temp midnight precip, name(all, replace)
    My problem is that Stata gives me an error:
    Code:
    series 3 not found
    I'm wondering what is the problem given that Stata generates each graph individually.
    Grateful for any help.







  • #2
    I don't recollect seeing that error message before. It's hard to say more without a data example to reproduce the problem.

    It would be a bit of work but it should be possible to recast the problem as one for the by() option not graph combine.

    See https://journals.sagepub.com/doi/pdf...36867X20976341

    Comment


    • #3
      Thanks Nick. Seems the problem was related to too many graphs open. When I cleared everything it worked. Should have thought about that first!

      Comment

      Working...
      X