SPSS Statistics

 View Only

 Exporting my graphs as SVG doesn't render the texture patterns.

Andree Careon's profile image
Andree Careon posted Sat October 26, 2024 02:34 PM

I've googled, read, and searched high and low and I can't seem to find if anyone else has had this issue and how they fixed it.

I'm using v29, which is provided by my institution. I've made my graphs, they look perfect.
I've found that exporting as SVG confers the best quality when imported into word, the lines stay thin and crisp.

Everything was fine until I decided to use texture to cluster my data as I'm already using color so the reader can easily follow which group we're talking about.

Here's the code:

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=ProtocolID COUNT()[name="COUNT"] Phase ErrorTypes MISSING=LISTWISE REPORTMISSING=NO DATAFILTER=ErrorTypes(VALUES=0 1 2 3 4 5 UNLABELED=INCLUDE) 
  /GRAPHSPEC SOURCE=INLINE
  /COLORCYCLE COLOR1(255,255,255), COLOR2(221,221,221), COLOR3(51,117,56), COLOR4(93,168,153), COLOR5(148,203,236), COLOR6(220,205,125), COLOR7(194,106,119), COLOR8(159,74,150), COLOR9(126,41,84), COLOR10(46,37,133)
  /FRAME OUTER=NO INNER=NO
  /GRIDLINES XAXIS=NO YAXIS=NO
  /STYLE GRADIENT=NO.
BEGIN GPL
  PAGE: begin(scale(620px,325px))
  GUIDE: axis(dim(1), label("Protocols"))
  GUIDE: axis(dim(2), label("Count of exoerunents with xx errors"))
  GUIDE: legend(aesthetic(aesthetic.texture.pattern.interior), label("Phase"))
  GUIDE: legend(aesthetic(aesthetic.color), null())
  SCALE: cat(dim(1), include("1", "2", "3", "4", "5", "6", "7", "8", "9", "10"))
  SCALE: linear(dim(2), include(0), max(30))
  SCALE: cat(aesthetic(aesthetic.texture.pattern.interior), include("0", "1", "2"))
  ELEMENT: interval.stack(position(ProtocolID*COUNT), texture.pattern.interior(Phase), shape.interior(shape.square),color(ProtocolID),transparency.interior(transparency.".5"),size(size."90%"))
  PAGE: end()
END GPL.

Here's what it looks like (screenshot) in SPSS (in the output window AND the edit window, because it renders the textures differently...)

Notice how one of the texture's doesn't match with the 3rd in the legend
notice the graph's textures now matches the 3rd legend texture
I can live with the output and edit not matching, same happens with the font between serif and sans serif. It comes out fine once exported so doesn't worry me.
What happened? Where did the textures go?! How to I get them back?
Jon Peck's profile image
Jon Peck IBM Champion

You are right.  SVG charts are just ignoring the pattern element even though the other chart formats respect the patterns.  This has been reported to Development.

Andree Careon's profile image
Andree Careon

@Jon Peck Do you think this will be corrected within the year or should I simply settle for a rasterized format? Thank you.

Jon Peck's profile image
Jon Peck IBM Champion

I can't speak for Development, but I would suggest choosing another format for now.  You can always switch back at an appropriate time in the future.