How do you maintain the aspect ratio (shape) of markers in sub-plots using Makie/MakieLayout? e.g.
using MakieLayout
using Makie
scene = Scene(resolution = (1200, 900), camera=campixel!)
layout = GridLayout(
scene, 2, 2,
colsizes = [Relative(0.75), Relative(0.25)],
rowsizes = [Relative(0.5), Relative(0.5)],
alignmode = Outside(30, 30, 30, 30))
layout[1,1] = ax = LAxis(scene)
lines!(ax, [0.0, 1.0], [0.0, 1.0], scale_plot = true)
scatter!(ax, rand(4), rand(4), markersize = .1)
display(scene)
The markers are squashed … scale_plot has no effect on this.
I want to draw a scatterplot in which the x-axis goes from 0 to 1000 and the y-axis goes from 0 to 1. In a Makie scene it works as expected - the markers are circular - but in a MakieLayout LAxis() they are thin vertical lines.
There was a bug in AbstractPlotting.jl that caused the issue. Made a report few days ago. Try to update your packages. Seems OK in my test.
I upgraded all packages & tried it again … the markers are still squashed.
Try to add this line.
using AbstractPlotting: px
and change this line
scatter!(ax, rand(4), rand(4), markersize=10px)
You might also need to get latest branch, i.e. ] add AbstractPlotting#use-vertical-dims-from-font
and ] add CairoMakie v0.2.0 #jk/scale_text
.
It works! Thank you so much.
We’ve made some new releases, so you should have all the same functionality on the latest tagged versions (AbstractPlotting@0.10.7, CairoMakie@0.2.3).
The text from text!(scene, ...)
is squashed, if axis is set sufficiently large, i.e. more than 1.0, e.g. ylims!(scene, 0.0, 50.0)
. Already on latest version of AbstractPlotting v0.10.11 and CairoMakie v0.2.6.
1 Like
I have a squashed text issue also - did you resolve this Humphrey?