How to fix the color scale from 0 to 1 in ternary diagrams using create_ternary_contour

Hi, I’m working with ternary diagrams using the figure_creator library and the create_ternary_contour function. My issue is that the color scale automatically adjusts to the range of my data (from the minimum to the maximum value). However, I need the color scale to remain fixed between 0 and 1, regardless of the data range.

I’ve tried looking into the function’s configuration options but couldn’t find a way to set this fixed range for the color scale.

from figure_creator import create_ternary_contour

# Example data
a = [0.2, 0.5, 0.8]
b = [0.3, 0.4, 0.3]
c = [0.5, 0.1, 0.9]
values = [0.2, 0.5, 0.8]  # Values mapped to the color scale

# Create the ternary diagram
fig = create_ternary_contour(
    a=a,
    b=b,
    c=c,
    values=values,
    colorbar_title="My Color Scale"
)

# Display the diagram
fig.show()

In this example, the color scale adjusts to the range of values (from 0.2 to 0.8). I need the color scale to always range from 0 to 1.

What I need:

  • How can I configure the color scale to always be fixed between 0 and 1?
  • If there are specific options in create_ternary_contour or any other function, I’d appreciate any guidance.

Additional details:
I’m using Python 3.9 and the latest version of figure_creator.

Thank you in advance for your help!

Somethin can help me? some idea?