|
Hi All
I want to have the point size in a scatter plot proportional to the number of cases representing a specific point. This is possible with the size function [size(n)] in the ELEMENT statement (see syntax example below). Since the points are rather small, I would like the sizes of the points increased by, lets say, a factor of 10. Is that possible through syntax? I tried multiplying n by ten without success. Additionally I would like to have the second legend, the one that displays the sizes of the points, removed or not showing. Is that also possibly be done through syntax? I am using SPSS 15. Thanks, Christian * Syntax Example. ****************. DATA LIST FREE /Subj (F8.0) Rv(F8.2) IC(F8.2). BEGIN DATA 1 7.83 6.57 1 7.42 5.62 1 7.89 6.90 1 7.12 6.57 1 7.88 6.35 1 6.16 4.06 2 7.26 4.29 2 6.71 4.26 2 6.54 4.09 3 6.05 6.01 3 5.42 5.67 END DATA. Compute Delta_RV_IC = RV - IC. Compute Av_RV_IC = (RV + IC )/2. Var LAbel Delta_RV_IC 'Difference' /Av_RV_IC 'Average'. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=Subj /Delta_RV_IC_sd = SD(Delta_RV_IC) /Delta_RV_IC_Mean = MEan(Delta_RV_IC) /Av_RV_IC_mean = MEAN(Av_RV_IC) /n = N. Var Label Av_RV_IC_mean 'Average per patient' /Delta_RV_IC_Mean 'Mean difference per patient'. * Compute n = n * 10. GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=Av_RV_IC_mean Delta_RV_IC_Mean Subj n MISSING=LISTWISE REPORTMISSING=NO /GRAPHSPEC SOURCE=INLINE. BEGIN GPL SOURCE: s=userSource(id("graphdataset")) DATA: Av_RV_IC_mean=col(source(s), name("Av_RV_IC_mean")) DATA: Delta_RV_IC_Mean=col(source(s), name("Delta_RV_IC_Mean")) DATA: Subj=col(source(s), name("Subj"), unit.category()) DATA: n=col(source(s), name("n"), unit.category()) GUIDE: axis(dim(1), label("Average per patient")) GUIDE: axis(dim(2), label("Mean difference per patient")) GUIDE: legend(aesthetic(aesthetic.color.exterior), label("Subject No")) SCALE: cat(aesthetic(aesthetic.color.exterior)) ELEMENT: point(position(Av_RV_IC_mean*Delta_RV_IC_Mean), color.exterior(Subj), size(n) ) END GPL. ******************************* la volta statistics Christian Schmidhauser, Dr.phil.II Weinbergstrasse 108 CH-8006 Zürich Tel: +41 (043) 233 98 01 Fax: +41 (043) 233 98 02 email: mailto:[hidden email] internet: http://www.lavolta.ch/ ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
It's very hard to force an exact match on the point sizes but you can
specify the minimum threshold size using the aestheticMinimum function on the SCALE statement controlling the aesthetic. To remove an automatically created legend, use the null() function on the GUIDE statement. Here's an example: * Chart Builder. GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=engine mpg weight MISSING=LISTWISE REPORTMISSING=NO /GRAPHSPEC SOURCE=INLINE. BEGIN GPL SOURCE: s=userSource(id("graphdataset")) DATA: engine=col(source(s), name("engine")) DATA: mpg=col(source(s), name("mpg")) DATA: weight=col(source(s), name("weight")) GUIDE: axis(dim(1), label("Engine Displacement (cu. inches)")) GUIDE: axis(dim(2), label("Miles per Gallon")) SCALE: linear(aesthetic(aesthetic.size), aestheticMinimum(size."5px")) GUIDE: legend(aesthetic(aesthetic.size), null()) ELEMENT: point(position(engine*mpg), size(weight), color(color.gray)) END GPL. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of la volta statistics Sent: Thursday, August 21, 2008 3:00 AM To: [hidden email] Subject: GPL: point size Hi All I want to have the point size in a scatter plot proportional to the number of cases representing a specific point. This is possible with the size function [size(n)] in the ELEMENT statement (see syntax example below). Since the points are rather small, I would like the sizes of the points increased by, lets say, a factor of 10. Is that possible through syntax? I tried multiplying n by ten without success. Additionally I would like to have the second legend, the one that displays the sizes of the points, removed or not showing. Is that also possibly be done through syntax? I am using SPSS 15. Thanks, Christian * Syntax Example. ****************. DATA LIST FREE /Subj (F8.0) Rv(F8.2) IC(F8.2). BEGIN DATA 1 7.83 6.57 1 7.42 5.62 1 7.89 6.90 1 7.12 6.57 1 7.88 6.35 1 6.16 4.06 2 7.26 4.29 2 6.71 4.26 2 6.54 4.09 3 6.05 6.01 3 5.42 5.67 END DATA. Compute Delta_RV_IC = RV - IC. Compute Av_RV_IC = (RV + IC )/2. Var LAbel Delta_RV_IC 'Difference' /Av_RV_IC 'Average'. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=Subj /Delta_RV_IC_sd = SD(Delta_RV_IC) /Delta_RV_IC_Mean = MEan(Delta_RV_IC) /Av_RV_IC_mean = MEAN(Av_RV_IC) /n = N. Var Label Av_RV_IC_mean 'Average per patient' /Delta_RV_IC_Mean 'Mean difference per patient'. * Compute n = n * 10. GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=Av_RV_IC_mean Delta_RV_IC_Mean Subj n MISSING=LISTWISE REPORTMISSING=NO /GRAPHSPEC SOURCE=INLINE. BEGIN GPL SOURCE: s=userSource(id("graphdataset")) DATA: Av_RV_IC_mean=col(source(s), name("Av_RV_IC_mean")) DATA: Delta_RV_IC_Mean=col(source(s), name("Delta_RV_IC_Mean")) DATA: Subj=col(source(s), name("Subj"), unit.category()) DATA: n=col(source(s), name("n"), unit.category()) GUIDE: axis(dim(1), label("Average per patient")) GUIDE: axis(dim(2), label("Mean difference per patient")) GUIDE: legend(aesthetic(aesthetic.color.exterior), label("Subject No")) SCALE: cat(aesthetic(aesthetic.color.exterior)) ELEMENT: point(position(Av_RV_IC_mean*Delta_RV_IC_Mean), color.exterior(Subj), size(n) ) END GPL. ******************************* la volta statistics Christian Schmidhauser, Dr.phil.II Weinbergstrasse 108 CH-8006 Zürich Tel: +41 (043) 233 98 01 Fax: +41 (043) 233 98 02 email: mailto:[hidden email] internet: http://www.lavolta.ch/ ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
| Free forum by Nabble | Edit this page |
