How to remove axis in plotly subplot go.Image

image

This is image made using subplot plotly go.Image


fig = make_subplots(
rows=2, cols=2,
specs=[[{“type”: “image”}, {“type”: “image”}],
[ {“type”: “scatter”} , None ]])

fig.add_trace(
go.Image(z = patch_circle_detect_image),
row=1, col=1
)

I want to remove the axis and show image only.

Is there any option that can turn off the x, y axis in go.Image?

++ I found out the method to remove whole xaxes using

fig.update_yaxes(visible=False, showticklabels=False)
fig.update_xaxes(visible=False, showticklabels=False)

however, i just want to remove axes in particular subplots.

For example, remove axes in 1, 2 subplot and remain it at 3,4 subplots.

Thanks

Hi dear @lukeHa and welcome to plotly community.

test it and let me know does it work or not:

fig.update_layout(scene = dict(    xaxis = dict(
                                         showticklabels=False,
                                         title='',
                                          ),
                                    yaxis = dict(
                                        showticklabels=False,
                                         title='',
                                          ),
                                    zaxis = dict(
                                        showticklabels=False,
                                         title='',
                                          ),),
                     )

@lukeHa Your images are referenced to (xaxis, yaxis), respectively (xaxis2, yaxis2).
To remove all four axes, proceed as follows:

fig.update.layout(xaxis_visible=False, yaxis_visible=False, xaxis2_visible=False, yaxis2_visible=False)

@Bijan scene is defined only for 3d plots.

dear @empet Thanks for pointing out it :ok_hand: :+1:

1 Like