Highlighting a single point in a scatter plot

  • 5 June 2017
  • 8 replies

I have a scatter plot based on two dimensions. I’d like to highlight, in a different color, a single point of this plot, based on a filter. Is this possible?

8 replies

Userlevel 3

Hi @jgriffin,

Right now it’s not possible to conditionally color points on a scatter plot, but I’ll let our product team know that this is something you’re interested in!


Is there an update on this? I too would love to have this functionality easily accesible

Userlevel 7
Badge +1

There’s no one-click way to do this, but I can share something I’ve always done to achieve a similar effect, as pictured here:


Say you have a Name dimension and a Score measure, like I do here:

If you add 2 table calcs:

1: score_base

if(${ascent.name = "DNA",null,${ascent.score})

2: score_special

if(${ascent.name = "DNA",${ascent.score},null)

and hide the original score measure from the visualization, you’ll wind up with this:

Then if you switch to scatterplot and give each series a different color, you’ll highlight the points that match your if() statement. Don’t forget to turn off “Plot Null Values”.

It’s more work than a quick button (which would be super nifty), but it gets the job done! I bet it could be done with LookML too, if that floats your boat.

Ah got it. Have you tried to do this with a measure as the x-axis? Basically my data is in the same format, except instead of “Name” I have a sum measure. The scatterplot only allows me to plot “special_score” against in, not both columns. So I can only plot 2 of the 3 columns at a time.

Does that make sense? Or maybe I’m still not getting something.

Userlevel 7
Badge +1

Ah. I think this relates to the way that Looker generates scatterplots, which only allows for 1 measure x 1 measure when there isn’t a dimension involved. Which generally really makes sense, until you want to use more for a workaround like this. Guess I’ll move this over to the feature requests section after all 😄

FWIW, I bet vega-lite or vega, a custom visualization package, allows for something like this-- But that’s a step beyond even power-user territory. I’ll get this tracked for you internally.

Oh interesting, this seems to have a lot of great extended features. Who is this maintained by? Just want to make sure if I integrate it, the visualizations will be compatible with future Looker releases.

Userlevel 7
Badge +1

It’s not officially maintained by Looker in any capacity-- @ryan.grojean, who’s a sales engineer here, is the illustrious creator of the package, but it’s just an open source project so there is no guarantee that it’ll be compatible with future releases.

I’d wager our custom vis framework is only going to get better, though, and these kinds of custom visualizations primarily have external dependencies rather than Looker-linked ones, so it’s a fairly safe bet.

Hi Nathan, barring any drastic changes in Vega (which I don’t expect) I will continue to support and improve this viz library and ensure it works through Looker updates!