1

I have a scatter chart where i the X-axis is the latitude, the Y-axis is the longitude. Each dot represents a restaurant. The marker size should represent the gross income of that restaurant.

In some areas these values vary wildly, in order of about 100x times, so these guys (rich ones) completely "hide" small nearby restaurants...

So I thought of using a log scale on the marker size... here is the code:

groups.plot.scatter(x='lon', y='lat', s=groups.weight.apply(lambda x: math.log(x)))

plt.plot(sLon, sLat, marker='o', color='red', markersize=math.log(aux.__len__()))

The thing is: i know for a fact that aux.__len__() equals several of the weights on the groups. Here is a image:

plot

The red dot should be very close in size to the ones on its right...

so my question is: Why is the plot from the second command not scaled as the rest?

Leonardo
  • 10,737
  • 10
  • 62
  • 155

1 Answers1

0

Its different because you are using scatter and plot which use different sizes. The markersize of plot scales linearly and is more sensitive than the s for a scatter which scales with the sqrt.

See this link for a similar discussion:

BenT
  • 3,172
  • 3
  • 18
  • 38