When seeking help on this list, more info is much better than less. In this
case I need to know how you got to where you are so that I can suggest an
amended route ;-). There are at least 5 ways to produce a labeled
scatterplot and I don't want to provide them all. So here's the amended
route:
1. add your labeling variable to the list of variables in the GRAPHDATSET
subcommand.
2. define a DATA statement for the variable in the GPL and use the
category.data() function.
3. specify label(variablename) in the ELEMENT statement.
Here's an example using the world95 sample data where country is the
labeling variable. You'll see how messy this can be with more than a modest
set of points if you run the example.
Work you do in the chart editor can be saved as a chart template and be
applied to subsequent charts via syntax. Getting the right set of checkboxes
(do not check all!) is tricky and works best when the charts are similar in
structure.
DATASET ACTIVATE DataSet1.
* Chart Builder.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=urban literacy country
MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: urban=col(source(s), name("urban"))
DATA: literacy=col(source(s), name("literacy"))
DATA: country=col(source(s), name("country"), unit.category())
GUIDE: axis(dim(1), label("People living in cities (%)"))
GUIDE: axis(dim(2), label("People who read (%)"))
ELEMENT: point(position(urban*literacy), label(country))
END GPL.
-----Original Message-----
From: Mark Webb [mailto:
targetlinkmark@...]
Sent: Saturday, November 14, 2009 1:27 AM
To: ViAnn Beadle
Subject: Re: Text data labels in Scatter charts
Hi ViAnn
My syntax is listed below but I don't think it will assist.
I'm making the scatter graph using the menu.
Once the graph is in the output window I right click it and there is an
option to add data labels - it automatically shows the case number - I
want to be able to choose a variable that makes sense - in this case
hospital names.
When you amend an output graph it doesn't seem to save it to the journal.
Will I have to make in the menu then paste the syntax and then add an
instruction to add data labels using a variable ?
Thanks
Mark
GET
FILE='C:\Documents and Settings\Mark\Favorites\My Documents\My Documents\'+
'AACorrelations\2009DataB.sav'.
DATASET NAME DataSet1 WINDOW=FRONT.
* Chart Builder.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=PSI Staff MISSING=LISTWISE
REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: PSI=col(source(s), name("PSI"))
DATA: Staff=col(source(s), name("Staff"))
GUIDE: axis(dim(1), label("PSI"))
GUIDE: axis(dim(2), label("Staff"))
ELEMENT: point(position(PSI*Staff))
END GPL.
SET Small 0.000100 OLang English .
Mark Webb
+27 21 786 4379
+27 72 199 1000
Skype - webbmark
targetlinkmark@...
ViAnn Beadle wrote:
> Show us your syntax
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:
SPSSX-L@...] On Behalf Of
> Mark Webb
> Sent: Friday, November 13, 2009 12:47 AM
> To:
SPSSX-L@...
> Subject: Text data labels in Scatter charts
>
> I want to labels points on a scatter charts with hospital names.
> I can only get case numbers to be shown.
> How do I stipulate a variable [hospital] to be used rather than case
> numbers ?
> Regards
>
> --
> Mark Webb
>
> +27 21 786 4379
> +27 72 199 1000
> Skype - webbmark
>
targetlinkmark@...
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
>
LISTSERV@... (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
>
LISTSERV@... (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
LISTSERV@... (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