Custom coloring function?

Hi!

I’m trying to plot a function f returning complex values using contour. f has a limited number of possibly returned values, which I’d like to plot with a unique color in the resulting contour plot. I thought I could maybe give Plots a custom function returning a color for each possible value returned by f, but I can’t seem to find how to do this in the documentation. I don’t think I can use color series or palettes, as the values returned by f are not continous (but at least there is a finite number of them).

At the moment I’m just plotting the phase of the complex values instead of the values themselves, but even then I can’t find a palette that shows the distinction between the values in a good way.

Am I missing something or is this not possible? Maybe I need a custom plotting recipe?

I’m using Plots, currently with the GR backend but I don’t mind swapping it out.

The function returns values like these:

5-element Vector{ComplexF64}:
  0.0 + 0.0im                
  0.0 - 1.0im                
 -1.0 + 0.0im                
  1.0 + 0.0im                
  0.0 + 1.0im                

or these:

13-element Vector{ComplexF64}:
  0.0 + 0.0im                 
  0.0 - 1.0im                 
 -1.0 + 0.0im                 
  0.0 + 1.0im                 
  1.0 + 0.0im                 
  1.0 - 1.0im                 
 -1.0 + 1.0im                 
  0.0 + 7.0im                 
  0.0 + 6.0im                 
  0.0 + 5.0im                 
  0.0 + 4.0im                 
  0.0 + 3.0im                 
  0.0 + 2.0im