-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Found invalid x-limits
in heatmap
with xscale=log10
#4320
Comments
Ah, this is because Cell grids are defined by ys[3]|----------|----------|----------|----------|
| | | | |
| zs[1, 2] | zs[2, 2] | zs[3, 2] | zs[4, 2] |
ys[2]|----------|----------|----------|----------|
| | | | |
| zs[1, 1] | zs[2, 1] | zs[3, 1] | zs[4, 1] |
| | | | |
ys[1]|----------|----------|----------|----------|
xs[1] xs[2] xs[3] xs[4] xs[5] However, in your case, you've only provided vertex information, where In doing so, Makie goes to -4 in the x axis as the leftmost boundary of this cell grid. You have two options to solve this:
The code that does this is here: Lines 303 to 330 in 8617742
For additional intuition: consider Note that the x axis starts at 0.5, instead of the |
Or use a scaling function that extends to the negative side, such as C = [3.1, 17.6, 100.0]
eps = [0.01, 2.6, 5.4, 8.8]
M = [54.6823 44.1771 41.0193 51.0635
39.2212 32.7295 34.6756 48.9483
42.1372 34.1846 34.422 48.9483]
heatmap(C, eps, M, colormap=:berlin25, axis=(; xscale=Makie.pseudolog10)) |
A colleague of mine ran into this issue today in trying to plot data on a Is there appetite to do some checking for this case when generating an error message? Or at least be more verbose about what's going on, like:
Alternatively, could there be added support for a way to define the extremal cell boundaries manually? Same issue as: #2615 (comment) |
You can already do that. If you have a matrix of size You can construct them as follows: julia> Makie.edges(C)
4-element Vector{Float64}:
-4.150000000000001
10.350000000000001
58.8
141.2
julia> Makie.edges(eps)
5-element Vector{Float64}:
-1.285
1.305
4.0
7.1000000000000005
10.5
julia> Cedges = [1e-3, 10.35, 58.8, 141.2]
4-element Vector{Float64}:
0.001
10.35
58.8
141.2
julia> epsedges = [1e-3, 1.305, 4.0, 7.1, 10.5]
5-element Vector{Float64}:
0.001
1.305
4.0
7.1
10.5 maybe use |
This could only happen in the backend, but maybe a more intricate transform interface would help here. I'm out this weekend but will whip up a prototype next weekend since I want that for GeoMakie as well - then the transform would be the one throwing the error, and would have access to all necessary context. |
Thanks for the feedback! I like the explicit call to edges + clamp, so might do that for the time being. |
ERROR: LoadError: MethodError: no method matching to_rotation(::Nothing)
] can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie
)there is no problem with taking
log10
ofC
noreps
but internally when deciding on xticks, it gives an error.minimal example:
the error:
The text was updated successfully, but these errors were encountered: