Discussion:
If a line graph has markers and error bars, the legend will not show the markers.
(too old to reply)
Richard Anderson
2013-02-16 01:34:53 UTC
Permalink
For many years, I've complained to SPSS that if a line graph has both markers and error bars, the legend will not show the markers. This is especially problematic when the graph is black-and-white, and when each of the graph's multiple lines has the same line style (line lack of markers, in the legend, makes the graph ambiguous. In recent years I've had trouble finding a way to re-communicate this problem to IBM SPSS. So I'm hoping that some of you who have access to SPSS technical support will consider relaying reporting this years-long bug (SPSS 20) to IBM.
Jon Peck
2013-02-16 04:15:24 UTC
Permalink
Post by Richard Anderson
For many years, I've complained to SPSS that if a line graph has both markers and error bars, the legend will not show the markers. This is especially problematic when the graph is black-and-white, and when each of the graph's multiple lines has the same line style (line lack of markers, in the legend, makes the graph ambiguous. In recent years I've had trouble finding a way to re-communicate this problem to IBM SPSS. So I'm hoping that some of you who have access to SPSS technical support will consider relaying reporting this years-long bug (SPSS 20) to IBM.
I constructed a chart with two lines with error bars AND markers - one set square and the other set using "flower". Is this what you want? Using the employee data.sav file, run this.

GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=educ MEANCI(salary, 95)[name="MEAN_salary"
LOW="MEAN_salary_LOW" HIGH="MEAN_salary_HIGH"]
MEANCI(salbegin, 95)[name="MEAN_salbegin"
LOW="MEAN_salbegin_LOW" HIGH="MEAN_salbegin_HIGH"]
MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: educ=col(source(s), name("educ"), unit.category())
DATA: MEAN_salary=col(source(s), name("MEAN_salary"))
DATA: LOW=col(source(s), name("MEAN_salary_LOW"))
DATA: HIGH=col(source(s), name("MEAN_salary_HIGH"))
DATA: MEAN_salbegin=col(source(s), name("MEAN_salbegin"))
DATA: LOW2=col(source(s), name("MEAN_salbegin_LOW"))
DATA: HIGH2=col(source(s), name("MEAN_salbegin_HIGH"))
GUIDE: axis(dim(1), label("Educational Level (years)"))
GUIDE: axis(dim(2), label("Mean Current Salary"))
GUIDE: text.footnote(label("Error Bars: 95% CI"))
SCALE: cat(dim(1), include("8", "12", "14", "15", "16", "17", "18", "19", "20", "21"))
SCALE: linear(dim(2), include(0))
ELEMENT: point(position(educ*MEAN_salary), shape.interior(shape.square))
ELEMENT: interval(position(region.spread.range(educ*(LOW+HIGH))), shape.interior(shape.ibeam))
ELEMENT: line(position(educ*MEAN_salary))
ELEMENT: point(position(educ*MEAN_salbegin), shape.interior(shape.flower))
ELEMENT: interval(position(region.spread.range(educ*(LOW2+HIGH2))), shape.interior(shape.ibeam))
ELEMENT: line(position(educ*MEAN_salbegin))
END GPL.
Richard Anderson
2013-02-20 02:51:22 UTC
Permalink
Thanks for trying this. But actually, the script you've provided doesn't display a legend at all. The difficulty in SPSS is not in producing a graph with error bars and markers. Rather, the problem is in getting the markers to show up in the legend. One can get line markers in the legend, or one can include error bars in the graph, but if one includes error bars then it is not possible to have the legend display line markers. Here is a web page that shows a graph with line markers and error bars, and a useless legend (along with the script that generated the graph): https://sites.google.com/site/dataspace3579/temp
Post by Richard Anderson
For many years, I've complained to SPSS that if a line graph has both markers and error bars, the legend will not show the markers. This is especially problematic when the graph is black-and-white, and when each of the graph's multiple lines has the same line style (line lack of markers, in the legend, makes the graph ambiguous. In recent years I've had trouble finding a way to re-communicate this problem to IBM SPSS. So I'm hoping that some of you who have access to SPSS technical support will consider relaying reporting this years-long bug (SPSS 20) to IBM.
a***@coik.org
2018-12-11 01:17:38 UTC
Permalink
still happening version 25, no workaround available
Richard Anderson
2018-12-11 01:24:01 UTC
Permalink
Post by a***@coik.org
still happening version 25, no workaround available
Supposedly, version 26 will have a different graphing engine. Maybe that will fix it.
Loading...