@@ -32,6 +32,8 @@ program demo_reverse
3232
3333 integer :: i
3434 type (Colormap) :: cmap, custom_cmap
35+ real (wp), dimension (2 ), parameter :: xmin = [0.0_wp , 0.0_wp ]
36+ real (wp), dimension (2 ), parameter :: xmax = [599.0_wp , 599.0_wp ]
3537
3638 ! > A discrete colormap with 8 levels, by @alozada, resembling the color
3739 ! > changes in red cabbage (containing Anthocyanins) with pH:
@@ -50,28 +52,28 @@ program demo_reverse
5052 ! Use the create() method instead of the set() method.
5153 call custom_cmap% create(' red_cabbage_reverse' , 0.0_wp , 2.0_wp , my_colormap, reverse= .true. )
5254 call custom_cmap% colorbar(' red_cabbage_reverse_colorbar' )
53- call custom_cmap% colormap(' red_cabbage_reverse_test' , zfun, [ 0.0_wp , 0.0_wp ], [ 599.0_wp , 599.0_wp ] )
55+ call custom_cmap% colormap(' red_cabbage_reverse_test' , zfun, xmin, xmax )
5456
5557 ! We create PPM files (binary encoded by default) for each built-in colormap.
5658 ! The built-in z=f(x,y) test function is in the [0, 2] range:
5759 do i = 1 , cmap_info% get_ncolormaps()
5860 call cmap% set(trim (cmap_info% get_name(i)), 0.0_wp , 2.0_wp , reverse= .true. )
5961 call cmap% colorbar(trim (cmap_info% get_name(i))// ' _reverse_colorbar' )
60- call cmap% colormap(trim (cmap_info% get_name(i))// ' _reverse_test' , zfun, [ 0.0_wp , 0.0_wp ], [ 599.0_wp , 599.0_wp ] )
62+ call cmap% colormap(trim (cmap_info% get_name(i))// ' _reverse_test' , zfun, xmin, xmax )
6163 print ' ("Colormap ", A30, " has ", I0, " levels")' , trim (cmap% get_name()), cmap% get_levels()
6264 end do
6365
6466 ! Cubehelix can also accept other parameters (varargs array):
6567 call cmap% set(" cubehelix" , 0.0_wp , 2.0_wp , 1024 , [0.5_wp , - 1.0_wp , 1.0_wp , 1.0_wp ], reverse= .true. )
6668 ! We change the name for the output test files:
6769 call cmap% colorbar(' cubehelix_customized_reverse_colorbar' )
68- call cmap% colormap(' cubehelix_customized_reverse_test' , zfun, [ 0.0_wp , 0.0_wp ], [ 599.0_wp , 599.0_wp ] )
70+ call cmap% colormap(' cubehelix_customized_reverse_test' , zfun, xmin, xmax )
6971
7072 ! > You can also download your colormap from a .txt file by
7173 ! > using the load() method instead of the set() method.
7274 call custom_cmap% load(" test_map_to_load.txt" , 0.0_wp , 2.0_wp , reverse= .true. )
7375 call custom_cmap% colorbar(' a_loaded_reverse_colorbar' )
74- call custom_cmap% colormap(' a_loaded_reverse_colormap_test' , zfun, [ 0.0_wp , 0.0_wp ], [ 599.0_wp , 599.0_wp ] )
76+ call custom_cmap% colormap(' a_loaded_reverse_colormap_test' , zfun, xmin, xmax )
7577 call custom_cmap% print ()
7678
7779contains
0 commit comments