-1

There is this example in my workbook that gives me a list of information and asks to draw a pie chart representing this information. The ONLY module that you can import is turtle. I can draw the pie chart like in figure 1 but I do not know how to separate one segment from all the rest like in figure 2.

Figure 1: http://msenux.redwoods.edu/math/python/graphics/pie2.png

Figure 2: http://www.aecbytes.com/illustrations/viewpoint/2013/issue_67-images/fig11.png (I realise that figure 2 was created in word)

All I need to know is how to separate just one of the segments with it still being in-line with the whole circle.

Any help would be great

4

1 回答 1

0

取决于你的设计。如果图表的中心位于原点,您可以在绘制截面之前为其坐标添加偏移量。例如,如果线段是单位圆上从 0 到 90 度的饼图的四分之一,您可以沿平分线段 (1,1) 的矢量偏移线段。

但是,如果您想要一些体面的反馈,请发布最少的工作代码,以便我们进行检查。

此外,如果您链​​接的图像是您的,那么您就已经超越了色盲。

于 2014-03-23T05:24:18.303 回答