question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Matplotlib plot gets cropped in HTML output, but fine in Notebook

See original GitHub issue

System Information

  • OS: Linux
  • Python version: 3.9.15
  • Python environment: pip
  • Using jupyter: true and false
  • Datapane version: 0.15.4

Bug / Issue

I generate exactly the same plots in Jupyter Notebook and Datapane, but when rendered in Datapane, the bottom half of the chart is removed.

Chart from Notebook

image

Chart from Datapane

image

Code

    app = dp.App(
        dp.Page(title="Quality",
                blocks=[f"### {config.team.upper()}: Quality",
                        quality_blurb,
                        dp.Group(
                            dp.Plot(generate_velocity_by_type(data.issues),responsive=False),
                            dp.Text(str(generate_velocity_by_type.__doc__)),
                            columns=2,
                        ),
                ]
        ),
        dp.Page(title="Efficiency",
                blocks=[f"### {config.team.upper()}: Efficency",
                        efficiency_blurb,
                        dp.Group(
                            dp.Plot(generate_planned_vs_done_percentage(data.issues),responsive=False),
                            dp.Text(str(generate_planned_vs_done_percentage.__doc__)),
                            columns=2,
                        ),
                ]
        ),
        dp.Page(title="Business Value",
                blocks=[f"### {config.team.upper()}: Business Value",
                        'tbc',
                ]
        ),
        dp.Page(title="Downloads",
                blocks=[f"### {config.team.upper()}: Downloads"] + generate_downloads(data.excel_files)
        ),
        layout=dp.PageLayout.SIDE,
    )

    app.save(
        f'{config.output_dir}/{config.team}.html',
        formatting=dp.AppFormatting(
        width=dp.AppWidth.FULL
        )
    )

I’ve tried playing with the responsive setting to no avail, so now I’m stumped.

Any help would be much appreciated.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
bradwoodcommented, Nov 7, 2022

thanks @shahinrostami !!!

1reaction
shahinrostamicommented, Nov 29, 2022

Hey @bradwood - this one has indeed been released, 0.15.5 like @woobe said!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to adjust padding with cutoff or overlapping labels
I am plotting a dataset using matplotlib where I have an xlabel that is quite "tall" (it's a formula rendered in TeX that...
Read more >
Jupyter interactive plot crops the canvas in Chrome #18206
When plotting with %matplotlib notebook , the canvas gets cropped to a small section in the top left corner. Code for reproduction. When...
Read more >
Tight Layout guide — Matplotlib 3.6.2 documentation
How to use tight-layout to fit plots within your figure cleanly. ... titles (or sometimes even ticklabels) go outside the figure area, and...
Read more >
matplotlib - 2D and 3D plotting in Python
However, I'd encourrage not using the MATLAB compatible API for anything but the simplest figures. Instead, I recommend learning and using matplotlib's object- ......
Read more >
Image Processing with Python - Data Carpentry
This is all well and good at this scale, but what happens when we instead ... When we plot such an image with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found