I searched for an answer to this question as I imagine someone else must have encountered it before. I have a pandas dataframe that I want to plot. I prefer to plot this data with “x_axis_type=‘datetime’”. However, the scatter radius bubbles aren’t plotted proportionally when I convert to datetime axis.
Here’s the plot with an integer indexed x-axis:
Here’s the plot with the same data except for x-axis is converted to a datetime axis:
You might be able to faintly notice the smallest specs of fill bubbles. They’re there but there small.
I tried to magnify the bubble size on the datetime index because I figured the datetime timestamp may be magnifying the proportions on the x-axis size. That didn’t work.
I forgot to add my code snippets and I’ll include those below… sorry about that…
Hello Bokeh Users,
I searched for an answer to this question as I imagine someone else must have encountered it before. I have a pandas dataframe that I want to plot. I prefer to plot this data with “x_axis_type=‘datetime’”. However, the scatter radius bubbles aren’t plotted proportionally when I convert to datetime axis.
Here’s the plot with an integer indexed x-axis:
est variable is my datetime list of dates for the x axis
On Monday, July 3, 2017 at 1:15:46 PM UTC-5, Peter West wrote:
You might be able to faintly notice the smallest specs of fill bubbles. They’re there but there small.
I tried to magnify the bubble size on the datetime index because I figured the datetime timestamp may be magnifying the proportions on the x-axis size. That didn’t work.
For some discussion. But basically boils down too: Circles are radially symmetric, but to actually draw them on the canvas, the radius has to be measured along some single dimension. By default, Bokeh uses the x-dimenson scale to map data distances to screen (pixel) distances for circles, which in your case results in the tiny circles (because the x-dimension is really “milliseconds since epoch” .
There are a couple of options:
The direction to measure is configurable, you can have the circles scale their radii according to the y-dimension instead:
You can use a size (which is in absolute pixel units) instead of a radius (which is in “data space” units)
You can make the radii values much much larger, on the scale of the timestamp values (which are very large values)
Or, as an aside, consider a different approach to the visualization altogether. I would suggest in general that a bubble chart is not advised then whenever the scales of the x- and y- dimensions are not exactly identical.
I searched for an answer to this question as I imagine someone else must have encountered it before. I have a pandas dataframe that I want to plot. I prefer to plot this data with “x_axis_type=‘datetime’”. However, the scatter radius bubbles aren’t plotted proportionally when I convert to datetime axis.
Here’s the plot with an integer indexed x-axis:
Here’s the plot with the same data except for x-axis is converted to a datetime axis:
You might be able to faintly notice the smallest specs of fill bubbles. They’re there but there small.
I tried to magnify the bubble size on the datetime index because I figured the datetime timestamp may be magnifying the proportions on the x-axis size. That didn’t work.
I could use size and come up with some values in the following format:
dot_size = 4
ebq_max = np.max(eb.size)
ebt = list(eb.index)
ebp = list(eb.price)
ebq = list(eb.size / ebq_max * dot_size)
The ratio is locked to dot_size and the visualization stays the same even though I use different dot_size variables.
I may tinker around and come up with a better solution. I will post if I figure out a better way. Thanks for the great help thus far.
···
On Monday, July 3, 2017 at 1:15:46 PM UTC-5, Peter West wrote:
Hello Bokeh Users,
I searched for an answer to this question as I imagine someone else must have encountered it before. I have a pandas dataframe that I want to plot. I prefer to plot this data with “x_axis_type=‘datetime’”. However, the scatter radius bubbles aren’t plotted proportionally when I convert to datetime axis.
Here’s the plot with an integer indexed x-axis:
Here’s the plot with the same data except for x-axis is converted to a datetime axis:
You might be able to faintly notice the smallest specs of fill bubbles. They’re there but there small.
I tried to magnify the bubble size on the datetime index because I figured the datetime timestamp may be magnifying the proportions on the x-axis size. That didn’t work.