Friday, May 17, 2019

Published May 17, 2019 by with 2 comments

Plotly Hover Works but the Point Is Not Rendered

Sometimes when using plotly, you'll plot something, it won't show up, and hovering over the point that didn't show up will work. What's going on?

Situation 1

You've hit a bug. There are many that can cause this, particularly with 'scattergl'. Examples are here and here.


There is a non-buggy way to have this happen. If you are in 'lines' mode and you plot a point that connects to no other points, you will get this behavior. A simple example is a plot of a single point. A less trivial example is something like the following:
  • x: [1, NaN, 2, NaN, 3]
  • y: [1, NaN, 2, NaN, 3]
As I've covered before, NaN's are not interpolated to in lines mode. The points above will not be rendered. Hover will work however. There is a workaround if you can stand the performance drop though. Simply use 'lines+markers'. The performance impact will vary based on your data set, but I've seen it generally be about 50% slower.

I have embedded a simple example below and the code is here. These two plots are identical except that one uses 'lines' and one uses 'lines+markers'. You can easily see the 'hidden points with working hover' behavior if you hover over (1,1) or (2,2) in the 'lines' plot:



  1. Each online slot game has different payouts. Before playing slots, you should read reviews that explain how to play slots easily and have tips on how to play. Get real money, release jackpots, frequent jackpots, bonuses and free spins. Of course, your chances of winning slots games depend on skill. and player luck but the percentage

  2. Thanks for taking the time to write this post! I found it to be very informative and well written. I appreciate your work and effort. Keep up the good work!