|
Hi all
I want to hide the empty categories in each panel from the example below. That is: in the first panel I want to show only the Pat. No. 1, 4, 6, 7, 10, 11, 14 on the X-axis, and in the second panel I want only the Pat. No. 2, 3, 5, 9, 12, 13 on the X-axis. Is that possible? and how can this be done? I am using SPSS 15 Thanks in advance Christian * Example: **********. DATA LIST FREE /P01_pat(F8.0) Sequence (F8.0) Pk1 Pk2 . BEGIN DATA 1 1 310 270 4 1 310 260 6 1 370 300 10 1 250 210 11 1 380 350 14 1 330 365 2 2 370 385 3 2 310 400 5 2 380 410 9 2 290 320 12 2 260 340 13 2 90 220 END DATA. Var LAbel Pk1 'Peak' /Pk2 'Peak' /P01_pat 'Pat. No.' /Sequence 'Sequence'. Val LAbel Sequence 1 'A/B' 2 'B/A'. VARSTOCASES /ID = id /MAKE Pk FROM Pk1 Pk2 /INDEX = Teatment(2) /KEEP = P01_pat Sequence /NULL = KEEP. Var Label Teatment 'Teatment'. Val LAbel Teatment 1 'A' 2 'B'. GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=P01_pat Pk Teatment Sequence MISSING = LISTWISE REPORTMISSING=NO /GRAPHSPEC SOURCE=INLINE. BEGIN GPL SOURCE: s=userSource(id("graphdataset")) DATA: P01_pat=col(source(s), name("P01_pat"), unit.category()) DATA: Pk=col(source(s), name("Pk"), unit.category()) DATA: Teatment=col(source(s), name("Teatment"), unit.category()) DATA: Sequence=col(source(s), name("Sequence"), unit.category()) GUIDE: axis(dim(1), label("Pat. No.")) GUIDE: axis(dim(2), label("Peak")) GUIDE: legend(aesthetic(aesthetic.color.exterior), label("Teatment")) SCALE: cat(dim(1)) SCALE: cat(dim(2)) SCALE: cat(aesthetic(aesthetic.color.exterior)) ELEMENT: point(position((P01_pat*Pk)* Sequence), color.exterior(Teatment)) 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 |
|
Try changing the position expression to use nesting:
ELEMENT: point(position(P01_pat/Sequence*Pk), color.exterior(Teatment)) This will construct a panel for each value of Sequence. Within each panel, the X axis (P01_pat) will only show categories that occur within that panel. So each panel will have a different X axis. Note that Pat. No. 7 will not appear in the first panel as you expected, because there is no Pat. No. 7 in the data. Andy Norton SPSS Visualization team ===================== 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 |
|
In reply to this post by la volta statistics
Change the element statement to
ELEMENT: point(position(P01_pat/Sequence*Pk), color.exterior(Teatment)) The nesting operator won't replicate the categories of PO1_pat. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of la volta statistics Sent: Monday, August 11, 2008 6:13 AM To: [hidden email] Subject: GPL: Hiding categories with no data Hi all I want to hide the empty categories in each panel from the example below. That is: in the first panel I want to show only the Pat. No. 1, 4, 6, 7, 10, 11, 14 on the X-axis, and in the second panel I want only the Pat. No. 2, 3, 5, 9, 12, 13 on the X-axis. Is that possible? and how can this be done? I am using SPSS 15 Thanks in advance Christian * Example: **********. DATA LIST FREE /P01_pat(F8.0) Sequence (F8.0) Pk1 Pk2 . BEGIN DATA 1 1 310 270 4 1 310 260 6 1 370 300 10 1 250 210 11 1 380 350 14 1 330 365 2 2 370 385 3 2 310 400 5 2 380 410 9 2 290 320 12 2 260 340 13 2 90 220 END DATA. Var LAbel Pk1 'Peak' /Pk2 'Peak' /P01_pat 'Pat. No.' /Sequence 'Sequence'. Val LAbel Sequence 1 'A/B' 2 'B/A'. VARSTOCASES /ID = id /MAKE Pk FROM Pk1 Pk2 /INDEX = Teatment(2) /KEEP = P01_pat Sequence /NULL = KEEP. Var Label Teatment 'Teatment'. Val LAbel Teatment 1 'A' 2 'B'. GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=P01_pat Pk Teatment Sequence MISSING = LISTWISE REPORTMISSING=NO /GRAPHSPEC SOURCE=INLINE. BEGIN GPL SOURCE: s=userSource(id("graphdataset")) DATA: P01_pat=col(source(s), name("P01_pat"), unit.category()) DATA: Pk=col(source(s), name("Pk"), unit.category()) DATA: Teatment=col(source(s), name("Teatment"), unit.category()) DATA: Sequence=col(source(s), name("Sequence"), unit.category()) GUIDE: axis(dim(1), label("Pat. No.")) GUIDE: axis(dim(2), label("Peak")) GUIDE: legend(aesthetic(aesthetic.color.exterior), label("Teatment")) SCALE: cat(dim(1)) SCALE: cat(dim(2)) SCALE: cat(aesthetic(aesthetic.color.exterior)) ELEMENT: point(position((P01_pat*Pk)* Sequence), color.exterior(Teatment)) 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 |
