
Also how to generate the colors list from data3, I can’t find any example for doing such plot even though it’s very common for scientific publications.

can you share pictures of a colorbar & color list?
I don’t think these things are built in to plot. It might be easy enough to make them with pict
.

This is what I can do using matplotlib
with plt.scatter(eccs, mass_ratios, c=mismatches)
plt.xscale("log")
plt.colorbar()
plt.savefig("scatter.pdf")

Now I got to something with racket
but things were very hacky. The colormaps are obviously different.

I notice that @alexharsanyi has a blog post on custom legends: https://alex-hhh.github.io/2021/07/shaded-area-plot.html

Your racket version looks good. I wouldn’t be able to improve that much. A linear-gradient%
might help with the legend.

I have followed that blogpost to get to the plot I posted above.

Is there any plan to add such a feature in the plot package?

If it’s not on the issue tracker or a PR, then no. You should turn your code into a package.

I think a related issue is there https://github.com/racket/plot/issues/95