.. include:: ../../common/cookbook/cookbook-hyperlinks

.. include:: ../substitutions

.. oe:namespace:: OEGrapheme

.. oe:function:: OEDrawBFactorMapLegend

   .. oe:language:: c++ java csharp

      .. oe:api::

         bool OEDrawBFactorMapLegend(OEDepict::OEImageBase& image,
                                     const OE2DActiveSiteDisplay& adisp)

   .. oe:language:: python

      .. oe:api:: python

         OEDrawBFactorMapLegend(image: OEImageBase,
                                adisp: OE2DActiveSiteDisplay) -> bool

   Draws the color gradient that is used to visualize B-factor information of
   an active site by the :oe:func:`OEGrapheme::OERenderBFactorMap` function.

   *image*
      The image in which the color gradient is drawn.

   *adisp*
      The :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` object that holds the
      data necessary to depict the B-factor information of an active site.

   **Example:**

   .. oe:source:: RenderBFactorMap.py
      :language: python
      :noindent:
      :frag:     SNIPPET-DRAW-BFACTORMAP-LEGEND

   ..    oe:language:: python

         :ref:`Full listing. <listing-RenderBFactorMap.py>`

   .. oe:source:: RenderBFactorMap.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-DRAW-BFACTORMAP-LEGEND

   .. oe:source:: RenderBFactorMap.java
      :language: java
      :noindent:
      :frag:     SNIPPET-DRAW-BFACTORMAP-LEGEND

   .. oe:source:: RenderBFactorMap.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-DRAW-BFACTORMAP-LEGEND

   .. figure:: ../images/DrawBFactorMapLegend.*
      :align:  center
      :width: 300 pt

      **Example of using the OEDrawBFactorMapLegend function**

   .. seealso::

      * :oe:func:`OEGrapheme::OERenderBFactorMap` function
      * :oe:func:`OEGrapheme::OEDrawColorGradient` function

   .. admonition:: Code Example

      * `Visualizing Protein-Ligand B-Factor`_ **OpenEye Python Cookbook** recipe
