2017-10-04 169 views
0

我试图重现如下图年趋势:极坐标图:显示

enter image description here

但我不知道是否确实可以创建这样使用Python,R或一个的Tableau情节。 这里是用我的第一次尝试Plotly在R:

enter image description here

你有没有建立这样一个图什么建议吗?

+0

为什么你换时间在极坐标(缺少大小的图例)?这只是...糟糕的 – EDi

+0

你可以使用matplotlib在Python中近似它。然而,在我看来,这需要付出相当大的努力,尤其是对那些对该产品不熟悉的人。 –

回答

0

您可以使用R和德包highcharter创建这样一个情节:

spiderweb plot

情节js代码则可以通过www/highcharts.com /演示/极地蜘蛛

0

当我正在用matplotlib创建这个图时,有人提到我可以使用Excel创建这个图表!在不到2分钟的时间内,所以我没有完成代码,但无论如何,因为我已经知道应该如何在matplotlib中创建不同的图元,我将代码放在这里以防万一任何人想要创建这样的事情。

import matplotlib.pyplot as plt 
import matplotlib.patches as patches 

fig1 = plt.figure() 

#Adding grids 
for rad in reversed(range(1,10)): #10 is maximum of ranks we need to show 

    ax1 = fig1.add_subplot(111,aspect = 'equal') 
    ax1.add_patch(
    patches.RegularPolygon(
    (0,0), #center of the shape 
    11, #number of vertices 
    rad, 
     fill=False, 

     ls='--', 
    )) 
plt.xlim(xmin = -10,xmax=10) 
plt.ylim(ymin = -10,ymax=10) 
fig1.show() 

#plotting the trend 
plt.scatter(xs,ys) #xs = list of x coordinates, the same for ys 

for k in range(len(xs)-1): 
    x, y = [xs[k], xs[k+1]], [ys[k], ys[k+1]] 

    plt.plot(x, y,color = 'b') 

plt.grid(False) 

plt.show() 

Result plot

(正如我所说的代码不会产生整体的趋势,标签,...但它几乎是所有你需要创建情节)