Comments (2)
I found this in the code:
Makie.jl/src/dim-converts/unitful-integration.jl
Lines 135 to 139 in e73ea0e
The example is a little wrong, because it hides units for Y and then labels them in X, but this works for your example:
f=Figure()
ax=Axis(f[1,1],
dim1_conversion=Makie.UnitfulConversion(u"m"; units_in_label=false),
xlabel="Distance (m)",
dim2_conversion=Makie.UnitfulConversion(u"W"; units_in_label=false),
ylabel="Power (W)",)
mak = scatter!(ax,(1:5)u"m", (10:10:50)u"W")
Not sure if there is a simpler way. It does retain the units in the axis, so following up with same dimension units works.
mak2 = scatter!(ax, (100:100:500)u"cm", (0.005:0.010:0.045)kW)
from makie.jl.
Yes, seems like specifying dimconversions manually works, but is very verbose for something wanted in (presumably) the vast majority of cases.
Wonder what's the reason for making units a part of ticklabels: are there some fields where such plots are more common than those with units in axislabels?
Maybe something like this is possible, what do you think?
let
fig = Figure()
ax = Axis(fig[1,1], units_in_axislabels="(%s)") # common alternative values are "[%s]" and ", %s"
scatter!(ax, (1:5)u"m", (10:10:50)u"kW")
fig
end
This would put units into axislabels using the provided pattern.
from makie.jl.
Related Issues (20)
- WGLMakie scatter overflows axis for large figures
- Sometimes units are not handled HOT 1
- xtick is missing for missing data HOT 4
- Plot methods that don't work with units
- FR: Add ability to change the "reset zoom" binding
- Utilizing weakdeps/extensions HOT 2
- Interact with GLMakie scene from the REPL? HOT 2
- Error when creating sysimage with MakieCore 0.8.2
- `xticks` is ignored with unit aware axes
- Stack overflow for BezierPath marker in data space
- BoundsError in `recordframe!` with WGLMakie
- eye position and lookat incorrectly set HOT 1
- Create line plot with a specific number of markers (like markerindices in matlab)
- CairoMakie svgs broken when using views in polys
- Missing Tutorial Figures HOT 1
- Apply `DateFormat` to `DateTime` axis ticks
- Error Bars not working properly
- ecdfplot! MethodError ambiguous insert!
- `select_point` is broken
- Figure names on GLMakie independent figures HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from makie.jl.