Skip to content

VisPlotly not return the figure object #167

Open
@chenboshuo

Description

@chenboshuo

Describe the bug
Look at the soource code

# Display the plot
if self.vconf.in_notebook() or self.vconf.use_renderer:
fig.show()
elif fig_display:
fig.write_html(file=self.vconf.figure_image_filename if fig_filename is None else fig_filename)
else:
fig.write_image(file=self.vconf.figure_image_filename if fig_filename is None else fig_filename)
class VisVolume(vis.VisAbstract):

How to get the fig

When I use

help(surf.render)

I get the content

Help on method render in module geomdl.abstract:

render(**kwargs) method of geomdl.BSpline.Surface instance
    Renders the surface using the visualization component.
    
    The visualization component must be set using :py:attr:`~vis` property before calling this method.
    
    Keyword Arguments:
        * ``cpcolor``: sets the color of the control points grid
        * ``evalcolor``: sets the color of the surface
        * ``trimcolor``: sets the color of the trim curves
        * ``filename``: saves the plot with the input name
        * ``plot``: controls plot window visibility. *Default: True*
        * ``animate``: activates animation (if supported). *Default: False*
        * ``extras``: adds line plots to the figure. *Default: None*
        * ``colormap``: sets the colormap of the surface
    
    The ``plot`` argument is useful when you would like to work on the command line without any window context.
    If ``plot`` flag is False, this method saves the plot as an image file (.png file where possible) and disables
    plot window popping out. If you don't provide a file name, the name of the image file will be pulled from the
    configuration class.
    
    ``extras`` argument can be used to add extra line plots to the figure. This argument expects a list of dicts
    in the format described below:
    
    .. code-block:: python
        :linenos:
    
        [
            dict(  # line plot 1
                points=[[1, 2, 3], [4, 5, 6]],  # list of points
                name="My line Plot 1",  # name displayed on the legend
                color="red",   # color of the line plot
                size=6.5  # size of the line plot
            ),
            dict(  # line plot 2
                points=[[7, 8, 9], [10, 11, 12]],  # list of points
                name="My line Plot 2",  # name displayed on the legend
                color="navy",   # color of the line plot
                size=12.5  # size of the line plot
            )
        ]
    
    Please note that ``colormap`` argument can only work with visualization classes that support colormaps. As an
    example, please see :py:class:`.VisMPL.VisSurfTriangle()` class documentation. This method expects a single
    colormap input.
    
    :return: the figure object

It should return figure object, but I got None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThere is a problem with the code or documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions