To graph two or more groups using different symbols, one can use a scatter plot or a bar graph. In a scatter plot, each group can be represented by a different colored dot or shape, making it easy to distinguish between the groups. Alternatively, in a bar graph, each group can be represented by a different color or pattern, allowing for clear differentiation between the groups. This method of graphing is particularly useful when comparing data from multiple groups, as it allows for visual comparison and identification of patterns or trends between the groups.
How can I graph two (or more) groups using different symbols? | SPSS FAQ
Suppose we are using the High School and
Beyond
data file (hsb2) which has test scores for 200 students,
including 91 male and 109 female students.
We could make a graph of their read and write scores as
shown below with the graph command.
get file 'c:/spss/faq/hsb2.sav'. graph /scatterplot(bivar) = write with read.

Now, let’s make a graph where we see the scores
separately for the males and the females. We will use the by
option with the graph command, and SPSS will assign different symbols
to each group.
graph /scatterplot=read with write by female.

If you would like to change the
symbols (SPSS calls them “markers”) used for the groups, double click on the
graph to open the chart editor, select
select “format”, then “marker”, and then select the marker and the size that you
would like. Click on “apply”, “close” and then close the
chart editor. If you would like to have different markers
for the different groups, double click on the graph, double click on the legend on the
right that labels the groups, and select (i.e., single click on) the group whose marker you would
like to change. Next, select “format”, “marker”, and then
select the marker and the size that you would like. Click on “apply”,
click on “close” and then close the chart editor.
graph /scatterplot=read with write by female.

You can also use the ggraph
command to create a scatterplot with different symbols. Below, we use
color to distinguish between males and females.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=read write female
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: read=col(source(s), name("read"))
DATA: write=col(source(s), name("write"))
DATA: female=col(source(s), name("female"), unit.category())
GUIDE: axis(dim(1), label("reading score"))
GUIDE: axis(dim(2), label("writing score"))
ELEMENT: point(position(read*write), color(female))
END GPL.
You can also use different symbol shapes to distinguish between males and
females.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=read write female
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: read=col(source(s), name("read"))
DATA: write=col(source(s), name("write"))
DATA: female=col(source(s), name("female"), unit.category())
GUIDE: axis(dim(1), label("reading score"))
GUIDE: axis(dim(2), label("writing score"))
ELEMENT: point(position(read*write), shape(female))
END GPL.
Of course, you can also use both different colors and different shapes.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=read write female
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: read=col(source(s), name("read"))
DATA: write=col(source(s), name("write"))
DATA: female=col(source(s), name("female"), unit.category())
GUIDE: axis(dim(1), label("reading score"))
GUIDE: axis(dim(2), label("writing score"))
ELEMENT: point(position(read*write), color(female), shape(female))
END GPL.
Cite this article
stats writer (2024). How can I graph two (or more) groups using different symbols?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-graph-two-or-more-groups-using-different-symbols/
stats writer. "How can I graph two (or more) groups using different symbols?." PSYCHOLOGICAL SCALES, 30 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-graph-two-or-more-groups-using-different-symbols/.
stats writer. "How can I graph two (or more) groups using different symbols?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-graph-two-or-more-groups-using-different-symbols/.
stats writer (2024) 'How can I graph two (or more) groups using different symbols?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-graph-two-or-more-groups-using-different-symbols/.
[1] stats writer, "How can I graph two (or more) groups using different symbols?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How can I graph two (or more) groups using different symbols?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
