Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Combining graphs as is without resizing.


From   Timothy Mak <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: Combining graphs as is without resizing.
Date   Fri, 12 Jul 2013 16:10:16 +0800

Hi Paul, 

Without seeing your graph, it's hard to tell what your problem is. However, I've always found that one great limitation in -graph combine- is that it combines by matching the graph region axes, whereas I think far more often we would rather it matches by the plot region axes. The only way I know to get it to combine properly often is just by playing around with fxsize and fysize until it works. 

Tim

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Seed, Paul
Sent: 12 July 2013 03:44
To: [email protected]
Subject: st: Combining graphs as is without resizing.

Dear Statalist , 

I have two graphs (aspect ratio 1 for each),  
generated as below. I have taken time over the 
size & position of all the labels, and I like 
the way they look.  

I wish to combine them in a single column 
into one graph, aspect ratio 2, without changing 
anything about either graph.  Is there a way to do it in Stata?
-graph combine- automatically resizes everything. 
I would like a -graph combine, asis- option.

I should say, I am using version 11.2, and I fear the answer will be 
"upgrade to version 13".  But can anyone make it work in version 13?

Many thanks.

******************************
**** Start of Stata code *****
	#delim ;
	rocgold outcome pred1 pred1_2_3 pred1_2_3_4_5 pred2_3_4_5, graph summ
		plot1opts(msymbol(i) lpattern(solid) lcolor(red)  )
		plot2opts(msymbol(i) lpattern(-) lcolor(blue) )
		plot3opts(msymbol(i) lpattern(-.) lcolor(green) )
		plot4opts(msymbol(i) lpattern(..-) lcolor(maroon) )
		legend( 
			order(- "Test: ROC area (SE)"
				1 "pred1: 0.88 (0.03)" 
				2 "pred1+pred2+pred3: 0.88 (0.03)" 
				3 "pred1+pred2+pred3+pred4+pred5: 0.88 (0.03)" 
				4 "pred2+pred3+pred4+pred5: 0.69 (0.05)" 
			) 
				ring(0) 
				pos(4) 
				col(1)  
			colgap(.5)
			rowgap(.8)
			region(lstyle(none))
			symxsize(6)
			size(small)
		)
		graphr(fcolor(white))
		xline(1, lcolor(black) lwidth(thin)) yline(1, lcolor(black) lwidth(thin))
		plotregion(margin(zero))
		ylabel(0 .25 .5 .75 1.0, angle(0) labsize(small) nogrid)
		xlabel(, labsize(small) nogrid)
		aspectratio(1)
		name(roc_a, replace)
	;	
	#delim cr
// This I like.

	#delim ;
	rocgold outcome pred1 pred2 pred3 pred4 pred5, graph summ
		plot1opts(msymbol(i) lpattern(solid) lcolor(red)  )
		plot2opts(msymbol(i) lpattern(-) lcolor(maroon) )
		plot3opts(msymbol(i) lpattern(-.) lcolor(dkorange))
		plot4opts(msymbol(i) lpattern(..-) lcolor(blue))
		plot5opts(msymbol(i) lpattern(_._) lcolor(green) )
		legend( 
			order(- "Test: ROC area (SE)"
				1 "pred1: 0.88 (0.03)" 
				2 "pred2: 0.65 (0.04)" 
				3 "pred3: 0.65 (0.05)" 
				4 "pred3: 0.68 (0.05)" 
				5 "pred5: 0.58 (0.05)"
			) 
				ring(0) 
				pos(4) 
				col(1)  
			colgap(.5)
			rowgap(.8)
			region(lstyle(none))
			symxsize(8)
			size(small)
		)
		graphr(fcolor(white))
		xline(1, lcolor(black) lwidth(thin)) yline(1, lcolor(black) lwidth(thin))
		plotregion(margin(zero))
		ylabel(0 .25 .5 .75 1.0, angle(0) labsize(small) nogrid)
		xlabel(, labsize(small) nogrid)
		aspectratio(1)
		name(roc_b, replace)
	;	
	#delim cr
// This I also like.

graph combine roc_a roc_b, col(1)
// This I hate.  All the legends and text has been resized.
// I prefer to combine using Powerpoint.

****************************
**** End of Stata code *****
****************************


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index