Skip to content

[QUESTION] Is it possible to ignore the output of a specific cell? #1397

@tpvasconcelos

Description

@tpvasconcelos

Question

I tried looking in the docs for this but I could not find any options on how to hide the output of a specific notebook cells. Did I miss something?

Motivation

The reason I'm asking is because I'm currently working on an examples gallery with Plotly and I sometimes want to have cells with something like:

fig.update_layout(
    foo="Bar",
    bar="Foo",
)

but since update_layout return a plotly figure, this is automatically captured by Sphinx-Gallery and include in the output.

A workaround would be to assign it back to a variable:

fig = fig.update_layout(
    foo="Bar",
    bar="Foo",
)

but I want to be consistent and follow the same standards used throughout the Plotly official docs (they always threat the Figure object as mutable and never reassign back to a fig variable). See this for instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions