How to draw a circle on plotly

I am trying to plot a circle on plot using plotly, with a specified radius.

I have tried using the self.plot_1.layout.shape(type = “circle”…), but I get the following error:
TypeError: ‘WrappedObject’ object is not callable

What is the best way to draw a circle?

Thanks

The way to add shapes to plots is by assigning them to the shapes property. So, instead of self.plot_1.layout.shape(type = “circle”…), try this:

self.plot_1.layout.shapes = [
      dict(type="circle",
           xref="x", yref="y",
           x0=1, y0=1, x1=2, y1=6,
           line=dict(
                color="LightSeaGreen",
                width=4,
            )
          )
    ]
1 Like