Arc Shape with Path


#1

Hey, I’ve been trying to plot some shapes in plotly, but I can’t seem to get an arc shape to work.

I.e., using the SVG

M 10 10 A 10 10 0 0 1 20 10

for example, like

trace=dict(x=[5,10], y=[5,10],
               mode='markers', 
               marker=dict(size=9, color='orange'))

axis=dict(showline=True, zeroline=False, showgrid=False)

layout=dict(width=450, height=450, autosize=False,
            xaxis=dict(axis, **dict(range=[1,20])),  
            yaxis=dict(axis,**dict(range=[1, 20])),
            shapes=[dict(type='path',
                    layer='below',
                    path="M 10 10 A 10 10 0 0 1 20 10",
                    fillcolor='red',
                    line=dict(color= 'red')
          
    )]
            )
fig=dict(data=[trace], layout=layout)
iplot(fig)

doesn’t plot the shape at all. Is there a workaround to make the arc command work ?


#2

@eek Plotly does not provide the command A for elliptical arc.

Here https://github.com/plotly/plotly.js/blob/master/src/components/shapes/constants.js are listed the available commands for paths.


#3

Thx for your reply! No wonder A is always not working in the path command.
Do you happen to know how can I draw a arc with custom degree(lets say 90 degree circle)?