Dear List,
Thank you in advance for your time, hopefully someone can assist. I am attempting to modify a legend for a line graph in spss and am having difficulty with what i presumed to be a simple task... :) Markers were added to the lines for clarification. However the legend repeats the information (see below). When i attempt to modify the legend to include just males and females by color of line, all of the legend is deleted. After numerous attempts to edit the legend, the only option seems to be show/ hide legend. Perhaps this is a spss stylistic aspect. Hopefully someone can assist with this or recommend another package for graphing data, thank you for your time. __ Males __ Females <> Males <> Females ===================== 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 |
I assume this isn't really helping, but I nearly always export the
(aggregated) data to Excel because it is far easier to get what you want. On Thu, Apr 28, 2011 at 21:44, Leah Quinlivan <[hidden email]> wrote: > Dear List, > > Thank you in advance for your time, hopefully someone can assist. I am > attempting to modify a legend for a line graph in spss and am having > difficulty with what i presumed to be a simple task... :) > > > Markers were added to the lines for clarification. However the legend > repeats the information (see below). When i attempt to modify the legend to > include just males and females by color of line, all of the legend is > deleted. After numerous attempts to edit the legend, the only option seems > to be show/ hide legend. Perhaps this is a spss stylistic aspect. � Hopefully > someone can assist with this or recommend another package for graphing data, > thank you for your time. > > __ Males > > __ Females > > > <> Males > <> Females > > ===================== > 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 > -- ___________________________________________________________________ Maurice Vergeer Department of communication, Radboud University� (www.ru.nl) PO Box 9104, NL-6500 HE Nijmegen, The Netherlands Visiting Professor Yeungnam University, Gyeongsan, South Korea Recent publications: -Vergeer, M., Hermans, L., & Sams, S. (forthcoming). Online social networks and micro-blogging in political campaigning: The exploration of a new campaign tool and a new campaign style. Party Politics. -Pleijter, A., Hermans, L. & Vergeer, M. (forthcoming). Journalists and journalism in the Netherlands. In D. Weaver & L. Willnat, The Global Journalist in the 21st Century. London: Routledge. -Eisinga, R., Franses, Ph.H., & Vergeer, M. (2010). Weather conditions and daily television use in the Netherlands, 1996–2005. International Journal of Meteorology. Webspace www.mauricevergeer.nl http://blog.mauricevergeer.nl/ www.journalisteninhetdigitaletijdperk.nl maurice.vergeer (skype) ___________________________________________________________________ ===================== 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 Leah Quinlivan
First, here is the code for a line chart
as pasted from the Chart Builder. It just includes the lines. It
plots mean salary against job category with lines for males and females
using the employee data.sav data file.
GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat MEAN(salary)[name="MEAN_salary"] gender MISSING=LISTWISE REPORTMISSING=NO /GRAPHSPEC SOURCE=INLINE. BEGIN GPL SOURCE: s=userSource(id("graphdataset")) DATA: jobcat=col(source(s), name("jobcat"), unit.category()) DATA: MEAN_salary=col(source(s), name("MEAN_salary")) DATA: gender=col(source(s), name("gender"), unit.category()) GUIDE: axis(dim(1), label("Employment Category")) GUIDE: axis(dim(2), label("Mean Current Salary")) GUIDE: legend(aesthetic(aesthetic.color.interior), label("Gender")) SCALE: cat(dim(1), include("1", "2", "3")) SCALE: linear(dim(2), include(0)) SCALE: cat(aesthetic(aesthetic.color.interior), include("f", "m")) ELEMENT: line(position(jobcat*MEAN_salary), color.interior(gender), missing.wings()) END GPL. Now add one line to this at the end to get the points ELEMENT: point(position(jobcat*MEAN_salary), color.interior(gender)) There will be only one legend. HTH, Jon Peck Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: Leah Quinlivan <[hidden email]> To: [hidden email] Date: 04/28/2011 06:46 AM Subject: [SPSSX-L] Line Graph Legend Sent by: "SPSSX(r) Discussion" <[hidden email]> Dear List, Thank you in advance for your time, hopefully someone can assist. I am attempting to modify a legend for a line graph in spss and am having difficulty with what i presumed to be a simple task... :) Markers were added to the lines for clarification. However the legend repeats the information (see below). When i attempt to modify the legend to include just males and females by color of line, all of the legend is deleted. After numerous attempts to edit the legend, the only option seems to be show/ hide legend. Perhaps this is a spss stylistic aspect. Hopefully someone can assist with this or recommend another package for graphing data, thank you for your time. __ Males __ Females <> Males <> Females ===================== 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 |
Thank you for your responses, very much appreciated. Thank you, i adapted the syntax as suggested (see below). However, the legend now is like this:
------- males [in blue] ------- females [in red]
------- gender [beige] when i delete the gender from the legend, the markers disappear. Also, when modifying the style of the markers, i cant seem to adjust the markers separately for males to say blue, and females to red. i have tried in black and white and looks better as an alternative. however, still cant seem to have the legend contain
----- males ----- females Hope this makes sense. in regards excel, im not very fond of the quality of the graphs for publication purposes, kind thank you though.
* Chart Builder. GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=age_2 MEAN(males_2) MEAN(females_2) MISSING=LISTWISE REPORTMISSING=NO
TRANSFORM=VARSTOCASES(SUMMARY="#SUMMARY" INDEX="#INDEX") /GRAPHSPEC SOURCE=INLINE. BEGIN GPL SOURCE: s=userSource(id("graphdataset")) DATA: age_2=col(source(s), name("age_2"), unit.category())
DATA: SUMMARY=col(source(s), name("#SUMMARY")) DATA: INDEX=col(source(s), name("#INDEX"), unit.category()) GUIDE: axis(dim(1), label("age_2")) GUIDE: axis(dim(2), label("Mean"))
GUIDE: legend(aesthetic(aesthetic.color.interior), label("gender")) SCALE: linear(dim(2), include(0)) SCALE: cat(aesthetic(aesthetic.color.interior), include("0", "1"))
ELEMENT: line(position(age_2*SUMMARY), color.interior(INDEX), missing.wings()) ELEMENT: point(position(age_2*SUMMARY), color.interior("gender")) END GPL. On 28 April 2011 14:31, Jon K Peck <[hidden email]> wrote: First, here is the code for a line chart as pasted from the Chart Builder. It just includes the lines. It plots mean salary against job category with lines for males and females using the employee data.sav data file. -- Leah Quinlivan BA MS.c., Ad Astra PhD Scholar Department of Psychiatry and Mental Health Research St. Vincents University Hospital Elm Park Dublin 4 Ireland Phone: +353 1 2773354 Mobile: +353 87 9674719 |
Specify INDEX as the argument in the color.interior function on the point ELEMENT rather than “gender”. From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of leah quinlivan Thank you for your responses, very much appreciated. Thank you, i adapted the syntax as suggested (see below). However, the legend now is like this: ------- males [in blue] ------- females [in red] ------- gender [beige] when i delete the gender from the legend, the markers disappear. Also, when modifying the style of the markers, i cant seem to adjust the markers separately for males to say blue, and females to red. i have tried in black and white and looks better as an alternative. however, still cant seem to have the legend contain ----- males ----- females Hope this makes sense. in regards excel, im not very fond of the quality of the graphs for publication purposes, kind thank you though. * Chart Builder. GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=age_2 MEAN(males_2) MEAN(females_2) MISSING=LISTWISE REPORTMISSING=NO TRANSFORM=VARSTOCASES(SUMMARY="#SUMMARY" INDEX="#INDEX") /GRAPHSPEC SOURCE=INLINE. BEGIN GPL SOURCE: s=userSource(id("graphdataset")) DATA: age_2=col(source(s), name("age_2"), unit.category()) DATA: SUMMARY=col(source(s), name("#SUMMARY")) DATA: INDEX=col(source(s), name("#INDEX"), unit.category()) GUIDE: axis(dim(1), label("age_2")) GUIDE: axis(dim(2), label("Mean")) GUIDE: legend(aesthetic(aesthetic.color.interior), label("gender")) SCALE: linear(dim(2), include(0)) SCALE: cat(aesthetic(aesthetic.color.interior), include("0", "1")) ELEMENT: line(position(age_2*SUMMARY), color.interior(INDEX), missing.wings()) ELEMENT: point(position(age_2*SUMMARY), color.interior("gender")) END GPL. On 28 April 2011 14:31, Jon K Peck <[hidden email]> wrote: First, here is the code for a line chart as pasted from the Chart Builder. It just includes the lines. It plots mean salary against job category with lines for males and females using the employee data.sav data file.
|
brilliant, thanks so much for your assistance, very much appreciated, is now perfect. very happy and have learned from this, thanks.
On 28 April 2011 19:24, ViAnn Beadle <[hidden email]> wrote:
-- Leah Quinlivan BA MS.c., Ad Astra PhD Scholar Department of Psychiatry and Mental Health Research St. Vincents University Hospital Elm Park Dublin 4 Ireland Phone: +353 1 2773354 Mobile: +353 87 9674719 |
Free forum by Nabble | Edit this page |