Question on GPL

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

Question on GPL

Atai Winkler

Hi

 

Is it possible to specify in GPL the number of decimal places for the axes?

 

My graph code is

 

* Chart Builder.

GGRAPH

  /GRAPHDATASET NAME="graphdataset" VARIABLES=cum_no_planned_proactive_intvns SUR_1  failure

    MISSING=LISTWISE REPORTMISSING=NO

  /GRAPHSPEC SOURCE=INLINE  TEMPLATE='chart_templates\scattergraphs template.sgt'

  /FRAME OUTER=YES.

BEGIN GPL

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

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

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

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

  GUIDE: axis(dim(1), label("No. planned proactive interventions since previous failure"))

  GUIDE: axis(dim(2), label("Survival probability"), delta(0.2))

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

  SCALE: linear(dim(2), min(0), max(1))

  ELEMENT: point(position(cum_no_planned_proactive_intvns*SUR_1), color.interior(failure))

END GPL.

 

 

The Y axis is survival probability, and its values on the axis are shown as integers (0, 0, 0, 1, 1, 1) when I want 0, 0.2, 0.4, 0.6, 0.8, 1.

 

Thank you.

 

 

Dr Atai Winkler

PAM Analytics

 

[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: Question on GPL

PRogman
One way is to set the number format on the variable before the GGRAPH command
is executed.
If you just want to changed it for this procedure, use TEMPORARY, like:

TEMPORARY.
FORMATS SUR_1 (F8.1).
GGRAPH....

A more complex way is to use INLINETEMPLATE which is undocumented...

HTH, PR



Atai Winkler wrote

> Hi
>
> Is it possible to specify in GPL the number of decimal places for the
> axes?
>
> My graph code is
>
> * Chart Builder.
> GGRAPH
>   /GRAPHDATASET NAME="graphdataset"
> VARIABLES=cum_no_planned_proactive_intvns SUR_1  failure
>     MISSING=LISTWISE REPORTMISSING=NO
>   /GRAPHSPEC SOURCE=INLINE  TEMPLATE='chart_templates\scattergraphs
> template.sgt'
>   /FRAME OUTER=YES.
> BEGIN GPL
>   SOURCE: s=userSource(id("graphdataset"))
>   DATA: cum_no_planned_proactive_intvns=col(source(s),
> name("cum_no_planned_proactive_intvns"))
>   DATA: SUR_1=col(source(s), name("SUR_1"))
>   DATA: failure=col(source(s), name("failure"), unit.category())
>   GUIDE: axis(dim(1), label("No. planned proactive interventions since
> previous failure"))
>   GUIDE: axis(dim(2), label("Survival probability"), delta(0.2))
>   GUIDE: legend(aesthetic(aesthetic.color.interior), label("failure"))
>   SCALE: linear(dim(2), min(0), max(1))
>   ELEMENT: point(position(cum_no_planned_proactive_intvns*SUR_1),
> color.interior(failure))
> END GPL.
>
>
> The Y axis is survival probability, and its values on the axis are shown
> as integers (0, 0, 0, 1, 1, 1) when I want 0, 0.2, 0.4, 0.6, 0.8, 1.
>
> Thank you.
>
>
> Dr Atai Winkler
> PAM Analytics

> atai.winkler@

> <mailto:

> atai.winkler@

> >
>
>
>
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





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

Re: Question on GPL

Jon Peck
The  variable format control is the ideal solution.  

The CSR says this about INLINETEMPLATE in the context of the ancient IGRAPH conversion program.

The conversion utility program may generate additional syntax that it stores in the INLINETEMPLATE
keyword within the GGRAPH syntax. This keyword is created only by the conversion program. Its syntax is
not intended to be user-editable.

I do, however, have a few non IGRAPH usages in my collection of graphing commands.  Here is an example.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=VAR00001 MEAN(x)[name="MEAN_x"] MISSING=LISTWISE
    REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE INLINETEMPLATE=["<addDataLabels><labeling variable='x'></labeling></addDataLabels>"].

If you want to control more than the number of decimals in the axis tick labels, you can edit a chart in the Chart Editor and save the properties of interest in a small template that can then be used with GGRAPH to override default behaviors.

On Tue, Aug 18, 2020 at 10:12 AM PRogman <[hidden email]> wrote:
One way is to set the number format on the variable before the GGRAPH command
is executed.
If you just want to changed it for this procedure, use TEMPORARY, like:

TEMPORARY.
FORMATS SUR_1 (F8.1).
GGRAPH....

A more complex way is to use INLINETEMPLATE which is undocumented...

HTH, PR



Atai Winkler wrote
> Hi
>
> Is it possible to specify in GPL the number of decimal places for the
> axes?
>
> My graph code is
>
> * Chart Builder.
> GGRAPH
>   /GRAPHDATASET NAME="graphdataset"
> VARIABLES=cum_no_planned_proactive_intvns SUR_1  failure
>     MISSING=LISTWISE REPORTMISSING=NO
>   /GRAPHSPEC SOURCE=INLINE  TEMPLATE='chart_templates\scattergraphs
> template.sgt'
>   /FRAME OUTER=YES.
> BEGIN GPL
>   SOURCE: s=userSource(id("graphdataset"))
>   DATA: cum_no_planned_proactive_intvns=col(source(s),
> name("cum_no_planned_proactive_intvns"))
>   DATA: SUR_1=col(source(s), name("SUR_1"))
>   DATA: failure=col(source(s), name("failure"), unit.category())
>   GUIDE: axis(dim(1), label("No. planned proactive interventions since
> previous failure"))
>   GUIDE: axis(dim(2), label("Survival probability"), delta(0.2))
>   GUIDE: legend(aesthetic(aesthetic.color.interior), label("failure"))
>   SCALE: linear(dim(2), min(0), max(1))
>   ELEMENT: point(position(cum_no_planned_proactive_intvns*SUR_1),
> color.interior(failure))
> END GPL.
>
>
> The Y axis is survival probability, and its values on the axis are shown
> as integers (0, 0, 0, 1, 1, 1) when I want 0, 0.2, 0.4, 0.6, 0.8, 1.
>
> Thank you.
>
>
> Dr Atai Winkler
> PAM Analytics

> atai.winkler@

> &lt;mailto:

> atai.winkler@

> &gt;
>
>
>
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





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


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