create Program

Uses

  • program~~create~~UsesGraph program~create create module~forcolormap forcolormap program~create->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 creating a custom colormap using methods like create_lagrange() and create_bezier().


Calls

program~~create~~CallsGraph program~create create proc~create_bezier Colormap%create_bezier program~create->proc~create_bezier proc~create_lagrange Colormap%create_lagrange program~create->proc~create_lagrange proc~write_ppm_colorbar Colormap%write_ppm_colorbar program~create->proc~write_ppm_colorbar proc~bezier bezier proc~create_bezier->proc~bezier proc~check Colormap%check proc~create_bezier->proc~check proc~reverse Colormap%reverse proc~create_bezier->proc~reverse proc~create_lagrange->proc~check proc~lagrange lagrange proc~create_lagrange->proc~lagrange proc~create_lagrange->proc~reverse 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~factorial factorial proc~bezier->proc~factorial 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~lagrange_poly lagrange_poly proc~lagrange->proc~lagrange_poly proc~set_info table%set_info proc~set_all->proc~set_info

Variables

Type Attributes Name Initial
integer :: colors(3,3)
type(Colormap) :: custom_cmap

Source Code

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