Quartz.Plot2D (Quartz v0.8.1)

View Source

The module responsible for drawing and customizing 2D plots.

Summary

Functions

Add bottom axis. Bottom axes are added below the axes already present.

Add left axis. Left axes are added to the left of the axes already present.

Add right axis. Right axes are added to the left of the axes already present.

Add a new item to the label. The item is identified by a symbol and a label.

Add top axis. Top axes are added below the axes already present.

Draw a distribution using a kernel density estimate.

Draw a series of line segments between the given points.

Draw a scatter plot for the given points.

Set the bounds of a plot. If the bounds are not set, by default the plot will occupy the total space given to the figure.

Set the style of the tick labels.

Types

t()

@type t() :: %Quartz.Plot2D{
  axes: term(),
  bottom: term(),
  bottom_content: term(),
  bottom_content_padding: term(),
  bottom_decorations_area: term(),
  bottom_left_decorations_area: term(),
  bottom_margin: term(),
  bottom_right_decorations_area: term(),
  bounds_set: term(),
  categorical_color_index: term(),
  categorical_color_map: term(),
  current_bottom_bound: term(),
  current_left_bound: term(),
  current_right_bound: term(),
  current_top_bound: term(),
  data_area: term(),
  has_legend: term(),
  id: term(),
  left: term(),
  left_content: term(),
  left_content_padding: term(),
  left_decorations_area: term(),
  left_margin: term(),
  legend_background: term(),
  legend_background_color: term(),
  legend_background_opacity: term(),
  legend_background_stroke_dash: term(),
  legend_background_stroke_paint: term(),
  legend_background_stroke_thickness: term(),
  legend_items: term(),
  legend_location: term(),
  padding_bottom: term(),
  padding_left: term(),
  padding_right: term(),
  padding_top: term(),
  plot_area: term(),
  right: term(),
  right_content: term(),
  right_content_padding: term(),
  right_decorations_area: term(),
  right_margin: term(),
  title: term(),
  title_alignment: term(),
  title_area: term(),
  title_inner_padding: term(),
  title_location: term(),
  top: term(),
  top_content: term(),
  top_content_padding: term(),
  top_decorations_area: term(),
  top_left_decorations_area: term(),
  top_margin: term(),
  top_right_decorations_area: term(),
  width_to_aspect_ratio: term()
}

Functions

add_bottom_axis(plot, name, opts \\ [])

Add bottom axis. Bottom axes are added below the axes already present.

add_left_axis(plot, name, opts \\ [])

Add left axis. Left axes are added to the left of the axes already present.

add_right_axis(plot, name, opts \\ [])

Add right axis. Right axes are added to the left of the axes already present.

add_to_legend(plot, symbol, label)

Add a new item to the label. The item is identified by a symbol and a label.

add_top_axis(plot, name, opts \\ [])

Add top axis. Top axes are added below the axes already present.

align_bbox(elements, fun)

@spec align_bbox([any()], (any() -> any())) :: :ok

align_bottom(elements)

@spec align_bottom([any()]) :: :ok

align_left(elements)

@spec align_left([any()]) :: :ok

align_right(elements)

@spec align_right([any()]) :: :ok

align_top(elements)

@spec align_top([any()]) :: :ok

box_plot(plot, groups, opts \\ [])

default_bin_width_for_histogram(series)

@spec default_bin_width_for_histogram(%Explorer.Series{
  data: term(),
  dtype: term(),
  name: term(),
  remote: term()
}) :: number()

draw_bottom_content(plot, padding)

draw_function_contour_plot(plot, fun, x_min, x_max, y_min, y_max, countour_levels, opts \\ [])

Draw a series of line segments between the given points.

draw_histogram(plot, data, opts \\ [])

draw_kde_plot(plot, values, opts \\ [])

Draw a distribution using a kernel density estimate.

draw_kde_plot_groups_from_dataframe(plot, dataframe, group_column, values_column, opts \\ [])

Draw a distribution using a kernel density estimate.

draw_left_content(plot, padding)

draw_line_plot(plot, data_x, data_y, opts \\ [])

Draw a series of line segments between the given points.

draw_right_content(plot, padding)

draw_scatter_plot(plot, data_x, data_y, opts \\ [])

Draw a scatter plot for the given points.

draw_text(plot, text, opts \\ [])

@spec draw_text(t(), Quartz.Text.text(), Keyword.t()) :: t()

draw_top_content(plot, padding)

fetch_axis(plot, name)

@spec fetch_axis(Plot2D.t(), binary()) :: {:ok, Quartz.Axis2D.t()} | :error
@spec fetch_axis(Plot2D.t(), binary()) :: Quartz.Axis2D.t()

fetch_axis!(plot, name)

finalize(plot)

@spec finalize(t()) :: t()

finalize_all(plots)

@spec finalize_all([t()] | [[t()]]) :: [t()]

get_axis(plot, name)

@spec get_axis(Plot2D.t(), binary()) :: Quartz.Axis2D.t() | nil

maybe_add_color_to_opts_from_colormap(plot, opts)

new(opts \\ [])

no_legend(plot)

put_axes_margins(plot, value, opts \\ [])

put_axis_label(plot, axis_name, text, opts \\ [])

@spec put_axis_label(t(), binary(), Quartz.Text.text(), number()) :: t()

put_axis_limits(plot, axis_name, min_value, max_value)

@spec put_axis_limits(t(), binary(), number(), number()) :: t()

put_axis_major_tick_labels(plot, axis_name, labels)

@spec put_axis_major_tick_labels(t(), binary(), [binary()]) :: t()

put_axis_major_tick_locations(plot, axis_name, locations)

@spec put_axis_major_tick_locations(t(), binary(), [number()]) :: t()

put_axis_max_value(plot, axis_name, value)

@spec put_axis_max_value(t(), binary(), number()) :: t()

put_axis_min_value(plot, axis_name, value)

@spec put_axis_min_value(t(), binary(), number()) :: t()

put_axis_scale(plot, axis_name, scale)

@spec put_axis_scale(t(), binary(), Quartz.Scale.scale()) :: t()

put_bounds(plot, bounds)

Set the bounds of a plot. If the bounds are not set, by default the plot will occupy the total space given to the figure.

Expects bounds given as a keyword list or as a map.

put_legend_location(plot, location)

Put legend location.

Valid locations:

  • :top
  • :top_right
  • :right
  • :bottom_right
  • :bottom
  • :bottom_left
  • :left

put_legend_style(plot, attributes)

put_major_tick_labels_style(plot, axes_name, style)

Set the style of the tick labels.

put_minimum_axis_end_margin(plot, axis_name, value)

put_minimum_axis_margins(plot, axis_name, common_margin_size)

put_minimum_axis_margins(plot, axis_name, margin_start, margin_end)

put_minimum_axis_start_margin(plot, axis_name, value)

put_title(plot, title, opts \\ [])

put_width_to_height_ratio(plot, ratio)

@spec put_width_to_height_ratio(t(), number()) :: t()

remove_axis_ticks(plot, axis_name)

@spec remove_axis_ticks(t(), binary()) :: t()

stack_horizontally_inside_container(elements, container)

@spec stack_horizontally_inside_container([any()], any()) :: :ok

stack_vertically_inside_container(elements, container)

@spec stack_vertically_inside_container([any()], any()) :: :ok

update_axes(plot, axis_names, fun)

update_axis(plot, axis_name, fun)