GPL Syntax

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

GPL Syntax

Atai Winkler

Hi

 

I wonder if someone could help me on two GPL questions I have.

 

1.            Page 413 of the GPL Reference Guide lists the possible marker shapes. I use diamonds as markers (second from left on top row of Properties/Marker/Type selection). However, I cannot see diamonds listed as a shape on page 413. So, how I specify diamonds in the syntax below (where squares are specified)?

2.            Is it possible to specify the weight of the axes using GPL (I cannot find it in the manual)? This is done manually under Properties/Lines/Weight.

 

ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

 color.interior(failure_mode_1), color.exterior(failure_mode_1),

shape(shape.square),

size(size."5.px"))

 

Thank you.

 

Atai

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

 

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: GPL Syntax

Andy W
Both of those you need to putz around with the chart template. For the
diamond, unfortunately it is not one of the constants,
https://andrewpwheeler.wordpress.com/2016/04/26/shapes-colors-and-pattern-constants-in-spss-charts/.
What you need to do is check out the cycle tag that specifies the shapes,
and then change the angle, of the square, so it should be something like:

<style size="5pt" symbol="square" glyph-angle="45"/>

(Angle and aspect should be mappable aesthetics in the grammer!)

For the axes I am not sure of the xml needed to edit those. Here are my
example overall chart templates:

 - For older versions,
https://dl.dropbox.com/s/drnd9nddedd8w6m/chart_style%28AndyW2-presentation%29.sgt?dl=0
 - V25 did not like it as much, so made a new one,
https://dl.dropbox.com/s/9dbyuk35ssxd3km/V25_ChartStyle.sgt?dl=0



-----
Andy W
[hidden email]
http://andrewpwheeler.wordpress.com/
--
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
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: GPL Syntax

Jon Peck
In reply to this post by Atai Winkler
A diamond marker is a rotated square shape.  To get it, include a small template in the GRAPHSPEC subcommand like this.
GGRAPH 
/GRAPHDATASET NAME="graphdataset" VARIABLES=jobtime salary jobcat MISSING=LISTWISE 
REPORTMISSING=NO 
/GRAPHSPEC SOURCE=INLINE
 inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>".

On Mon, Feb 11, 2019 at 9:41 AM Atai Winkler <[hidden email]> wrote:

Hi

 

I wonder if someone could help me on two GPL questions I have.

 

1.            Page 413 of the GPL Reference Guide lists the possible marker shapes. I use diamonds as markers (second from left on top row of Properties/Marker/Type selection). However, I cannot see diamonds listed as a shape on page 413. So, how I specify diamonds in the syntax below (where squares are specified)?

2.            Is it possible to specify the weight of the axes using GPL (I cannot find it in the manual)? This is done manually under Properties/Lines/Weight.

 

ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

 color.interior(failure_mode_1), color.exterior(failure_mode_1),

shape(shape.square),

size(size."5.px"))

 

Thank you.

 

Atai

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

 

===================== 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


--
Jon K Peck
[hidden email]

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: GPL Syntax

Jon Peck
You can control the axis line styles with another small template.  Create a chart, and edit it in the Chart Editor.  Select the axis line and set the width as desired.  Use File > Save Chart Template and check just the box Line styles under
Styles > Non-data element styles>Line styles.

Then reference that template in GGRAPH 
   TEMPLATE=["c:\spss25\looks\FatAxisLines.sgt"]

You could probably include the rotated markers in that template, too.

On Mon, Feb 11, 2019 at 10:39 AM Jon Peck <[hidden email]> wrote:
A diamond marker is a rotated square shape.  To get it, include a small template in the GRAPHSPEC subcommand like this.
GGRAPH 
/GRAPHDATASET NAME="graphdataset" VARIABLES=jobtime salary jobcat MISSING=LISTWISE 
REPORTMISSING=NO 
/GRAPHSPEC SOURCE=INLINE
 inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>".

On Mon, Feb 11, 2019 at 9:41 AM Atai Winkler <[hidden email]> wrote:

Hi

 

I wonder if someone could help me on two GPL questions I have.

 

1.            Page 413 of the GPL Reference Guide lists the possible marker shapes. I use diamonds as markers (second from left on top row of Properties/Marker/Type selection). However, I cannot see diamonds listed as a shape on page 413. So, how I specify diamonds in the syntax below (where squares are specified)?

2.            Is it possible to specify the weight of the axes using GPL (I cannot find it in the manual)? This is done manually under Properties/Lines/Weight.

 

ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

 color.interior(failure_mode_1), color.exterior(failure_mode_1),

shape(shape.square),

size(size."5.px"))

 

Thank you.

 

Atai

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

 

===================== 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


--
Jon K Peck
[hidden email]



--
Jon K Peck
[hidden email]

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: GPL Syntax

Atai Winkler

Hi Jon

 

Thank you for your replies. I have made the changes you suggested and the program runs. The new syntax is:

 

GGRAPH

  /GRAPHDATASET NAME="graphdataset" VARIABLES=failure_period cum_pcent_falling_failure_mode_14_15_16 failure_mode_1

   MISSING=LISTWISE REPORTMISSING=NO

  /GRAPHSPEC SOURCE=INLINE

  inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>"

  TEMPLATE='axes_template\axes template 10.sgt'

  /FITLINE TOTAL=NO SUBGROUP=NO.

BEGIN GPL

  SOURCE: s=userSource(id("graphdataset"))

  DATA: failure_period=col(source(s), name("failure_period"))

  DATA: cum_pcent_falling_failure_mode_14_15_16=col(source(s),

    name("cum_pcent_falling_failure_mode_14_15_16"))

  DATA: failure_mode_1=col(source(s), name("failure_mode_1"), unit.category())

  GUIDE: axis(dim(1), label("Time to failure (years)"))

  GUIDE: axis(dim(2), label("Cum. failure % to 2nd failure (each failure mode)"))

  GUIDE: legend(aesthetic(aesthetic.color.interior), label("Failure mode"))

  GUIDE: text.title(label("Grouped Scatter of cum_pcent_falling_failure_mode_14_15_16 by ",

    "failure_period by failure_mode_1"))

  SCALE: cat(aesthetic(aesthetic.color.interior), include("14", "15", "16"))

  ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

    color.interior(failure_mode_1), color.exterior(failure_mode_1),

    shape(shape.square),

    size(size."5.px"))

END GPL.

 

 

1.            The indicator variable, failure_mode_1, has three values and so the graph has three sets of points, each set in a different colour. I want to change the colour of one set of points from a sickly green to something more appealing. When I do this by double-clicking the diamond with this colour in the top-right, change the colour to the new colour and then select Apply, I get three new values of failure_mode_1 listed below the existing three. The new values are all dark grey circles and have the same descriptive text as the three original values.

                Why does this occur and how can I prevent it from happening?

 

2.            In one of your replies you showed me how to change the width of the axes. Similarly, how can I change the font size of the numbers on the axes? The default is 8 but I want to use 10.

 

3.            More generally, do you know of a good reference for this more advanced information on GPL? I cannot find this information in the GPL reference manual.

 

 

Thank you.

 

 

Kind regards

 

Atai

 

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

Mob: +44 (0)7817 263016

Tel: +44 (0)1923 852701

[hidden email]

Skype: ataiwinkler

 

www.pamanalytics.com

 

 

 

 

 

 

 

From: Jon Peck <[hidden email]>
Sent: 11 February 2019 18:41
To: Atai Winkler <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] GPL Syntax

 

You can control the axis line styles with another small template.  Create a chart, and edit it in the Chart Editor.  Select the axis line and set the width as desired.  Use File > Save Chart Template and check just the box Line styles under

Styles > Non-data element styles>Line styles.

 

Then reference that template in GGRAPH 

   TEMPLATE=["c:\spss25\looks\FatAxisLines.sgt"]

 

You could probably include the rotated markers in that template, too.

 

On Mon, Feb 11, 2019 at 10:39 AM Jon Peck <[hidden email]> wrote:

A diamond marker is a rotated square shape.  To get it, include a small template in the GRAPHSPEC subcommand like this.

GGRAPH 

/GRAPHDATASET NAME="graphdataset" VARIABLES=jobtime salary jobcat MISSING=LISTWISE 

REPORTMISSING=NO 

/GRAPHSPEC SOURCE=INLINE

 inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>".

 

On Mon, Feb 11, 2019 at 9:41 AM Atai Winkler <[hidden email]> wrote:

Hi

 

I wonder if someone could help me on two GPL questions I have.

 

1.            Page 413 of the GPL Reference Guide lists the possible marker shapes. I use diamonds as markers (second from left on top row of Properties/Marker/Type selection). However, I cannot see diamonds listed as a shape on page 413. So, how I specify diamonds in the syntax below (where squares are specified)?

2.            Is it possible to specify the weight of the axes using GPL (I cannot find it in the manual)? This is done manually under Properties/Lines/Weight.

 

ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

 color.interior(failure_mode_1), color.exterior(failure_mode_1),

shape(shape.square),

size(size."5.px"))

 

Thank you.

 

Atai

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

 

===================== 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


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: GPL Syntax

Jon Peck
I don't know why you are getting the legend points duplicated, but you can set the color cycle you want at chart creation time by specifying the COLORCYCLE subcommand of GGRAPH with RGB values.  Here is an example.
 /COLORCYCLE COLOR1(155,0,0), COLOR2(237,75,75), COLOR3(41,134,38), COLOR4(243,103,42), 
    COLOR5(227,215,16), COLOR6(0,180,160), COLOR7(255,196,226), COLOR8(171,73,243), COLOR9(95,195,56), 
    COLOR10(63,90,168), COLOR11(254,130,180), COLOR12(208,202,140), COLOR13(204,134,63), 
    COLOR14(119,55,143), COLOR15(236,230,208), COLOR16(69,70,71), COLOR17(92,202,136), 
    COLOR18(208,83,52), COLOR19(204,127,228), COLOR20(225,188,29), COLOR21(237,75,75), 
    COLOR22(28,205,205), COLOR23(92,113,72), COLOR24(225,139,14), COLOR25(9,38,114), 
    COLOR26(90,100,94), COLOR27(155,0,0), COLOR28(207,172,227), COLOR29(150,145,145), 
    COLOR30(63,235,124)

Obviously figuring out the RGB values would not be fun.  In version 25, you can use the COLORCYLE syntax, but the Chart Builder will also let you set the color cycle for a chart  by clicking on colors in a palette.  If you want to change this cycle permanently or your version is older than 25, go to Edit > Options > Charts and click on Colors.  You can then set the cycle you want via the same palette that is now available in the Chart Builder.

You can change the point size of the tick labels interactively by clicking and using the Text Style panel.  You can save this setting in a template the same way as for the axis line width (and in the same template).  The setting would be selected as Axis > Labels > Major tick labels Format.

As for the GPL Reference Manual, I agree that it leaves a lot to be desired.  The general Help table of contents shows a number of graphing topics that might be useful, and the Tutorial section has some additional information.  Andrew Wheeler (https://andrewpwheeler.wordpress.com/about/) has a lot of posts about GPL and graphics in Statistics.


On Tue, Feb 12, 2019 at 3:57 AM Atai Winkler <[hidden email]> wrote:

Hi Jon

 

Thank you for your replies. I have made the changes you suggested and the program runs. The new syntax is:

 

GGRAPH

  /GRAPHDATASET NAME="graphdataset" VARIABLES=failure_period cum_pcent_falling_failure_mode_14_15_16 failure_mode_1

   MISSING=LISTWISE REPORTMISSING=NO

  /GRAPHSPEC SOURCE=INLINE

  inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>"

  TEMPLATE='axes_template\axes template 10.sgt'

  /FITLINE TOTAL=NO SUBGROUP=NO.

BEGIN GPL

  SOURCE: s=userSource(id("graphdataset"))

  DATA: failure_period=col(source(s), name("failure_period"))

  DATA: cum_pcent_falling_failure_mode_14_15_16=col(source(s),

    name("cum_pcent_falling_failure_mode_14_15_16"))

  DATA: failure_mode_1=col(source(s), name("failure_mode_1"), unit.category())

  GUIDE: axis(dim(1), label("Time to failure (years)"))

  GUIDE: axis(dim(2), label("Cum. failure % to 2nd failure (each failure mode)"))

  GUIDE: legend(aesthetic(aesthetic.color.interior), label("Failure mode"))

  GUIDE: text.title(label("Grouped Scatter of cum_pcent_falling_failure_mode_14_15_16 by ",

    "failure_period by failure_mode_1"))

  SCALE: cat(aesthetic(aesthetic.color.interior), include("14", "15", "16"))

  ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

    color.interior(failure_mode_1), color.exterior(failure_mode_1),

    shape(shape.square),

    size(size."5.px"))

END GPL.

 

 

1.            The indicator variable, failure_mode_1, has three values and so the graph has three sets of points, each set in a different colour. I want to change the colour of one set of points from a sickly green to something more appealing. When I do this by double-clicking the diamond with this colour in the top-right, change the colour to the new colour and then select Apply, I get three new values of failure_mode_1 listed below the existing three. The new values are all dark grey circles and have the same descriptive text as the three original values.

                Why does this occur and how can I prevent it from happening?

 

2.            In one of your replies you showed me how to change the width of the axes. Similarly, how can I change the font size of the numbers on the axes? The default is 8 but I want to use 10.

 

3.            More generally, do you know of a good reference for this more advanced information on GPL? I cannot find this information in the GPL reference manual.

 

 

Thank you.

 

 

Kind regards

 

Atai

 

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

Mob: +44 (0)7817 263016

Tel: +44 (0)1923 852701

[hidden email]

Skype: ataiwinkler

 

www.pamanalytics.com

 

 

 

 

 

 

 

From: Jon Peck <[hidden email]>
Sent: 11 February 2019 18:41
To: Atai Winkler <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] GPL Syntax

 

You can control the axis line styles with another small template.  Create a chart, and edit it in the Chart Editor.  Select the axis line and set the width as desired.  Use File > Save Chart Template and check just the box Line styles under

Styles > Non-data element styles>Line styles.

 

Then reference that template in GGRAPH 

   TEMPLATE=["c:\spss25\looks\FatAxisLines.sgt"]

 

You could probably include the rotated markers in that template, too.

 

On Mon, Feb 11, 2019 at 10:39 AM Jon Peck <[hidden email]> wrote:

A diamond marker is a rotated square shape.  To get it, include a small template in the GRAPHSPEC subcommand like this.

GGRAPH 

/GRAPHDATASET NAME="graphdataset" VARIABLES=jobtime salary jobcat MISSING=LISTWISE 

REPORTMISSING=NO 

/GRAPHSPEC SOURCE=INLINE

 inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>".

 

On Mon, Feb 11, 2019 at 9:41 AM Atai Winkler <[hidden email]> wrote:

Hi

 

I wonder if someone could help me on two GPL questions I have.

 

1.            Page 413 of the GPL Reference Guide lists the possible marker shapes. I use diamonds as markers (second from left on top row of Properties/Marker/Type selection). However, I cannot see diamonds listed as a shape on page 413. So, how I specify diamonds in the syntax below (where squares are specified)?

2.            Is it possible to specify the weight of the axes using GPL (I cannot find it in the manual)? This is done manually under Properties/Lines/Weight.

 

ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

 color.interior(failure_mode_1), color.exterior(failure_mode_1),

shape(shape.square),

size(size."5.px"))

 

Thank you.

 

Atai

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

 

===================== 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


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]



--
Jon K Peck
[hidden email]

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: GPL Syntax

Atai Winkler

Hi Jon

 

Thank you for the reply. I have the RGB codes of the three colours I want and have specified them in the /COLOCYCLE command as below.

 

GRAPH

  /GRAPHDATASET NAME="graphdataset" VARIABLES=failure_period  cum_pcent_falling_failure_mode_14_15_16  failure_mode_1

   MISSING=LISTWISE REPORTMISSING=NO

  /GRAPHSPEC SOURCE=INLINE

  /COLORCYCLE COLOR1(85, 150, 230), COLOR2(215, 0, 51), COLOR3(63, 235, 124)

  inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>"

  TEMPLATE='axes_template\axes template 10.sgt'

  /FRAME OUTER=YES

  /FITLINE TOTAL=NO SUBGROUP=NO.

BEGIN GPL

  SOURCE: s=userSource(id("graphdataset"))

  DATA: failure_period=col(source(s), name("failure_period"))

  DATA: cum_pcent_falling_failure_mode_14_15_16=col(source(s),

        name("cum_pcent_falling_failure_mode_14_15_16"))

  DATA: failure_mode_1=col(source(s), name("failure_mode_1"), unit.category())

  GUIDE: axis(dim(1), label("Time to failure (years)"), delta(1))

  GUIDE: axis(dim(2), label("Cum. failure % to 2nd failure (each failure mode)"))

  GUIDE: legend(aesthetic(aesthetic.color.interior), label("Failure mode"))

  GUIDE: text.title(label("Grouped Scatter of cum_pcent_falling_failure_mode_14_15_16 by ",

                          "failure_period by failure_mode_1"))

  SCALE: linear(dim(1), min(1), max(10))

    SCALE: cat(aesthetic(aesthetic.color.interior), include("14", "15", "16"), map(("14", COLOR1), ("15", COLOR2), ("16", COLOR3)))

    SCALE: cat(aesthetic(aesthetic.color.exterior), include("14", "15", "16"), map(("14", color.white), ("15", color.white), ("16", color.white)))

  ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16), color.interior(failure_mode_1), size(size."1"))

  ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

    color.interior(failure_mode_1), color.exterior(color.white),

    shape(shape.square),

    size(size."5.px"))

END GPL.

 

 

When I run the syntax, I get the following error.

 

910 GGraph The COLORCYCLE subcommand contains an unrecognized setting inlinetemplate.

919 BEGIN GPL This command is only valid immediately following the GGRAPH procedure.

 

I moved the /COLORCYCLE line to a number of different places but I always get an error, so where should it go?

 

Thank you

 

Atai

 

 

 

 

From: Jon Peck <[hidden email]>
Sent: 12 February 2019 18:23
To: Atai Winkler <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] GPL Syntax

 

I don't know why you are getting the legend points duplicated, but you can set the color cycle you want at chart creation time by specifying the COLORCYCLE subcommand of GGRAPH with RGB values.  Here is an example.

 /COLORCYCLE COLOR1(155,0,0), COLOR2(237,75,75), COLOR3(41,134,38), COLOR4(243,103,42), 

    COLOR5(227,215,16), COLOR6(0,180,160), COLOR7(255,196,226), COLOR8(171,73,243), COLOR9(95,195,56), 

    COLOR10(63,90,168), COLOR11(254,130,180), COLOR12(208,202,140), COLOR13(204,134,63), 

    COLOR14(119,55,143), COLOR15(236,230,208), COLOR16(69,70,71), COLOR17(92,202,136), 

    COLOR18(208,83,52), COLOR19(204,127,228), COLOR20(225,188,29), COLOR21(237,75,75), 

    COLOR22(28,205,205), COLOR23(92,113,72), COLOR24(225,139,14), COLOR25(9,38,114), 

    COLOR26(90,100,94), COLOR27(155,0,0), COLOR28(207,172,227), COLOR29(150,145,145), 

    COLOR30(63,235,124)

 

Obviously figuring out the RGB values would not be fun.  In version 25, you can use the COLORCYLE syntax, but the Chart Builder will also let you set the color cycle for a chart  by clicking on colors in a palette.  If you want to change this cycle permanently or your version is older than 25, go to Edit > Options > Charts and click on Colors.  You can then set the cycle you want via the same palette that is now available in the Chart Builder.

 

You can change the point size of the tick labels interactively by clicking and using the Text Style panel.  You can save this setting in a template the same way as for the axis line width (and in the same template).  The setting would be selected as Axis > Labels > Major tick labels Format.

 

As for the GPL Reference Manual, I agree that it leaves a lot to be desired.  The general Help table of contents shows a number of graphing topics that might be useful, and the Tutorial section has some additional information.  Andrew Wheeler (https://andrewpwheeler.wordpress.com/about/) has a lot of posts about GPL and graphics in Statistics.

 

 

On Tue, Feb 12, 2019 at 3:57 AM Atai Winkler <[hidden email]> wrote:

Hi Jon

 

Thank you for your replies. I have made the changes you suggested and the program runs. The new syntax is:

 

GGRAPH

  /GRAPHDATASET NAME="graphdataset" VARIABLES=failure_period cum_pcent_falling_failure_mode_14_15_16 failure_mode_1

   MISSING=LISTWISE REPORTMISSING=NO

  /GRAPHSPEC SOURCE=INLINE

  inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>"

  TEMPLATE='axes_template\axes template 10.sgt'

  /FITLINE TOTAL=NO SUBGROUP=NO.

BEGIN GPL

  SOURCE: s=userSource(id("graphdataset"))

  DATA: failure_period=col(source(s), name("failure_period"))

  DATA: cum_pcent_falling_failure_mode_14_15_16=col(source(s),

    name("cum_pcent_falling_failure_mode_14_15_16"))

  DATA: failure_mode_1=col(source(s), name("failure_mode_1"), unit.category())

  GUIDE: axis(dim(1), label("Time to failure (years)"))

  GUIDE: axis(dim(2), label("Cum. failure % to 2nd failure (each failure mode)"))

  GUIDE: legend(aesthetic(aesthetic.color.interior), label("Failure mode"))

  GUIDE: text.title(label("Grouped Scatter of cum_pcent_falling_failure_mode_14_15_16 by ",

    "failure_period by failure_mode_1"))

  SCALE: cat(aesthetic(aesthetic.color.interior), include("14", "15", "16"))

  ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

    color.interior(failure_mode_1), color.exterior(failure_mode_1),

    shape(shape.square),

    size(size."5.px"))

END GPL.

 

 

1.            The indicator variable, failure_mode_1, has three values and so the graph has three sets of points, each set in a different colour. I want to change the colour of one set of points from a sickly green to something more appealing. When I do this by double-clicking the diamond with this colour in the top-right, change the colour to the new colour and then select Apply, I get three new values of failure_mode_1 listed below the existing three. The new values are all dark grey circles and have the same descriptive text as the three original values.

                Why does this occur and how can I prevent it from happening?

 

2.            In one of your replies you showed me how to change the width of the axes. Similarly, how can I change the font size of the numbers on the axes? The default is 8 but I want to use 10.

 

3.            More generally, do you know of a good reference for this more advanced information on GPL? I cannot find this information in the GPL reference manual.

 

 

Thank you.

 

 

Kind regards

 

Atai

 

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

Mob: +44 (0)7817 263016

Tel: +44 (0)1923 852701

[hidden email]

Skype: ataiwinkler

 

www.pamanalytics.com

 

 

 

 

 

 

 

From: Jon Peck <[hidden email]>
Sent: 11 February 2019 18:41
To: Atai Winkler <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] GPL Syntax

 

You can control the axis line styles with another small template.  Create a chart, and edit it in the Chart Editor.  Select the axis line and set the width as desired.  Use File > Save Chart Template and check just the box Line styles under

Styles > Non-data element styles>Line styles.

 

Then reference that template in GGRAPH 

   TEMPLATE=["c:\spss25\looks\FatAxisLines.sgt"]

 

You could probably include the rotated markers in that template, too.

 

On Mon, Feb 11, 2019 at 10:39 AM Jon Peck <[hidden email]> wrote:

A diamond marker is a rotated square shape.  To get it, include a small template in the GRAPHSPEC subcommand like this.

GGRAPH 

/GRAPHDATASET NAME="graphdataset" VARIABLES=jobtime salary jobcat MISSING=LISTWISE 

REPORTMISSING=NO 

/GRAPHSPEC SOURCE=INLINE

 inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>".

 

On Mon, Feb 11, 2019 at 9:41 AM Atai Winkler <[hidden email]> wrote:

Hi

 

I wonder if someone could help me on two GPL questions I have.

 

1.            Page 413 of the GPL Reference Guide lists the possible marker shapes. I use diamonds as markers (second from left on top row of Properties/Marker/Type selection). However, I cannot see diamonds listed as a shape on page 413. So, how I specify diamonds in the syntax below (where squares are specified)?

2.            Is it possible to specify the weight of the axes using GPL (I cannot find it in the manual)? This is done manually under Properties/Lines/Weight.

 

ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

 color.interior(failure_mode_1), color.exterior(failure_mode_1),

shape(shape.square),

size(size."5.px"))

 

Thank you.

 

Atai

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

 

===================== 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


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: GPL Syntax

Jon Peck
The TEMPLATE keyword goes on the GRAPHSPEC subcommand.  You have it on the COLORCYCLE subcommand.

On Tue, Feb 12, 2019 at 11:42 AM Atai Winkler <[hidden email]> wrote:

Hi Jon

 

Thank you for the reply. I have the RGB codes of the three colours I want and have specified them in the /COLOCYCLE command as below.

 

GRAPH

  /GRAPHDATASET NAME="graphdataset" VARIABLES=failure_period  cum_pcent_falling_failure_mode_14_15_16  failure_mode_1

   MISSING=LISTWISE REPORTMISSING=NO

  /GRAPHSPEC SOURCE=INLINE

  /COLORCYCLE COLOR1(85, 150, 230), COLOR2(215, 0, 51), COLOR3(63, 235, 124)

  inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>"

  TEMPLATE='axes_template\axes template 10.sgt'

  /FRAME OUTER=YES

  /FITLINE TOTAL=NO SUBGROUP=NO.

BEGIN GPL

  SOURCE: s=userSource(id("graphdataset"))

  DATA: failure_period=col(source(s), name("failure_period"))

  DATA: cum_pcent_falling_failure_mode_14_15_16=col(source(s),

        name("cum_pcent_falling_failure_mode_14_15_16"))

  DATA: failure_mode_1=col(source(s), name("failure_mode_1"), unit.category())

  GUIDE: axis(dim(1), label("Time to failure (years)"), delta(1))

  GUIDE: axis(dim(2), label("Cum. failure % to 2nd failure (each failure mode)"))

  GUIDE: legend(aesthetic(aesthetic.color.interior), label("Failure mode"))

  GUIDE: text.title(label("Grouped Scatter of cum_pcent_falling_failure_mode_14_15_16 by ",

                          "failure_period by failure_mode_1"))

  SCALE: linear(dim(1), min(1), max(10))

    SCALE: cat(aesthetic(aesthetic.color.interior), include("14", "15", "16"), map(("14", COLOR1), ("15", COLOR2), ("16", COLOR3)))

    SCALE: cat(aesthetic(aesthetic.color.exterior), include("14", "15", "16"), map(("14", color.white), ("15", color.white), ("16", color.white)))

  ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16), color.interior(failure_mode_1), size(size."1"))

  ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

    color.interior(failure_mode_1), color.exterior(color.white),

    shape(shape.square),

    size(size."5.px"))

END GPL.

 

 

When I run the syntax, I get the following error.

 

910 GGraph The COLORCYCLE subcommand contains an unrecognized setting inlinetemplate.

919 BEGIN GPL This command is only valid immediately following the GGRAPH procedure.

 

I moved the /COLORCYCLE line to a number of different places but I always get an error, so where should it go?

 

Thank you

 

Atai

 

 

 

 

From: Jon Peck <[hidden email]>
Sent: 12 February 2019 18:23
To: Atai Winkler <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] GPL Syntax

 

I don't know why you are getting the legend points duplicated, but you can set the color cycle you want at chart creation time by specifying the COLORCYCLE subcommand of GGRAPH with RGB values.  Here is an example.

 /COLORCYCLE COLOR1(155,0,0), COLOR2(237,75,75), COLOR3(41,134,38), COLOR4(243,103,42), 

    COLOR5(227,215,16), COLOR6(0,180,160), COLOR7(255,196,226), COLOR8(171,73,243), COLOR9(95,195,56), 

    COLOR10(63,90,168), COLOR11(254,130,180), COLOR12(208,202,140), COLOR13(204,134,63), 

    COLOR14(119,55,143), COLOR15(236,230,208), COLOR16(69,70,71), COLOR17(92,202,136), 

    COLOR18(208,83,52), COLOR19(204,127,228), COLOR20(225,188,29), COLOR21(237,75,75), 

    COLOR22(28,205,205), COLOR23(92,113,72), COLOR24(225,139,14), COLOR25(9,38,114), 

    COLOR26(90,100,94), COLOR27(155,0,0), COLOR28(207,172,227), COLOR29(150,145,145), 

    COLOR30(63,235,124)

 

Obviously figuring out the RGB values would not be fun.  In version 25, you can use the COLORCYLE syntax, but the Chart Builder will also let you set the color cycle for a chart  by clicking on colors in a palette.  If you want to change this cycle permanently or your version is older than 25, go to Edit > Options > Charts and click on Colors.  You can then set the cycle you want via the same palette that is now available in the Chart Builder.

 

You can change the point size of the tick labels interactively by clicking and using the Text Style panel.  You can save this setting in a template the same way as for the axis line width (and in the same template).  The setting would be selected as Axis > Labels > Major tick labels Format.

 

As for the GPL Reference Manual, I agree that it leaves a lot to be desired.  The general Help table of contents shows a number of graphing topics that might be useful, and the Tutorial section has some additional information.  Andrew Wheeler (https://andrewpwheeler.wordpress.com/about/) has a lot of posts about GPL and graphics in Statistics.

 

 

On Tue, Feb 12, 2019 at 3:57 AM Atai Winkler <[hidden email]> wrote:

Hi Jon

 

Thank you for your replies. I have made the changes you suggested and the program runs. The new syntax is:

 

GGRAPH

  /GRAPHDATASET NAME="graphdataset" VARIABLES=failure_period cum_pcent_falling_failure_mode_14_15_16 failure_mode_1

   MISSING=LISTWISE REPORTMISSING=NO

  /GRAPHSPEC SOURCE=INLINE

  inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>"

  TEMPLATE='axes_template\axes template 10.sgt'

  /FITLINE TOTAL=NO SUBGROUP=NO.

BEGIN GPL

  SOURCE: s=userSource(id("graphdataset"))

  DATA: failure_period=col(source(s), name("failure_period"))

  DATA: cum_pcent_falling_failure_mode_14_15_16=col(source(s),

    name("cum_pcent_falling_failure_mode_14_15_16"))

  DATA: failure_mode_1=col(source(s), name("failure_mode_1"), unit.category())

  GUIDE: axis(dim(1), label("Time to failure (years)"))

  GUIDE: axis(dim(2), label("Cum. failure % to 2nd failure (each failure mode)"))

  GUIDE: legend(aesthetic(aesthetic.color.interior), label("Failure mode"))

  GUIDE: text.title(label("Grouped Scatter of cum_pcent_falling_failure_mode_14_15_16 by ",

    "failure_period by failure_mode_1"))

  SCALE: cat(aesthetic(aesthetic.color.interior), include("14", "15", "16"))

  ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

    color.interior(failure_mode_1), color.exterior(failure_mode_1),

    shape(shape.square),

    size(size."5.px"))

END GPL.

 

 

1.            The indicator variable, failure_mode_1, has three values and so the graph has three sets of points, each set in a different colour. I want to change the colour of one set of points from a sickly green to something more appealing. When I do this by double-clicking the diamond with this colour in the top-right, change the colour to the new colour and then select Apply, I get three new values of failure_mode_1 listed below the existing three. The new values are all dark grey circles and have the same descriptive text as the three original values.

                Why does this occur and how can I prevent it from happening?

 

2.            In one of your replies you showed me how to change the width of the axes. Similarly, how can I change the font size of the numbers on the axes? The default is 8 but I want to use 10.

 

3.            More generally, do you know of a good reference for this more advanced information on GPL? I cannot find this information in the GPL reference manual.

 

 

Thank you.

 

 

Kind regards

 

Atai

 

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

Mob: +44 (0)7817 263016

Tel: +44 (0)1923 852701

[hidden email]

Skype: ataiwinkler

 

www.pamanalytics.com

 

 

 

 

 

 

 

From: Jon Peck <[hidden email]>
Sent: 11 February 2019 18:41
To: Atai Winkler <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] GPL Syntax

 

You can control the axis line styles with another small template.  Create a chart, and edit it in the Chart Editor.  Select the axis line and set the width as desired.  Use File > Save Chart Template and check just the box Line styles under

Styles > Non-data element styles>Line styles.

 

Then reference that template in GGRAPH 

   TEMPLATE=["c:\spss25\looks\FatAxisLines.sgt"]

 

You could probably include the rotated markers in that template, too.

 

On Mon, Feb 11, 2019 at 10:39 AM Jon Peck <[hidden email]> wrote:

A diamond marker is a rotated square shape.  To get it, include a small template in the GRAPHSPEC subcommand like this.

GGRAPH 

/GRAPHDATASET NAME="graphdataset" VARIABLES=jobtime salary jobcat MISSING=LISTWISE 

REPORTMISSING=NO 

/GRAPHSPEC SOURCE=INLINE

 inlinetemplate="<setStyle subtype='simple' type='scatter'><style symbol='square' glyph-angle='45'/></setStyle>".

 

On Mon, Feb 11, 2019 at 9:41 AM Atai Winkler <[hidden email]> wrote:

Hi

 

I wonder if someone could help me on two GPL questions I have.

 

1.            Page 413 of the GPL Reference Guide lists the possible marker shapes. I use diamonds as markers (second from left on top row of Properties/Marker/Type selection). However, I cannot see diamonds listed as a shape on page 413. So, how I specify diamonds in the syntax below (where squares are specified)?

2.            Is it possible to specify the weight of the axes using GPL (I cannot find it in the manual)? This is done manually under Properties/Lines/Weight.

 

ELEMENT: point(position(failure_period*cum_pcent_falling_failure_mode_14_15_16),

 color.interior(failure_mode_1), color.exterior(failure_mode_1),

shape(shape.square),

size(size."5.px"))

 

Thank you.

 

Atai

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

 

===================== 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


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]


 

--

Jon K Peck
[hidden email]



--
Jon K Peck
[hidden email]

===================== 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