Re: Mars for male and venus for female characters as markers in scatterplots

Posted by Jon Peck on
URL: http://spssx-discussion.165.s1.nabble.com/Mars-for-male-and-venus-for-female-characters-as-markers-in-scatterplots-tp5740332p5740335.html

That doesn't use the symbols Art wanted in the chart, as far as I can see.

On Fri, Mar 19, 2021 at 1:29 PM PRogman <[hidden email]> wrote:
You can manually edit the shapes in the chart, unfortunately I cannot save
that change to template file (it just makes circles instead of mars/venus
markers when applied)

It works in syntax if you tweak the GPL code... depending on how often you
want it applied (my somewhat syntax style allows for easy adding or removing
a line or command...)

/PR

*demo data*.
MATRIX.
  COMPUTE x = MAKE(15,3,0).
  SAVE {x}
    /VARIABLES "Sex", "X", "Y"
    /OUTFILE   *.
END MATRIX.
COMPUTE sex = RV.BERNOULLI(0.5).
COMPUTE x   = RND(RV.UNIFORM(0,11)).
COMPUTE y   = RND(RV.UNIFORM(0,11)).
VARIABLE LEVEL x y (SCALE).
VALUE LABELS sex 0'Female' 1'Male'.
EXECUTE.

*Demo graph*.
GGRAPH
  /GRAPHDATASET
   NAME="graphdataset"
   VARIABLES = X
               Y
               Sex
  /GRAPHSPEC
   SOURCE    = INLINE .
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA:   X=col(source(s), name("X"))
  DATA:   Y=col(source(s), name("Y"))
  DATA:   Sex=col(source(s), name("Sex"), unit.category())
  SCALE:  cat(aesthetic(aesthetic.shape)
             ,map(("0", shape.female)
                 ,("1", shape.male)
                 )
             )
  GUIDE: legend(aesthetic(aesthetic.color)
               ,label("Sex")
               )
  SCALE:  cat(aesthetic(aesthetic.color)
             ,map(("0", color.red)
                 ,("1", color.blue)
                 )
             )
  GUIDE:  axis(dim(1), label("X"))
  GUIDE:  axis(dim(2), label("Y"))
  GUIDE:  text.title(label("Demo plot"))
  ELEMENT: point(position(X*Y)
                ,shape(Sex)
                ,color(Sex)
                ,size(size."10")
                )
END GPL.




Art Kendall wrote
> I am away from my PC at the moment.
>
> In some contexts, the ♂ &#9794 (Mars) is used for males and
>
> ♀ &#9792 (Venus) is used for females.
>
> In SPSS graphics is there a way to uses these as markers in scatterplots?
>
>
>
> -----
> Art Kendall
> Social Research Consultants
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> 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