1

I need to plot the Bubble Plot. But when output Bubble plot the marker size is exceptionally very big and unable to plot it clearly. I have used the following code for the purpose of plotting.

Afghanistan = go.Scatter(x = df4.Year, 
                        y = df4.Afghanistan, 
                        mode = 'markers',
                        marker_size = df4.Afghanistan,
                        marker=dict(
                            size=df4.Afghanistan,
                            color=df4.Afghanistan,
                            showscale=True))

data = [Afghanistan]

layout = go.Layout(title= 'Afghanistan',
                    xaxis= {'title' : 'My X-Axis'},
                    yaxis = dict(title = "My Y-Axis"),
                    hovermode = 'closest')

fig = go.Figure(data = data, layout = layout)

fig.show()

Below how the output looks like. the size of the markers are too big. enter image description here

So how to reduce the size of the bubbles. (I have tried to reduce the bubble size, with the following commands also.. But not working)

size = 0.1 * df4.Afghanistan

Also tried with "normalize value", and mapped this "normalized value" for mapping size of the marker. Still output was the same.

    nor_Afghanistan = (df4.Afghanistan-df4['Afghanistan'].min())/(df4['Afghanistan'].max()-df4['Afghanistan'].min())
....
....
    size = nor_Afghanistan
viththi
  • 161
  • 3
  • 9
  • 1
    Can you show us with `df4` looks like? – Derek O Jan 17 '21 at 18:29
  • @viththi You can easily share your `df4` like [this](https://stackoverflow.com/questions/63163251/pandas-how-to-easily-share-a-sample-dataframe-using-df-to-dict/63163254#63163254) – vestland Jan 17 '21 at 23:19

0 Answers0