Makie.jl icon indicating copy to clipboard operation
Makie.jl copied to clipboard

Convenience function for 3D barplots

Open Datseris opened this issue 5 years ago • 4 comments

Would be nice to have a syntax like:

bar3D(x, y, z, dx, dy, dz, color = c)

where all above entries could be vectors.

It would be a simpler wrapper of the following:

meshscatter(vec(Point3f0.(rand(100), rand(100), 0.0)),
markersize=Vec3f0.(0.1, 0.1, rand(100)), marker=Rect3D(Vec3f0(0), Vec3f0(1)),
limits=Rect3D(Vec3f0(0), Vec3f0(1)))

which might be a bit too verbose for the highest level access (and a beginner may not really understand the markersize, marker, limits reason).

Datseris avatar Jun 10 '20 23:06 Datseris

it would be nice to have this to match PyPlot: https://github.com/gojakuch/JetReconstruction.jl/blob/4a059db293b7731470f795de3224888692995c49/src/JetVis.jl#L27

image

Moelf avatar Jul 26 '22 03:07 Moelf

I mean you could put that into a convert for meshscatter...something like:

convert_arguments(::Type{MeshScatter}, x::{<: Vector{<: Real}}, y::{<: Vector{<: Real}}, z::{<: Vector{<: Real}}, dx::{<: Vector{<: Real}}, dy::{<: Vector{<: Real}}, dz::{<: Vector{<: Real}}) = PlotSpec{MeshScatter}(Point3f.(x, y, z); markersize = Vec3f.(dx, dy, dz))

or just as an extension of the barplot recipe to 3d for ease of access.

asinghvi17 avatar Jul 26 '22 04:07 asinghvi17

I just realized for me the road blocker is:

  1. CairoMakie 3D is completely broken
  2. GLMakie doesn't work on Linux with AMD or Intel
  3. WebGL is broken with Axis3: https://github.com/JuliaPlots/Makie.jl/issues/2182

Moelf avatar Jul 26 '22 04:07 Moelf

I think:

  1. CairoMakie draws Meshscatter markers differently (needs fixing)
  2. Boy I wish we could just fix that... I did think though, that most people got it running with this hack: https://github.com/JuliaGL/GLFW.jl/issues/198#issuecomment-1188921471= ?
  3. This actually seems to be a specific problem with Meshscatter + Axis3 (not WGLMakie specific)...

I guess, not a lot of people have used Meshscatter productively in the last years😅

SimonDanisch avatar Jul 26 '22 09:07 SimonDanisch