Scalarbar commands#

NaxToView functions to set the legend parameters for a visualization scene.

n2vscripting.scalarbar.set_legend(legend_type: str, position: Literal['Right', 'Left', 'Middle'] = 'Right', num_colors: int = 12, labels_color: str = '#FF0A0707', background_border: bool = False, legend_colors: tuple[str] = ('#FF0000FF', '#FF0049FF', '#FF00D2FF', '#FF00FFF9', '#FF00FF92', '#FF00FF14', '#FF14FF00', '#FF91FF00', '#FFF9FF00', '#FFFFD300', '#FFFF4A00', '#FFFF0000'), labels_font: Literal['Arial', 'Courier', 'Times'] = 'Arial', labels_bold: bool = False, labels_size: int = 12, labels_num_digits: int = 4, labels_num_format: Literal['Scientific', 'Fixed'] = 'Fixed', set_min_range: bool = False, min_range_value: float = 0.0, set_max_range: bool = False, max_range_value: float = 0.0, reverse_legend: bool = False, upper_text_font: Literal['Arial', 'Courier', 'Times'] = 'Arial', upper_text_size: int = 12, upper_text_bold: bool = False, lower_text_font: Literal['Arial', 'Courier', 'Times'] = 'Arial', lower_text_size: int = 12, lower_text_bold: bool = False)#

Configure and set the legend parameters for a visualization scene.

Parameters:
  • legend_type (str) – The type of legend to set. Options are ‘Scalar’, ‘Vector’, or ‘Tensor’.

  • position (str, optional) – The position of the legend in the scene. Default is ‘Right’. Other options are ‘Left’ and ‘Middle’.

  • num_colors (int, optional) – The number of colors to display in the legend. Default is 12.

  • labels_color (str, optional) – The color of the labels in hexadecimal format. Default is “#FF0A0707”.

  • background_border (bool, optional) – Whether to display a border around the legend background. Default is False.

  • legend_colors (tuple[str], optional) – A tuple of hexadecimal color codes for the legend.

  • labels_font (str, optional) – The font used for the legend labels. Default is ‘Arial’.

  • labels_bold (bool, optional) – Whether the legend labels should be bold. Default is False.

  • labels_size (int, optional) – The font size of the legend labels. Default is 12.

  • labels_num_digits (int, optional) – The number of digits to display for numeric labels. Default is 4.

  • labels_num_format (str, optional) – The numeric format for labels (‘Fixed’ or ‘Scientific’). Default is ‘Fixed’.

  • set_min_range (bool, optional) – Whether to set a minimum range for the legend. Default is False.

  • min_range_value (float, optional) – The minimum range value for the legend. Default is 0.0.

  • set_max_range (bool, optional) – Whether to set a maximum range for the legend. Default is False.

  • max_range_value (float, optional) – The maximum range value for the legend. Default is 0.0.

  • reverse_legend (bool, optional) – Whether to reverse the order of the legend colors. Default is False.

  • upper_text_font (str, optional) – The font used for the upper text in the legend. Default is ‘Arial’.

  • upper_text_size (int, optional) – The font size of the upper text in the legend. Default is 12.

  • upper_text_bold (bool, optional) – Whether the upper text in the legend should be bold. Default is False.

  • lower_text_font (str, optional) – The font used for the lower text in the legend. Default is ‘Arial’.

  • lower_text_size (int, optional) – The font size of the lower text in the legend. Default is 12.

  • lower_text_bold (bool, optional) – Whether the lower text in the legend should be bold. Default is False.