HC:   Two dimensional color cluster plot section ------------------------------------------------ .. _basic-style-6: Basic style ~~~~~~~~~~~ HC: section specifes a two-dimensional color cluster plot. A color cluster plot is a plot that fills the area of each mesh with a color proportional to its height from the two-dimensional data given to the two-dimensional equally spaced mesh. The basic style is exactly the same as the H2: section. A color cluster plot of the same data as the contour example gives: .. rubric:: List 2.19 • Two-dimensional color cluster plot, example 1 :name: list-2-19 :class: angel-list-caption .. code-block:: text 1: HC: Y = 3.0 TO -3.0 BY -1.0 ; X = -3.0 TO 3.0 BY 1.0 ; 2: 0 0 0 0 0 0 0 3: 0 8 0 2 4 0 0 4: 0 0 1 5 6 2 0 5: 0 2 4 14 15 9 0 6: 0 2 5 23 32 12 0 7: 0 0 3 10 16 8 0 8: 0 0 0 0 0 0 0 .. figure:: assets/fig212.png :name: fig-ref-2-15 :width: 297.5pt :align: center :class: responsive-figure Two-dimensional color cluster plot, example 1 The order of X, Y, maximum value, and minimum value of HD: row is specified as follows in the same way as H2: section in how to read data. :: H2: Y = 3.0 TO -3.0 BY -1.0 ; X = -3.0 TO 3.0 BY 1.0 ; This expression comes from the Fortran expression as, :: READ(*,*) ( ( DATA(IX,IY), IX = 1,7,1 ), IY = 7,1,-1 ) | The basic style is .. container:: minipage angel-doublebox ``H2:`` { ``Y`` :math:`|` ``X`` } ``=`` :math:`r_1` ``TO`` :math:`r_2` ``BY`` :math:`r_3` ``;`` { ``X`` :math:`|` ``Y`` } ``=`` :math:`r_4` ``TO`` :math:`r_5` ``BY`` :math:`r_6` ``;`` | If you want to exchange X axis and Y axis, the order of reading data has to be exchanged. (In the above Fortran expression, the ordering of ``IX, IY`` is exchanged.) The ";" of the end of X axis part and Y axis part is always necessary. The number of the numerical data in a line is free as far as the data sequence is satisfied following the above expression. Parameters for the color cluster plot ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The choice of colors can be changed in the parameter section P:. .. container:: center .. table:: Parameters for the color cluster plot :name: tbl-ANGELparameter3 +------------------------------+----------------------------------------------------------------------------------------------------------------+ | parameters |       explanation | +==============================+================================================================================================================+ | ``ZLIN`` | .. container:: minipage | | | | | | The color of the cluster is determined proportional to the height of the data in a linear scale. (default). | +------------------------------+----------------------------------------------------------------------------------------------------------------+ | ``ZLOG`` | .. container:: minipage | | | | | | The color of the cluster is determined proportional to the height of the data in a logarithmic scale. | +------------------------------+----------------------------------------------------------------------------------------------------------------+ | ``DMAX(`` :math:`dmax` ``)`` | .. container:: minipage | | | | | | Set :math:`dmax` as the maximum value, neglect the data which values are greater than :math:`dmax`. | +------------------------------+----------------------------------------------------------------------------------------------------------------+ | ``DMIN(`` :math:`dmin` ``)`` | .. container:: minipage | | | | | | Set :math:`dmin` as the minimum value, neglect the data which values are smaller than :math:`dmin`. | +------------------------------+----------------------------------------------------------------------------------------------------------------+ | ``CMAX(`` :math:`cmax` ``)`` | Display the data which value is greater than :math:`cmax` in color of the :math:`cmax`. | +------------------------------+----------------------------------------------------------------------------------------------------------------+ | ``CMIN(`` :math:`cmin` ``)`` | Display the data which value is smaller than :math:`cmin` in color of the :math:`cmin`. | +------------------------------+----------------------------------------------------------------------------------------------------------------+ | ``SMAX(`` :math:`c` ``)`` | Specify the maximum and minimum color | +------------------------------+----------------------------------------------------------------------------------------------------------------+ | ``SMIN(`` :math:`c` ``)`` | The default are red(R) and blue(B). | +------------------------------+----------------------------------------------------------------------------------------------------------------+ | ``IPDC`` | Automatically interpolate by halving the mesh spacing. | +------------------------------+----------------------------------------------------------------------------------------------------------------+ .. table:: Special parameter +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | **parameter** | **Explanation** | +===============+==========================================================================================================================================================================+ | ``cmap`` | Specification of Colormap Name | | | Example: ``angel = cmap(phits2)`` | | | The available colormap names are :literal:`\`phits2'` and those used in Matplotlib [3]_. By adding :literal:`\`_r'` to the colormap name, the color bar can be inverted. | | | Example: ``angel = cmap(hot_r)`` | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ``ndis`` | Usage of discrete color bars and specification of the number of colors. | | | Example: ``angel = ndis(15)`` | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ An example of interpolating by adding ``IPDC`` to the above example is shown below. .. rubric:: List 2.20 • Two-dimensional color cluster plot, example 2 :name: list-2-20 :class: angel-list-caption .. code-block:: text 1: P: IPDC 2: HC: Y = 3.0 TO -3.0 BY -1.0 ; X = -3.0 TO 3.0 BY 1.0 ; 3: 0 0 0 0 0 0 0 4: 0 8 0 2 4 0 0 5: 0 0 1 5 6 2 0 6: 0 2 4 14 15 9 0 7: 0 2 5 23 32 12 0 8: 0 0 3 10 16 8 0 9: 0 0 0 0 0 0 0 .. figure:: assets/fig213.png :name: fig-ref-2-16 :width: 297.5pt :align: center :class: responsive-figure Two-dimensional color cluster plot, example 2 Important point for the plot with ZLOG ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When handling data logarithmically, the default minimal is set as :math:`1 \times 10^{-41}`. From this reason, the zero area cannot be displayed in default setting. If you want to display the zero area in logarithmic plot by blue, Please enter a smaller number than :math:`1\times 10^{-41}`, such as ``DMIN(1.0E-42)``. .. [3] | J. D. Hunter, "Matplotlib: A 2D Graphics Environment", Computing in Science & Engineering, vol. 9, no. 3, pp. 90-95, 2007. | Colormap: https://matplotlib.org/stable/users/explain/colors/colormaps.html | License: https://matplotlib.org/stable/project/license.html | The license is also directly stated in ``a-main1.f``.