Skip legend in line plot?

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

Skip legend in line plot?

Robert L
In a line plot for repeated series of individuals'  results, I would like to skip the legend. In the following code, there is a small example where just deleting the "GUIDE: legend()" part does not work. Well, the variable name is not printed, but the rest is included. Anyone who knows it this chart element can be avoided?

Robert

INPUT PROGRAM.
   LOOP #I=1 TO 5.
      COMPUTE data1 = RV.NORMAL(100,20).
      COMPUTE data2 = RV.NORMAL(150,20).
      COMPUTE data3 = RV.NORMAL(180,20).
      COMPUTE time=#I.
      END CASE.
   END LOOP.
   END FILE.
END INPUT PROGRAM.
EXECUTE.

DATASET NAME random.

VARSTOCASES
/MAKE data FROM data1 TO data3
/INDEX pid
/KEEP time.


DATASET ACTIVATE random.
* Chart Builder.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=time data pid MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: time=col(source(s), name("time"), unit.category())
  DATA: data=col(source(s), name("data"))
  DATA: pid=col(source(s), name("pid"), unit.category())
  GUIDE: axis(dim(1), label("time"))
  GUIDE: axis(dim(2), label("data"))
  GUIDE: legend(aesthetic(aesthetic.color.interior), label("pid"))
  SCALE: linear(dim(2), include(0))
  ELEMENT: line(position(time*data), color.interior(pid), missing.wings())
END GPL.

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

AW: Skip legend in line plot?

la volta statistics
What about:

* Chart Builder.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=time data pid MISSING=LISTWISE
REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: time=col(source(s), name("time"), unit.category())
  DATA: data=col(source(s), name("data"))
  DATA: pid=col(source(s), name("pid"), unit.category())
  GUIDE: axis(dim(1), label("time"))
  GUIDE: axis(dim(2), label("data"))
  GUIDE: legend(aesthetic(aesthetic.color), null())
  SCALE: linear(dim(2), include(0))
  ELEMENT: line(position(time*data), color.interior(pid), missing.wings())
END GPL.

Hope this helps
Christian

**********************************
la volta statistics
Christian Schmidhauser, Dr.phil.II
Im Gubel 29
CH-8706 Feldmeilen
Tel: +41 (043) 233 98 01
Fax: +41 (043) 233 98 02
email: mailto:[hidden email]
Web: www.lavolta.ch


-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]] Im Auftrag von
Robert Lundqvist
Gesendet: Montag, 21. Oktober 2013 11:40
An: [hidden email]
Betreff: Skip legend in line plot?

In a line plot for repeated series of individuals'  results, I would like to
skip the legend. In the following code, there is a small example where just
deleting the "GUIDE: legend()" part does not work. Well, the variable name
is not printed, but the rest is included. Anyone who knows it this chart
element can be avoided?

Robert

INPUT PROGRAM.
   LOOP #I=1 TO 5.
      COMPUTE data1 = RV.NORMAL(100,20).
      COMPUTE data2 = RV.NORMAL(150,20).
      COMPUTE data3 = RV.NORMAL(180,20).
      COMPUTE time=#I.
      END CASE.
   END LOOP.
   END FILE.
END INPUT PROGRAM.
EXECUTE.

DATASET NAME random.

VARSTOCASES
/MAKE data FROM data1 TO data3
/INDEX pid
/KEEP time.


DATASET ACTIVATE random.
* Chart Builder.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=time data pid MISSING=LISTWISE
REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: time=col(source(s), name("time"), unit.category())
  DATA: data=col(source(s), name("data"))
  DATA: pid=col(source(s), name("pid"), unit.category())
  GUIDE: axis(dim(1), label("time"))
  GUIDE: axis(dim(2), label("data"))
  GUIDE: legend(aesthetic(aesthetic.color.interior), label("pid"))
  SCALE: linear(dim(2), include(0))
  ELEMENT: line(position(time*data), color.interior(pid), missing.wings())
END GPL.

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

Re: Skip legend in line plot?

Andy W
In reply to this post by Robert L
Replace

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

With

GUIDE: legend(aesthetic(aesthetic.color.interior), null())
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/