How to create a pie chart with color and pattern in SPSS

与世无争的帅哥 提交于 2019-12-11 18:29:04

问题


I want to create a colored and additional pattern, pie chart with GGRAPH\GPL. The function of the pattern is to visualize the major category to which the respective category belongs to.

With the SPSS Chart Builder I can only create a colored or a patterned pie chart.

The relevant ELEMENT Statement looks as follows:

ELEMENT: interval.stack(position(summary.percent(COUNT))), color(myvar))

Or:

ELEMENT: interval.stack(position(summary.percent(COUNT))), texture.pattern(myvar))

回答1:


Taking the Syntax created for the colored pie chart you can add the texture by simply adding the texture.pattern(myVar) function into the Element statement:

  ELEMENT: interval.stack(position(summary.percent(COUNT))), color(krwirtsek_kombi), texture.pattern(krwirtsek_kombi))

You can specify the color and pattern by using a template or via the map-function inside the scale statment:

SCALE: cat(aesthetic(aesthetic.color.interior), map(("<catvalue>", color."<rgb>"),  ...)
SCALE: cat(aesthetic(aesthetic.texture.pattern), map(("<catvalue>", texture.pattern.<patternconstant>), ...)

However when combining the color() and the texture.pattern() functions in the ELEMENT Statement and the tinkering with oder GPL-funtions, the results of these other functions might get odd (see this question about category order).



来源:https://stackoverflow.com/questions/55956820/how-to-create-a-pie-chart-with-color-and-pattern-in-spss

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!