Comments (3)
Yes, but it doesn't help if the entire field is NaN/Infs
julia> A = rand(2,2)
julia> A[1] = NaN
julia> NaNMath.extrema(A)
(0.18783010303710246, 0.9637507750862072)
julia> NaNMath.extrema(A*NaN)
(NaN, NaN)
I'm coming from a perspective where I run a simulation, hopefully everthing works fine and heatmap gives me a quick look that things look reasonable. However, when the simulation blows up I just see white stripes on the heatmap (which is good because then I know I did something wrong). But in that case I can't use the colorbar at the moment.
from unicodeplots.jl.
I suggest to change that function to
function ceil_neg_log10(x)
val = -log10(x)
isfinite(val) || return typemin(Int)
roundable(val) ? ceil(Int, val) : floor(Int, val)
end
such that
julia> ceil_neg_log10(Inf)
-9223372036854775808
julia> ceil_neg_log10(1e300)
-300
the output is of the same type (Int
) and the smallest representable to match the -log10(x) idea as best as possible. In the end it seems to be used here
Lines 364 to 368 in bfaa6f8
where this works fine now
julia> round(Inf,digits=typemin(Int)+1)
Inf
julia> round(-Inf,digits=typemin(Int)+1)
-Inf
julia> round(NaN,digits=typemin(Int)+1)
NaN
If there are no objections, I'll create a pull request replacing the ceil_neg_log10
function
from unicodeplots.jl.
Thanks for reporting.
First, I think the colorbar limits should not take NaN
s into account. That is an easy fix replacing
UnicodePlots.jl/src/interface/heatmap.jl
Line 115 in bfaa6f8
NaNMath.extrema(A)
.
Then, I think we should ignore those NaN values when printing Crayons
.
from unicodeplots.jl.
Related Issues (20)
- switch to `Documenter` based docs ?
- support polar heatmap
- Filled contour plots HOT 5
- invert matrix when using heatmap HOT 3
- Import latency issue HOT 4
- Backend example of PlotDocs broken HOT 3
- Request: Leverage package extensions HOT 7
- redefinition warnings and error on exit when using with CairoMakie HOT 14
- [FR] try to remove the `StaticArrays` dependency
- Plot border and axis markers are the same color as background HOT 5
- histogram not defined HOT 6
- [FR] swap `lineplot` function order
- [FR] log transformed bins in histogram HOT 1
- Despite Project.toml update, StatsBase 0.34 is not compatible with UnicodePlots 3.5.2 HOT 3
- Error when using Uniful together with ylim
- Can I use UnicodePlots.jl by launching Julia script via command line (not in REPL mode) HOT 3
- Heatmap handling of NaN HOT 4
- Add way to autolimit a plot that has been added to HOT 3
- spy + xflip / yflip
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 unicodeplots.jl.