.. # split from OEGraphemeFunctions.rst:884

.. include:: ../substitutions

.. oe:namespace:: OEGrapheme

.. meta::
   :keywords: OEDrawColorForceFieldLegend

.. oe:function:: OEDrawColorForceFieldLegend

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

      .. oe:api::

         void OEDrawColorForceFieldLegend(OEDepict::OEImageBase& image,
                                          const OEColorForceFieldDisplay& cffdisp,
                                          const OEColorForceFieldLegendDisplayOptions& opts)

   .. oe:language:: python

      .. oe:api:: python

         OEDrawColorForceFieldLegend(image: OEImageBase,
                                     cffdisp: OEColorForceFieldDisplay,
                                     opts: OEColorForceFieldLegendDisplayOptions) -> None

   Draws a legend of the color force field.

   *image*
     The image on which the color force field legend is drawn.

   *cffdisp*
     The :ref:`OEColorForceFieldDisplay <OEGrapheme_OEColorForceFieldDisplay>` object
     that holds the data necessary to depict the color force field.

   *opts*
     The :ref:`OEColorForceFieldLegendDisplayOptions <OEGrapheme_OEColorForceFieldLegendDisplayOptions>` object
     that determine how the legend of color force field is depicted.

   The following code snippet shows how to use the :oe:func:`OEGrapheme::OEDrawColorForceFieldLegend`
   function. The image created is shown in
   :ref:`Figure: Example of using the OEDrawColorForceFieldLegend function<figure_draw_color_force_field_legend>`.

   .. oe:source:: DrawColorForceFieldLegend.py
      :language: python
      :noindent:
      :frag:     SNIPPET-DRAW-COLOR-FORCE-FIELD-LEGEND

   ..    oe:language:: python

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


   .. oe:source:: DrawColorForceFieldLegend.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-DRAW-COLOR-FORCE-FIELD-LEGEND

   .. oe:source:: DrawColorForceFieldLegend.java
      :language: java
      :noindent:
      :frag:     SNIPPET-DRAW-COLOR-FORCE-FIELD-LEGEND

   .. oe:source:: DrawColorForceFieldLegend.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-DRAW-COLOR-FORCE-FIELD-LEGEND

   .. _figure_draw_color_force_field_legend:

   .. figure:: ../images/DrawColorForceFieldLegend.*
      :align:  center

      **Example of using the OEDrawColorForceFieldLegend function**

   .. seealso::

      * :ref:`OEColorForceFieldDisplay <OEGrapheme_OEColorForceFieldDisplay>` class
      * :ref:`OEColorForceFieldLegendDisplayOptions <OEGrapheme_OEColorForceFieldLegendDisplayOptions>` class

