How set the Initial plotting Zoom to view whole model

Hi everyone

Using the below code I have set the size of axis range and ratio and it works correctly. But when I plot the model the zoom of model is not correct in first view and I have to zoom out the model to see whole of it. What should I do till when I plot the model, initially the whole model completely can be seen?

        scene = dict(
            xaxis = dict(nticks=4, range=[xmin-0.05*abs(xmax-xmin),xmax+0.05*abs(xmax-xmin)],),
                         yaxis = dict(nticks=4, range=[ymin-0.05*abs(ymax-ymin),ymax+0.05*abs(ymax-ymin)],),
                         zaxis = dict(nticks=4, range=[zmin-0.05*abs(zmax-zmin),zmax+0.05*abs(zmax-zmin)],),),)

@Bijan To display your model, completely, set
scene_camera_eye=dict(x=a, y=a, z=1), where a is chosen by trial and error. The default value for a is 1.25, but you mai set it even greater than 2.

1 Like

is there any reference about β€œa”? Because I have various figures I need the scale of β€œa” instead of trial and error. seems that’s a ratio but it is not clear ratio of what values.

If you print help(go.layout.scene.Camera.eye) it is displayed the following information:

Help on property:

    Sets the (x,y,z) components of the 'eye' camera vector. This
    vector determines the view point about the origin of this
    The 'eye' property is an instance of Eye
    that may be specified as:
      - An instance of :class:``
      - A dict of string/value properties that will be passed
        to the Eye constructor
        Supported dict properties:

But here is mentioned that the default values are x=1.25, y=1.25, z=1.25. That’s all. If your plot is not visible entirely, you must try different values for x, y, z.

1 Like

I have the same problem, but β€œtrial and error” is not an option because I am plotting many different graphs in a loop.

I already tried calculating the camera distance (in my case cam eye z) from the maximum of the x and y ranges and a fov of 45 deg (which i read somewhere is the built-in fov), but that does not work for some reason. is there no option to tell the graph to adjust the zoom / size / cam-dist automatically so that it is wholly contained in the pixel dimensions of my layout?