2

I am doing a bubble plot with plotly/cufflinks in offline mode.

Plotly version: 5.1.0
Cufflinks version: 0.17.3

I have a DataFrame with 4 columns A,B,C,D and some random normally distributed data (100 rows in total).

Most of the bubbles are black but a few seem to have other colors by default?! What are these colors which I never asked for? Why some bubbles have colors and some don't?

df = pd.DataFrame(np.random.randn(100, 4), columns='A B C D'.split())

df.iplot(kind='bubble', x='A', y='B', size='C')

issue001

I looked at the doc page here but I don't find anything useful.

https://plotly.com/python/bubble-charts/

Here are debugging details, this is my full code:

%matplotlib inline

import numpy as np
import pandas as pd

import plotly as py
import cufflinks as cf

from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot

init_notebook_mode(connected = True)

cf.go_offline()

df = pd.DataFrame(np.random.randn(100, 4), columns='A B C D'.split())

df.iplot(kind='bubble', x='A', y='B', size='C')

Any ideas?

halfer
  • 19,824
  • 17
  • 99
  • 186
peter.petrov
  • 38,363
  • 16
  • 94
  • 159
  • What happens if you only pass the three columns that are being used? `df[['A','B','C']].iplot(kind='bubble', x='A', y='B', size='C')` – Derek O Sep 07 '21 at 18:49
  • @DerekO The same thing: I get a few bubbles in different colors ( than black ). – peter.petrov Sep 07 '21 at 21:00
  • 2
    Please reopen my question. I added code which demonstrates the issue. – peter.petrov Sep 07 '21 at 21:03
  • Try setting the color='black' in the df.iplot(). – Roxy Sep 08 '21 at 12:43
  • @Roxy Yes, I noticed that if I set the color explicitly it works OK i.e. all bubbles get colored in that color. The question is... what do these non-black colors (bubbles) mean in the case when I don't set a color explicitly?! Looks weird to me and I don't find any docs explaining that behavior. – peter.petrov Sep 08 '21 at 14:05

0 Answers0