Is it possible to invert an axis in an SPSS graph, say from -1,0,1 to 1,0,-1 without using code?I have only been able to change the axes' coordination from x to y and reverse which was not what I wanted. I know inverting is possible with a code (or so they say in some forums) but I have zero knowledge on programming and I would prefer an easier way if such a way exists.
It's ok if you don't have programming knowledge. You do indeed need code to do this, but it is still very easy. If you can copy/paste, you can reverse an axis. Follow these steps:
Here's an example:
* Chart Builder.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=var1 var2 MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: var1=col(source(s), name("var1"))
DATA: var2=col(source(s), name("var2"))
GUIDE: axis(dim(1), label("X"))
GUIDE: axis(dim(2), label("Y"))
ELEMENT: point(position(var1*var2))
END GPL.
SCALE: linear(dim(1), reverse()) somewhere between BEGIN GPL and END GPL(note: change dim(1) to dim(2) before you paste if you want to reverse the y axis)
* Chart Builder.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=var1 var2 MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: var1=col(source(s), name("var1"))
DATA: var2=col(source(s), name("var2"))
SCALE: linear(dim(1), reverse())
GUIDE: axis(dim(1), label("var1"))
GUIDE: axis(dim(2), label("var2"))
ELEMENT: point(position(var1*var2))
END GPL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With