1

In the figure about isosurface, only 6 edges of the cube are shown, where mirror='allticks' is used. And how to show the other 6 edges?

the figure about isosurface

My code is given as:

import plotly.graph_objects as go

fig = go.Figure(data=go.Isosurface(
               x=[0, 0, 0, 0, 1, 1, 1, 1],
               y=[1, 0, 1, 0, 1, 0, 1, 0],
               z=[1, 1, 0, 0, 1, 1, 0, 0],
               value=[1, 0, 1, 0, 2, -2, 3, 6],
               surface=dict(count=50, fill=1.0),
               isomin=2.0,
               isomax=9.0))

config = dict(showline=True,
             linecolor='black',
             showbackground=False,
             range=[-0.0, 1.0],
             tickcolor='black',
             mirror='allticks',
             ticks='outside')

fig.update_layout(scene=dict(
                 xaxis=config,
                 yaxis=config,
                 zaxis=config,
                 xaxis_title_text='x',
                 yaxis_title_text='y',
                 zaxis_title_text='z'),
                 width=900 )

fig.show()

BONNED
  • 23
  • 1
  • 5
  • Please, provide enough code for us to help you debug the problem. At the moment, we can only look at your picture. It's beautiful, but not useful. – Davide_sd Sep 21 '22 at 20:36
  • A simple executable demo is given above. Thank you. – BONNED Sep 21 '22 at 21:28

1 Answers1

0

I have added the following codes to show all the edges of the cube.

fig.add_trace(go.Scatter3d(
  x=[1, 1, 0],
  y=[0, 1, 1],
  z=[1, 1, 1],
  mode='lines',
  line=dict(color='black', width=2, dash='solid'),
  showlegend=False
))
fig.add_trace(go.Scatter3d(
  x=[1, 0, 0],
  y=[0, 0, 1],
  z=[0, 0, 0],
  mode='lines',
  line=dict(color='black', width=2, dash='solid'),
  showlegend=False
))
fig.add_trace(go.Scatter3d(
  x=[1, 1],
  y=[1, 1],
  z=[0, 1],
  mode='lines',
  line=dict(color='black', width=2, dash='solid'),
  showlegend=False
))
fig.add_trace(go.Scatter3d(
  x=[0, 0],
  y=[0, 0],
  z=[0, 1],
  mode='lines',
  line=dict(color='black', width=2, dash='solid'),
  showlegend=False
))
Tyler2P
  • 2,324
  • 26
  • 22
  • 31
BONNED
  • 23
  • 1
  • 5