From e4e4538622afff79c0dcefae0bb952c9e610bb9c Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Mon, 29 Jan 2024 13:09:30 +0100 Subject: [PATCH] disallow x, y, z for barplot --- src/basic_recipes/barplot.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/basic_recipes/barplot.jl b/src/basic_recipes/barplot.jl index 9aba359429b..31fe1f95b85 100644 --- a/src/basic_recipes/barplot.jl +++ b/src/basic_recipes/barplot.jl @@ -238,7 +238,10 @@ function barplot_labels(xpositions, ypositions, bar_labels, in_y_direction, flip end function Makie.plot!(p::BarPlot) - + bar_points = p[1] + if !(eltype(bar_points[]) <: Point2) + error("barplot only accepts x/y coordinates. Use `barplot(x, y)` or `barplot(xy::Vector{<:Point2})`.") + end labels = Observable(Tuple{Union{String,LaTeXStrings.LaTeXString}, Point2f}[]) label_aligns = Observable(Vec2f[]) label_offsets = Observable(Vec2f[])