Hi all,
I have done a search of the forum and cannot find a relevant command to inset one graph inside another. Essentially, I have a line graph that shows some points which are very close together and therefore difficult to read (graph 1). I have created another graph which has a smaller axis to show these points, and it also has labelling of each line (graph 2). I would like to inset graph 2 into graph 1. An example image of this is Figure 3 here (note: I tried to upload this several times but was not able to): https://www.nejm.org/doi/full/10.1056/nejmoa2034577
I do not have reproducible code to share as I haven't been able to find any commands to do this. Here is some example code for the types of graph I am trying to do:
Thanks!
I have done a search of the forum and cannot find a relevant command to inset one graph inside another. Essentially, I have a line graph that shows some points which are very close together and therefore difficult to read (graph 1). I have created another graph which has a smaller axis to show these points, and it also has labelling of each line (graph 2). I would like to inset graph 2 into graph 1. An example image of this is Figure 3 here (note: I tried to upload this several times but was not able to): https://www.nejm.org/doi/full/10.1056/nejmoa2034577
I do not have reproducible code to share as I haven't been able to find any commands to do this. Here is some example code for the types of graph I am trying to do:
Code:
*large graph (graph 1) graph twoway (connected age_under2yr age_2_5yr age_5_10yr age_10_20yr age_20_30yr age_30_40yr age_40_50yr age_50_60 age_60_70 age_70_80 age_over80 year, name(graph1, replace)) *small graph (graph 2) - 25% of graph 1 size graph twoway (connected age_under2yr age_2_5yr age_5_10yr age_10_20yr age_20_30yr age_30_40yr age_40_50yr age_50_60 age_60_70 age_70_80 age_over80 year if year>=2016, fysize(25) fxsize(25) name(graph2, replace)) || /// (scatteri 17.312404 2020 "0-<2 years", msymbol(none) mlabsize(vsmall) mlabcolor(black)) || /// (scatteri 6.3826965 2020 "2-<5 years", msymbol(none) mlabsize(vsmall) mlabcolor(black)) || /// (scatteri 2.0296656 2020 "5-<10 years", msymbol(none) mlabsize(vsmall) mlabcolor(black)) || /// (scatteri .94445709 2020 "10-<20 years", msymbol(none) mlabsize(vsmall) mlabcolor(black)) || /// (scatteri 1.3032674 2020 "20-<30 years", msymbol(none) mlabsize(vsmall) mlabcolor(black)) || /// (scatteri 2.3703822 2020 "30-<40 years", msymbol(none) mlabsize(vsmall) mlabcolor(black)) || /// (scatteri 3.6785837 2020 "40-<50 years", msymbol(none) mlabsize(vsmall) mlabcolor(black)) || /// (scatteri 4.5065522 2020 "50-<60 years", msymbol(none) mlabsize(vsmall) mlabcolor(black)) || /// (scatteri 6.3089339 2020 "60-<70 years", msymbol(none) mlabsize(vsmall) mlabcolor(black)) || /// (scatteri 6.437849 2020 "70-<80 years", msymbol(none) mlabsize(vsmall) mlabcolor(black)) || /// (scatteri 12.434849 2020 "≥80 years", msymbol(none) mlabsize(vsmall) mlabcolor(black)) *code to inset graph 2 in graph 1 [none]
Comment