More advanced scatter plots
Breeze-viz offers a
scatter function that adds a significant degree of customization to scatter plots. In particular, we can use the size and color of the marker points to add additional dimensions of information to the plot.
The scatter function takes, as its first two arguments, collections of x and y points. The third argument is a function mapping an integer i to a Double indicating the size of the ith point. The size of the point is measured in units of the x axis. If you have the sizes as a Scala collection or a Breeze vector, you can use that collection's apply method as the function. Let's see how this works in practice.
As with the previous examples, we will use the REPL, but you can find a sample program in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access