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.

bug in `plotnine 0.7.0`

See original GitHub issue

I get the following error:

    152         # 1.45 makes the default colourbar wider than the
    153         # legend entry boxes.
--> 154         width = (self.barwidth or _d('legend_key_width')) * 1.45
    155         height = (self.barheight or _d('legend_key_height')) * 1.45
    156         height *= 5

TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jbloomcommented, Jun 29, 2020

@has2k1, I figured out what causes the above bug to appear. It only happens with specific plotnine themes. For instance, this code gives the error mentioned in my post above. Note that this code differs from the code you ran without error in previous post only by using a different theme.

So I think in plotnine 0.7.0, geom_bin2d is broken for specific themes:

import pandas as pd
  
from plotnine import *

df = pd.DataFrame.from_records(
            [(0.0, -3.0), (-15.0, -10.0), (-6.0, -7.0),
             (-6.0, -6.0), (-15.0, -15.0)],
            columns=['predicted', 'actual']
            )

theme_set(theme_matplotlib())

p = ggplot(df, aes('actual', 'predicted')) + geom_bin2d()

p.save('plot.pdf')
0reactions
has2k1commented, Aug 5, 2020

v0.7.1 is out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation — plotnine 0.10.1 documentation - Read the Docs
plotnine can be can be installed in a couple of ways, depending on purpose. ... e.g. if a bug you care about has...
Read more >
plotnine - PyPI
plotnine is an implementation of a grammar of graphics in Python, it is based on ggplot2. The grammar allows users to compose plots...
Read more >
theme_void() TypeError · Issue #424 · has2k1/plotnine - GitHub
Hi, I get a TypeError exception running this code (on this df): ggplot(df) + \ geom_tile(aes(x = 'x', y = 'y', width =...
Read more >
plotnine v0.7.0 release notes (2020-06-05) | LibHunt
plotnine v0.7.0 Release Notes. Release Date: 2020-06-05 // over 2 years ago. This is a large release with many bug fixes and enhancements....
Read more >
scikit-learn version bug with auto-sklearn - Kaggle
... but you have matplotlib 3.4.3 which is incompatible. hypertools 0.7.0 requires scikit-learn!=0.22,<0.24,>=0.19.1, but you have scikit-learn 0.24.2 which ...
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