Packages

Contex - a server-side charting library for Elixir.

Current section

Files

Jump to
contex lib chart gallery point_plots_log_masked_linear.sample
Raw

lib/chart/gallery/point_plots_log_masked_linear.sample

data =
-200..200
|> Enum.map(fn v -> {v / 10.0, v / 10.0} end)
ds = Dataset.new(data, ["x", "y"])
options = [
mapping: %{x_col: "x", y_cols: ["y"]},
data_labels: true,
orientation: :vertical,
custom_y_scale:
ContinuousLogScale.new(domain: {-20, 20}, negative_numbers: :mask, linear_range: 1),
colour_palette: ["ff9838", "fdae53", "fbc26f", "fad48e", "fbe5af", "fff5d1"]
]
Plot.new(ds, PointPlot, 500, 400, options)
|> Plot.titles("A masked log scale", "With linear range")
|> Plot.axis_labels("x", "y")