Dear Statalist users,
I am having trouble creating a break in the axis of a graph. I have tried to use https://www.stata.com/support/faqs/g.../scale-breaks/ but I am having trouble creating the break and combining the graphs with a break in both x and y axes.
This is the code I am currently using. I am trying to make a break so the data points from 0-80 are the majority of the graph and then points at 120 and 240 are on the end with breaks.
I have also attached an image of the graph and I am more than happy to share the date to work with.
I look forward to your help and responses. Please do let me know if you require more information.
Annabelle
I am having trouble creating a break in the axis of a graph. I have tried to use https://www.stata.com/support/faqs/g.../scale-breaks/ but I am having trouble creating the break and combining the graphs with a break in both x and y axes.
This is the code I am currently using. I am trying to make a break so the data points from 0-80 are the majority of the graph and then points at 120 and 240 are on the end with breaks.
I have also attached an image of the graph and I am more than happy to share the date to work with.
Code:
drop if Objective!="A00" drop if Processingdelay==4 | NfL==. keep NfL ID_visit sample_delay disease_grp reshape wide NfL , i(ID_visit) j(sample_delay) string //creates variables of sample_type Ven_p Ven_S Cap_P Cap_S for scatter plots ds ID* dis* , not // lists all string variables in memory of Ven_p Ven_S Cap_P Cap_S local Obj_type `r(varlist)' // local for variables Ven_p Ven_S Cap_P Cap_S local axislabelformat labsize(medium) tlwidth(medium) local axislineformat aspectratio(1) xscale(lwidth(vthin)) yscale(lwidth(vthin)) local scattercircle msymbol(circle) msize(large) mlcolor(none) include "0.1 GRAPHICS_OD.do" //contains colours for scatter plots foreach s_type1 in `Obj_type' { //** Open double loop to run through code comparing each sample_type in varlist with each other in list foreach s_type2 in `Obj_type' { twoway (lfitci `s_type1' `s_type2', clwidth(vthin) clcolor("`INF_Blue_Light'")) /// (scatter `s_type1' `s_type2' if disease_grp==0 , `scattercircle' mcolor("`INF_grey'")) /// (scatter `s_type1' `s_type2' if disease_grp==1 , `scattercircle' mcolor("`INF_Red_Light'")) /// (scatter `s_type1' `s_type2' if disease_grp==2 , `scattercircle' mcolor("`INF_Red'")) /// (scatter `s_type1' `s_type2' if disease_grp==3 , `scattercircle' mcolor("`INF_Indigo_Light'")) /// (scatter `s_type1' `s_type2' if disease_grp==4 , `scattercircle' mcolor("`INF_Indigo'")) /// (scatter `s_type1' `s_type2' if disease_grp==5 , `scattercircle' mcolor("`INF_Indigo_Dark'")) /// (scatter `s_type1' `s_type2' if disease_grp==6 , `scattercircle' mcolor("`INF_Green_Light'")) /// (scatter `s_type1' `s_type2' if disease_grp==7 , `scattercircle' mcolor("`INF_green'")) /// (scatter `s_type1' `s_type2' if disease_grp==8 , `scattercircle' mcolor("`INF_gold'")) /// (function y=x , range(``obj'`analyte'y') lcolor("`INF_Blue'") lwidth(vthin)), /// legend(off) ytitle("`s_type1'", size(medthick)) xtitle("`s_type2'", size(medthick)) /// xlabel("0(20)80", `axislabelformat') xscale(range("0 80")) /// ylabel("0(20)80", `axislabelformat') yscale(range("0 80")) /// `axislineformat' /// name(`s_type1'_`s_type2'_Scat,replace) } }
Annabelle
Comment