plotSetLegendFont

Purpose

Controls the legend font name, size and color.

Format

plotSetLegendFont(&myPlot, font[, font_size[, font_color]])
Parameters:
  • &myPlot (struct pointer) – A plotControl structure pointer

  • font (string) – font or font family name.

  • font_size (scalar) – Optional argument, font size in points.

  • font_color (string) – Optional argument, named color or RGB value.

Examples

new;
cls;

// Declare plotControl structure
struct plotControl myPlot;

// Initialize plotControl structure
myPlot = plotGetDefaults("scatter");

// Set labels, location, and orientation of legend
label = "sample A"$|"sample B";
location = "top right";
orientation = 0;
plotSetLegend(&myPlot, label, location, orientation);

// Set font of legend
plotSetLegendFont(&myPlot, "arial", 18, "dark grey");

// Create data
x = rndn(30, 2);
y = rndn(30, 2);

// Plot the data with the legend settings
plotScatter(myplot, x, y);

See also

Functions plotSetLegend(), plotSetLegendBkd()