Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VisPlotly not return the figure object #167

Open
chenboshuo opened this issue Aug 10, 2023 · 1 comment
Open

VisPlotly not return the figure object #167

chenboshuo opened this issue Aug 10, 2023 · 1 comment
Labels
bug There is a problem with the coding or algorithms

Comments

@chenboshuo
Copy link

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

@chenboshuo chenboshuo added the bug There is a problem with the coding or algorithms label Aug 10, 2023
@orbingol
Copy link
Owner

Thanks for reporting this issue. There will be a fix coming for the visualizers (hopefully) very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug There is a problem with the coding or algorithms
Projects
None yet
Development

No branches or pull requests

2 participants