Hi, everyone.
Below is the syntax for a dataset and the GPL syntax afterward. I want the value labels, months, to print on the graph rather than the month number. Ideas? Thanks.
Data list free /Time Mean_Contacts Mean_Total_Time Mean_Service_Time .
begin data
1,3.21,3.48,41.06,2,2.78,2.81,41.08,3,2.65,2.20,37.59,4,2.90,2.50,38.32,5,2.89,2.63,40.07,6,3.12,2.17,35.06,7,3.63,2.10,32.39,8,3.19,1.89,33.36,9,3.21,1.92,32.79,10,3.19,1.99,33.65,11,2.92,2.00,34.45,12,2.90,1.92,34.01
end data .
value labels Time 1 'Oct' 2 'Nov' 3 'Dec' 4 'Jan' 5 'Feb' 6 'Mar' 7 'Apr' 8 'May' 9 'Jun' 10 'Jul' 11 'Aug' 12 'Sep' .
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=Time Mean_Contacts Mean_Total_Time Mean_Service_Time
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: Time=col(source(s), name("Time"))
DATA: Mean_Contacts=col(source(s), name("Mean_Contacts"))
DATA: Mean_Total_Time=col(source(s), name("Mean_Total_Time"))
DATA: Mean_Service_Time=col(source(s),name("Mean_Service_Time"))
GRAPH: begin(origin(12%,13%), scale(90%, 22%))
GUIDE: axis(dim(1), label("Time"), opposite())
GUIDE: axis(dim(2), label("Mean Contacts"))
ELEMENT: line(position(Time*Mean_Contacts))
ELEMENT: point(position(Time*Mean_Contacts), color.interior(color.black), color.exterior(color.white), size(size."7"))
GRAPH: end()
GRAPH: begin(origin(12%, 45%), scale(90%, 21%))
GUIDE: axis(dim(1), label("Time"))
GUIDE: axis(dim(2), label("Mean Total Time"))
ELEMENT: line(position(Time*Mean_Total_Time))
ELEMENT: point(position(Time*Mean_Total_Time), color.interior(color.black), color.exterior(color.white), size(size."7"))
GRAPH: end()
GRAPH: begin(origin(12%, 70%), scale(90%, 20%))
GUIDE: axis(dim(1), label("Time"))
GUIDE: axis(dim(2), label("Mean Service Time"))
ELEMENT: line(position(Time*Mean_Service_Time))
ELEMENT: point(position(Time*Mean_Service_Time), color.interior(color.black), color.exterior(color.white), size(size."7"))
GRAPH: end()
END GPL .
Brian
|
Hi, Brian,
try: DATA: Time=col(source(s), name("Time"), unit.category()) Mario Giesel Munich, Germany Am Dienstag, 16. Februar 2021, 17:02:37 MEZ hat Dates, Brian <[hidden email]> Folgendes geschrieben: Hi, everyone. Below is the syntax for a dataset and the GPL syntax afterward. I want the value labels, months, to print on the graph rather than the month number. Ideas? Thanks. Data list free /Time Mean_Contacts Mean_Total_Time Mean_Service_Time . begin data 1,3.21,3.48,41.06,2,2.78,2.81,41.08,3,2.65,2.20,37.59,4,2.90,2.50,38.32,5,2.89,2.63,40.07,6,3.12,2.17,35.06,7,3.63,2.10,32.39,8,3.19,1.89,33.36,9,3.21,1.92,32.79,10,3.19,1.99,33.65,11,2.92,2.00,34.45,12,2.90,1.92,34.01 end data . value labels Time 1 'Oct' 2 'Nov' 3 'Dec' 4 'Jan' 5 'Feb' 6 'Mar' 7 'Apr' 8 'May' 9 'Jun' 10 'Jul' 11 'Aug' 12 'Sep' . GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=Time Mean_Contacts Mean_Total_Time Mean_Service_Time /GRAPHSPEC SOURCE=INLINE. BEGIN GPL SOURCE: s=userSource(id("graphdataset")) DATA: Time=col(source(s), name("Time")) DATA: Mean_Contacts=col(source(s), name("Mean_Contacts")) DATA: Mean_Total_Time=col(source(s), name("Mean_Total_Time")) DATA: Mean_Service_Time=col(source(s),name("Mean_Service_Time")) GRAPH: begin(origin(12%,13%), scale(90%, 22%)) GUIDE: axis(dim(1), label("Time"), opposite()) GUIDE: axis(dim(2), label("Mean Contacts")) ELEMENT: line(position(Time*Mean_Contacts)) ELEMENT: point(position(Time*Mean_Contacts), color.interior(color.black), color.exterior(color.white), size(size."7")) GRAPH: end() GRAPH: begin(origin(12%, 45%), scale(90%, 21%)) GUIDE: axis(dim(1), label("Time")) GUIDE: axis(dim(2), label("Mean Total Time")) ELEMENT: line(position(Time*Mean_Total_Time)) ELEMENT: point(position(Time*Mean_Total_Time), color.interior(color.black), color.exterior(color.white), size(size."7")) GRAPH: end() GRAPH: begin(origin(12%, 70%), scale(90%, 20%)) GUIDE: axis(dim(1), label("Time")) GUIDE: axis(dim(2), label("Mean Service Time")) ELEMENT: line(position(Time*Mean_Service_Time)) ELEMENT: point(position(Time*Mean_Service_Time), color.interior(color.black), color.exterior(color.white), size(size."7")) GRAPH: end() END GPL . Brian ===================== 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 |
In reply to this post by bdates
Declaring Time to be categorical in the GPL does the trick. On Tue, Feb 16, 2021 at 9:02 AM Dates, Brian <[hidden email]> wrote:
|
I think at some point, we all agreed that returning to share the corrected/working outcome of our questions should be standard protocol. First, thanks Mario and Jon for your speedy and effective input. I also want to thank Andy Wheeler for his post on 'paneled'
GPL for separate variables with different scales, from which this is an expansion. Here's the resulting syntax with the changes highlighted and underlined.
Data list free /Time Mean_Contacts Mean_Total_Time Mean_Service_Time .
begin data
1,3.21,3.48,41.06,2,2.78,2.81,41.08,3,2.65,2.20,37.59,4,2.90,2.50,38.32,5,2.89,2.63,40.07,6,3.12,2.17,35.06,7,3.63,2.10,32.39,8,3.19,1.89,33.36,9,3.21,1.92,32.79,10,3.19,1.99,33.65,11,2.92,2.00,34.45,12,2.90,1.92,34.01
end data .
value labels Time 1 'Oct' 2 'Nov' 3 'Dec' 4 'Jan' 5 'Feb' 6 'Mar' 7 'Apr' 8 'May' 9 'Jun' 10 'Jul' 11 'Aug' 12 'Sep' .
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=Time Mean_Contacts Mean_Total_Time Mean_Service_Time
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA:
Time=col(source(s), name("Time"), unit.category())
DATA: Mean_Contacts=col(source(s), name("Mean_Contacts"))
DATA: Mean_Total_Time=col(source(s), name("Mean_Total_Time"))
DATA: Mean_Service_Time=col(source(s),name("Mean_Service_Time"))
GRAPH: begin(origin(12%,13%), scale(90%, 22%))
GUIDE: axis(dim(1), label("Time"), opposite())
GUIDE: axis(dim(2), label("Mean Contacts"))
ELEMENT: line(position(Time*Mean_Contacts))
ELEMENT: point(position(Time*Mean_Contacts), color.interior(color.black), color.exterior(color.white), size(size."7"))
GRAPH: end()
GRAPH: begin(origin(12%, 43%), scale(90%, 19%))
GUIDE: axis(dim(1), label("Time"))
GUIDE: axis(dim(2), label("Mean Total Time"))
ELEMENT: line(position(Time*Mean_Total_Time))
ELEMENT: point(position(Time*Mean_Total_Time), color.interior(color.black), color.exterior(color.white), size(size."7"))
GRAPH: end()
GRAPH: begin(origin(12%, 70%), scale(90%, 19%))
GUIDE: axis(dim(1), label("Time"))
GUIDE: axis(dim(2), label("Mean Service Time"))
ELEMENT: line(position(Time*Mean_Service_Time))
ELEMENT: point(position(Time*Mean_Service_Time), color.interior(color.black), color.exterior(color.white), size(size."7"))
GRAPH: end()
END GPL .
Brian
From: Jon Peck <[hidden email]>
Sent: Tuesday, February 16, 2021 3:14 PM To: Dates, Brian <[hidden email]> Cc: SPSS List <[hidden email]> Subject: Re: [SPSSX-L] Help with Getting Variable Labels in Paneled Line Graph of Multiple Variables Declaring Time to be categorical in the GPL does the trick.
On Tue, Feb 16, 2021 at 9:02 AM Dates, Brian <[hidden email]> wrote:
|
Administrator
|
Hear, hear! Thanks for doing that, Brian. Perchance some future searcher of
these archives will be very grateful to you. bdates wrote > I think at some point, we all agreed that returning to share the > corrected/working outcome of our questions should be standard protocol. > First, thanks Mario and Jon for your speedy and effective input. I also > want to thank Andy Wheeler for his post on 'paneled' GPL for separate > variables with different scales, from which this is an expansion. Here's > the resulting syntax with the changes highlighted and underlined. > > --- snip --- ----- -- Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== 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
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Free forum by Nabble | Edit this page |