good first issue
描述
Hello,
on several occasions already I needed to plot two objects (eg. dots and a line) in the same color. I would like to avoid specifying the color explicitly but rather use the builtin palette to be robust against possible future changes.
I've checked the plot/package.scala and the plot/PaintScale.scala implementation to find a way, but I do not see anything like this implemented. Do you have any idea?
My next try would have been to explicitly pass the palette PaintScale.Category10 to plot, but it only accepts colorcode: String. A conversion function, the inverse of PaintScale.convertToColor doesn't exist. Do you know a work-around?
Alternatively, would you be interested in a PR for either one of those:
- a new argument to
plot, namelycolor: java.awt.Colorto use it like this:color=PaintScale.Category10(1)to get the same color as the second plot - an inverse conversion function (might be hard to maintain)
- a new magic string to pass to
colorcode, indicating to take the same color as plot number x, e.g.colorcode="plot1"to use the same color as the second plot.
Cheers!