FreeFem / FreeFem-sources

FreeFEM source code
https://freefem.org/
Other
746 stars 188 forks source link

Extended colormaps in FreeFem plot #269

Open fagnelli opened 1 year ago

fagnelli commented 1 year ago

Hi,

Not really an issue, rather a suggestion for improvement.

Taking inspiration from the colormaps available in Matplotlib, I was able to generate an file named cmaps.idp containing the array of HSV values for several colormaps. Including cmaps.idp file in the main script enabled to render a variety 2D plots using the hsv argument, for example:

plot(XX, fill=1, hsv=viridis, value=1);

I am enclosing the some data file to check the rendering: test_vis.zip

I believe this feature could easily be added to FreeFem, by merely including the cmaps.idp to the idp directory.

Hoping this will be beneficial to others.

Filippo