extract Program

Uses

  • program~~extract~~UsesGraph program~extract extract module~forcolormap forcolormap program~extract->module~forcolormap module~colormap_parameters colormap_parameters module~forcolormap->module~colormap_parameters module~matplotlib_colormaps matplotlib_colormaps module~forcolormap->module~matplotlib_colormaps module~miscellaneous_colormaps miscellaneous_colormaps module~forcolormap->module~miscellaneous_colormaps module~scientific_colour_maps scientific_colour_maps module~forcolormap->module~scientific_colour_maps iso_fortran_env iso_fortran_env module~colormap_parameters->iso_fortran_env module~matplotlib_colormaps->module~colormap_parameters module~miscellaneous_colormaps->module~colormap_parameters module~scientific_colour_maps->module~colormap_parameters

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.


Calls

program~~extract~~CallsGraph program~extract extract proc~extract Colormap%extract program~extract->proc~extract proc~set Colormap%set program~extract->proc~set proc~write_ppm_colorbar Colormap%write_ppm_colorbar program~extract->proc~write_ppm_colorbar proc~create Colormap%create proc~extract->proc~create proc~reverse Colormap%reverse proc~extract->proc~reverse proc~scale_real_int scale_real_int proc~extract->proc~scale_real_int proc~check Colormap%check proc~set->proc~check proc~set->proc~create proc~cubehelix_colormap cubehelix_colormap proc~set->proc~cubehelix_colormap proc~fire_colormap fire_colormap proc~set->proc~fire_colormap proc~inv_rainbow_colormap inv_rainbow_colormap proc~set->proc~inv_rainbow_colormap proc~rainbow_colormap rainbow_colormap proc~set->proc~rainbow_colormap proc~set->proc~reverse proc~zebra_colormap zebra_colormap proc~set->proc~zebra_colormap export_pnm export_pnm proc~write_ppm_colorbar->export_pnm get_format get_format proc~write_ppm_colorbar->get_format proc~compute_rgb Colormap%compute_RGB proc~write_ppm_colorbar->proc~compute_rgb proc~get_zmax Colormap%get_zmax proc~write_ppm_colorbar->proc~get_zmax proc~get_zmin Colormap%get_zmin proc~write_ppm_colorbar->proc~get_zmin set_format set_format proc~write_ppm_colorbar->set_format set_pnm set_pnm proc~write_ppm_colorbar->set_pnm proc~get_levels~2 Colormaps_info%get_levels proc~check->proc~get_levels~2 proc~get_name~2 Colormaps_info%get_name proc~check->proc~get_name~2 proc~get_ncolormaps Colormaps_info%get_ncolormaps proc~check->proc~get_ncolormaps proc~set_all Colormaps_info%set_all proc~check->proc~set_all proc~get_rgb Colormap%get_RGB proc~compute_rgb->proc~get_rgb proc~create->proc~check proc~create->proc~reverse proc~scale_real_real scale_real_real proc~scale_real_int->proc~scale_real_real proc~set_info table%set_info proc~set_all->proc~set_info

Variables

Type Attributes Name Initial
type(Colormap) :: cmap

Source Code

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