What does it need to specify the category order in a colored and patterned pie chart in SPSS?

六眼飞鱼酱① 提交于 2019-12-24 23:23:49

问题


I created a colored and patterned pie chart as described in this stack exchange Question. Now I also want to specify an order of the categories to apear in the pie chart.

Usually this works with the sort.values funtion:

SCALE: cat(aesthetic(aesthetic.color), sort.values("value", "value",...))

However this function doesn't seem to have an effect when having both color(var)) and texture.pattern(var) functions inside the same ELEMENT-Statement.


回答1:


You also need to specify the category order for the texture.pattern. So add the line:

SCALE: cat(aesthetic(aesthetic.texture.pattern), sort.values("value", "value", ...))

Defining the category order for both, the color aesthetic and the texture.pattern aesthetic should result in the specific ordered pie chart.

Unfortunatly the order isn't applyied to the legend, which is quiet a bummer when trying to read the pie chart. I haven't figured out how or if this can be fixed.



来源:https://stackoverflow.com/questions/55956990/what-does-it-need-to-specify-the-category-order-in-a-colored-and-patterned-pie-c

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