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 section Functions
axis_labels(plot, x_label, y_label)
View Sourceaxis_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.
new(width, height, plot_content)
View Sourcenew(integer(), integer(), Contex.PlotContent.t()) :: Contex.Plot.t()
Creates a new plot with specified plot content.
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.
size(plot, width, height)
View Sourcesize(Contex.Plot.t(), integer(), integer()) :: Contex.Plot.t()
Updates the size for the plot
titles(plot, title, subtitle)
View Sourcetitles(Contex.Plot.t(), plot_text(), plot_text()) :: Contex.Plot.t()
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.