[英]What graph should represent a dataset with 2 variables?
say I have the following data: 说我有以下数据:
CAR_TYPE, #rentals, AMOUNT
CLASS_1 350 $0.7M
CLASS_2 220 $1.3M
CLASS_3 55 $0.4M
What graph would you use in order present this data? 您将使用什么图形来显示此数据? One option would be a pie-chart but as you can see from the data, the charts would be totally different --depends on the emphasis: numer of rentals or Amount.
一种选择是饼图,但从数据中可以看到,图表将完全不同-取决于重点:租金数或金额。
Q: In general, having 2 variables for one TYPE what should be the preferred graph. 问:通常,对于一个TYPE有2个变量应该是首选图形。
*I'm trying to achieve this in matlab (or python) but the concept is more important now then the actual implementation. *我正在尝试在matlab(或python)中实现这一点,但现在的概念比实际的实现更为重要。
Many thanks! 非常感谢!
For 2 variables (x, y) associated with each type (point) I would use a scatter plot. 对于与每种类型(点)相关联的2个变量(x,y),我将使用散点图。 I would prefer a scatter plot if there are a lot of points (say 100).
如果有很多点(例如100),我希望使用散点图。 So the x-axis could represent #rentals, the y-axis could represent AMOUNT, and the intersections could represent the car types.
因此,x轴可以表示#rentals,y轴可以表示AMOUNT,而交叉点可以表示汽车类型。
You can use a bar/column chart that looks like this: 您可以使用如下所示的条形图:
http://commons.wikimedia.org/wiki/File:Adobe_Flex_ColumnChart.png http://commons.wikimedia.org/wiki/File:Adobe_Flex_ColumnChart.png
您可以使用此matplotlib示例在python中提供的3D条形图 !
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.