Data visualization with SAS programming

put all boxplots in 9 cells but in one Panel

Reply
Frequent Contributor
Posts: 76

put all boxplots in 9 cells but in one Panel

Hi All,

 

I have a question here:

If I have 9 variables, I want each variable have one boxplot (all variables have different scales), but the final graph should be 9 cells in one panel. Like the draft graph below:

Any idea?

 

Thanks,

Chen

boxplot.png

Super Contributor
Posts: 284

Re: put all boxplots in 9 cells but in one Panel

sgpanel is the proc you'll want. Look for the "onepanel" and "columns = 3" options to get what you want. Without knowing more about your data there's not much more I can tell you.

SAS Super FREQ
Posts: 890

Re: put all boxplots in 9 cells but in one Panel

Since you are trying to create 9 truly-independent plots, PROC SGPANEL won't work well for you (unless you want to compare them across a unioned scale). The best approach for this would probably be to define a 3 by 3 layout using ODS LAYOUT and generate each box plot using PROC SGPLOT. Let me know if you need more information on this.

 

Thanks!

Dan

Frequent Contributor
Posts: 76

Re: put all boxplots in 9 cells but in one Panel

Hi DanH,

 

I think you are right, they are independent plots and I don't need compare. I've attached my example dataset, could you give me more information?

 

GroupVar1Var2Var3Var4Var5Var6Var7Var8Var9
1251.996.918.824.94000.347717.45324
112.62.217.620.425.85380.30413.74692
111.62.768.725.221.46700.11634.21174
18.92.28821.819.43520.22699.95137
192.378.22319.44970.19728.32456
111.93.28.22423.63690.20096.2845
111.13.338.324.224.53320.19915.9978
16.83.299.729.117.22880.22366.80
17.13.199.82818.12250.22347344
115.22.57.822.622.33700.278511.1658
111.32.568.222.820.73240.19857.75113
111.62.437.520.627.84990.312612.8455
116.22.337.620.630.34630.32113.7537
216.42.757.521.626.85290.2519.120
216.92.77.12128.34550.294910.842
212.63.518.625.421.13910.26767.630
211.22.758.724.724.24550.406414.780
210.73.168.624.226.53700.4115130
212.92.637.521.235.55890.371814.130
211.22.77.822295130.385814.30
213.52.317.220.820.54270.20198.49170
210.63.4310.729.935.83090.23456.83 

 

Thanks,

Chen

Ask a Question
Discussion stats
  • 3 replies
  • 120 views
  • 0 likes
  • 3 in conversation