This example demonstrates the process of extracting a specified number of colors. The variable 'extractedLevels' represents the number of colors to be extracted from the colormap.
Type | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|
type(Colormap) | :: | cmap |
program extract use forcolormap, only: Colormap, wp implicit none type(Colormap) :: cmap ! Initialize the colormap call cmap%set('fes', 0.0_wp, 2.0_wp) ! Extract 10 colors from the colormap (extractedLevels=10) ! Optional arguments: 'name', 'zmin', 'zmax', and 'reverse' can be provided ! The extracted colormap will overwrite the existing colormap type (cmap) call cmap%extract(10) ! Generate a color bar for the extracted colormap call cmap%colorbar('fes10_ex_colorbar') end program extract