This example demonstrates creating a custom colormap using methods like create_lagrange() and create_bezier().
Type | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|
integer | :: | colors(3,3) | ||||
type(Colormap) | :: | custom_cmap |
program create use forcolormap, only: Colormap, wp implicit none type(Colormap) :: custom_cmap integer :: colors(3,3) ! Define control colors for the colormap. colors(1,:) = [255, 0, 0] ! Red colors(2,:) = [0, 255, 0] ! Green colors(3,:) = [0, 0, 255] ! Blue ! Create a custom colormap using Lagrange interpolation. call custom_cmap%create_lagrange('custom_lagrange', 0.0_wp, 2.0_wp, colors, 1024) call custom_cmap%colorbar('custom_colorbar_lagrange') print *, "See the custom_colorbar_lagrange.ppm colorbar" ! Create a custom colormap using Bezier interpolation. call custom_cmap%create_bezier('custom_bezier', 0.0_wp, 2.0_wp, colors, 1024) call custom_cmap%colorbar('custom_colorbar_bezier') print *, "See the custom_colorbar_bezier.ppm colorbar" end program create