mlegend

../../_images/MLEGEND.png

This is the visual definition responsible for specifying how a plot’s legend is displayed. It controls features such as the legend’s position, style and fonts.

Note

This function performs the same task as the Legend icon in Metview’s user interface. It accepts its parameters as keyword arguments, described below.

mlegend(**kwargs)

Defines the plot legend.

Parameters
  • legend_text_colour (str, default: "navy") – Legend text colour.

  • legend_title ({"on", "off"}, default: "off") – Enables to plot legend title text.

  • legend_title_text (str, default: "legend") – Text to be plotted as legend title.

  • legend_title_orientation ({"vertical", "horizontal", "automatic"}, default: "automatic") – Orientation of the legend title. If “automatic” the title will be horizontal for horizontal legends and vertical for vertical ones.

  • legend_title_font_size (number, default: -1) – Font size used for the title. The default is the same as legend_text_font_size.

  • legend_title_font_colour (str, default: "automatic") – Font colour used for the title. The default is the same as legend_text_font_colour.

  • legend_title_position ({"automatic", "top", "bottom", "left", "right"}, default: "automatic") – Relative title position.

  • legend_title_position_ratio (number, default: 25) – Percentage of the legend box used for the title.

  • legend_units_text (str) – Text to plot as units.

  • legend_user_minimum ({"on", "off"}, default: "off") – Use of user tailored text for minimum.

  • legend_user_minimum_text (str) – User tailored text for minimum.

  • legend_user_maximum ({"on", "off"}, default: "off") – Use of user tailored text for maximum.

  • legend_user_maximum_text (str) – User tailored text for maximum.

  • legend_display_type ({"disjoint", "continuous", "histogram"}, default: "continuous") – Specifies the graphical type of the legend.

  • legend_text_format (str, default: "(automatic)") – Format of text.

  • legend_box_mode ({"automatic", "positional"}, default: "automatic") – Specifies if the legend box is positioned automatically or by the user.

  • legend_automatic_position ({"top", "right"}, default: "top") – Specifies if the legend box is positioned on the top or on the right of the drawing. area

  • legend_automatic_box_margin (number, default: 5) – Margin in % of the legend box [top/bottom] for vertical layout and [left/right] for horizontal layout.

  • legend_text_font ({"arial", "courier", "helvetica", "times", "serif", "sansserif", "symbol"}, default: "sansserif") – Font name.

  • legend_text_font_style ({"normal", "bold", "italic", "bolditalic"}, default: "normal") – Font style. Set this to an empty string in order to remove all styling.

  • legend_text_font_size (str, default: "0.2") – Font size, specified in cm or in %. E.g. 0.5cm or 10%.

  • legend_text_orientation (number, default: 0) – Orientation of the text. The default value (0) means horizontal orientation.

  • legend_text_composition ({"automatic_text_only", "user_text_only", "both"}, default: "automatic_text_only") – Determines whether to use automatically-generated or user-generated text (or both) in the legend.

  • legend_user_lines (str or list[str]) – List of text for legend entries.

  • legend_values_list (number or list[number]) – List of values to show in the legend.

  • legend_column_count (number, default: 1) – Number of columns in the legend.

  • legend_entry_plot_direction ({"automatic", "row", "column"}, default: "automatic") – Method of filling in legend entries.

  • legend_entry_plot_orientation ({"bottom_top", "top_bottom"}, default: "bottom_top") – Specifies if goes from bottom to top or from top to bottom in column mode.

  • legend_symbol_height_factor (number, default: 1) – Factor to apply to the symbol height in the legend.

  • legend_box_x_position (number, default: -1) – X coordinate of the lower left corner of the legend box (relative to page_x_position in the view containing the legend).

  • legend_box_y_position (number, default: -1) – Y coordinate of lower left corner of legend box (relative to page_y_position in the view containing the legend).

  • legend_box_x_length (number, default: -1) – Length of legend box in X direction.

  • legend_box_y_length (number, default: 0) – Length of legend box in Y direction.

  • legend_box_blanking ({"on", "off"}, default: "off") – Enables blanking of the legend box.

  • legend_border ({"on", "off"}, default: "off") – Plots border around legend box.

  • legend_border_line_style ({"solid", "dash", "dot", "chain_dot", "chain_dash"}, default: "solid") – Line style of border around the legend box.

  • legend_border_colour (str, default: "blue") – Colour of the border around the legend box.

  • legend_border_thickness (number, default: 1) – Thickness of the legend box border.

  • legend_entry_text_width (number, default: 60) – Width in percentage used for the text part of a legend entry.

  • legend_entry_border ({"on", "off"}, default: "on") – Adds a border to the graphical part of each legend entry.

  • legend_entry_border_colour (str, default: "black") – Border colour.

  • legend_label_frequency (number, default: 1) – Frequency of the labels.

  • legend_histogram_border ({"on", "off"}, default: "on") – Adds a border to the histogram bars.

  • legend_histogram_border_colour (str, default: "black") – Border colour of the histogram bars.

  • legend_histogram_mean_value ({"on", "off"}, default: "off") – Shows the mean value in the histogram.

  • legend_histogram_mean_value_marker (number, default: 15) – Index of the marker symbol representing the mean value in the histogram.

  • legend_histogram_mean_value_marker_colour (str, default: "black") – Colour of the mean value marker symbol in the histogram.

  • legend_histogram_mean_value_marker_size (number, default: 0.4) – Size of the mean value marker symbol in the histogram.

  • legend_histogram_max_value ({"on", "off"}, default: "on") – Shows the maximum value in the histogram.

  • legend_histogram_grid_colour (str, default: "black") – Colour of the histogram grid.

  • legend_histogram_grid_line_style ({"solid", "dash", "dot", "chain_dot", "chain_dash"}, default: "solid") – Line style of the histogram grid.

  • legend_histogram_grid_thickness (number, default: 1) – Thickness of the histogram grid.

Return type

Request