ContEx v0.2.0 Contex.Plot View Source

Manages the layout of various plot elements, including titles, axis labels, legends etc and calculates appropriate margins depending on the options set.

Link to this section Summary

Functions

Sets the x-axis & y-axis labels for the plot. Empty string or nil will remove them.

Creates a new plot with specified plot content.

Updates options for the plot.

Updates the size for the plot

Sets the title and sub-title for the plot. Empty string or nil will remove the title or sub-title

Generates SVG output marked as safe for the configured plot.

Link to this section Types

Link to this type

plot_text()

View Source
plot_text() :: String.t() | nil

Link to this section Functions

Link to this function

axis_labels(plot, x_label, y_label)

View Source
axis_labels(Contex.Plot.t(), plot_text(), plot_text()) :: Contex.Plot.t()

Sets the x-axis & y-axis labels for the plot. Empty string or nil will remove them.

Creates a new plot with specified plot content.

Link to this function

plot_options(plot, new_plot_options)

View Source

Updates options for the plot.

TODO: There's quite a lot more work to do here. Currently the allowed plot options are :show_x_axis (boolean), :show_y_axis (boolean), and :legend_setting - one of :legend_none or :legend_right. These are currently passed as a map rather than keyword list.

Updates the size for the plot

Link to this function

titles(plot, title, subtitle)

View Source

Sets the title and sub-title for the plot. Empty string or nil will remove the title or sub-title

Generates SVG output marked as safe for the configured plot.