juliaplots / unicodeplots.jl Goto Github PK
View Code? Open in Web Editor NEWUnicode-based scientific plotting for working in the terminal
License: Other
Unicode-based scientific plotting for working in the terminal
License: Other
Based on general compatibility issues with charwidth etc that arise from Braille characters.
Related to #31
It would be cool to send the plots to some other terminal window. This would be useful for some plot that constantly gets updated by some process. This way we can have some basic UI in the current terminal while the resulting plot (that additionally depends on some other continuously updating process) gets updated in the other.
It may be an interesting technique to adapt: https://github.com/stefanhaustein/TerminalImageViewer#terminalimageviewer
julia> using UnicodePlots
julia> lineplot(rand(10))
WARNING: Base.UTF8String is deprecated, use String instead.
likely near no file:0
WARNING: Base.UTF8String is deprecated, use String instead.
likely near no file:0
WARNING: Base.UTF8String is deprecated, use String instead.
likely near no file:0
WARNING: Base.UTF8String is deprecated, use String instead.
likely near no file:0
WARNING: Base.UTF8String is deprecated, use String instead.
likely near no file:0
WARNING: Base.UTF8String is deprecated, use String instead.
likely near no file:0
WARNING: Base.UTF8String is deprecated, use String instead.
likely near no file:0
...
Such as log-scale and such. Related to 39 of Plots.jl
Will be a while before I get to this one, but I'll add it eventually.
I have sketched out a basic draft for the docstring documentation, but it could really use some love.
I am not very good in this sort of thing, so this kind of contribution would be very welcomed.
https://github.com/marcodiiga/filepie has an interesting approach to display pie charts in the terminal. They don't look terribly good, due to the resolution, but the approach could be interesting to consider (e.g. as inspiration) for UnicodePlots.
Hi,
First of all, thanks for the great package; I'm really enjoying it.
I'm having some trouble getting correct behavior with the popular font DevaVu Sans Mono (under LXTerminal, XTerm, and Gnome terminal). It does work correctly, under, eg, Droid Sans Mono, as well as several other fonts. The problem is that the background dots all appear white, instead of the (black) background color. Any ideas?
When trying to plot Array{Float64, N}
, sometimes I get the following error:
ERROR: InexactError()
in Plot at /home/USER/.julia/v0.4/UnicodePlots/src/plot.jl:151
There are no NaN or Inf values
I've been working on a general framework for building Terminal uis over at https://github.com/Keno/TerminalUI.jl. I'm mostly opening an issue here as an FYI,
since I don't know when I'll find the time to do the integration and TerminalUI is still very
much early alpha, but figured you may be interested, esp. since some of its terminal
features may come in handy for you.
I just realized that the UnicodePlots backend is broken in Plots.jl. It can't find UnicodePlots.createPlotWindow
... what's the new method I should use for this?
Although it is a lot better than before, I am still not really happy with it.
xlim
and ylim
How do you feel about histograms? I'm using this right now:
function histogram(x, n::Int=5)
edges, counts = hist(x,n)
labels = []
for i in 1:length(counts)
push!(labels, string("(",edges[i],",",edges[i]+1,"]"))
end
barplot(labels,counts)
end
num_over = [1,0,2,1,1,0,2,1,1,0,1,2,2,0,0,2,0,1,1,2,1,1,1,0,1,1,3,1,1,1,2,1,2,0,1,1,0,0,2,1,0,0,1,0,1,1,2,1,1,0,2,0,1,2,1,1,2,2,0,1,0,1,1,2,0,1,1,0,2,1,1,2,0,1,1,1,1,1,0,1,2,1,1,1,2,0,2,1,1,1,2,1,3,1,0,1,2,2,0,2,0,3,2,0,2,0,1,1,3,2,1,2,2,1,1,2,1,1,2,1,2,1,2,2,0,0,0,0,1,2,3,1,0,2,2,2,0,0,1,1,2,1,1,0,0,0,1,1,2,0,2,1,2,1,1,2,2,0,0,2,0,1,2,1,0,2,1,0,1,0,1,1,2,0,2,0,1,1,1,2,1,2,1,2,3,0,1,1,2,1,2,2,0,0,1,1,0,2,0,0,1,0,0,1,0,1,1,0,1,2,0,2,1,1,2,1,2,2,1,0,2,1,0,2,1,1,1,1,1,3,3,0,0,2,2,1,3,1,2,2,1,1,0,0,1,2,2,1,2,2,1,0,2,1,1,2,2,2,1,1,0,0,1,2,1,1,2,1,1,3,2,1,1,1,1,2,1,0,1,1,0,1,1,1,1,1,1,1,3,0,0,1,0,1,0,1,3,0,2,1,1,1,0,3,1,1,1,2,1,1,1,3,1,1,1,2,1,0,0,0,0,2,1,2,2,2,0,2,1,3,1,1,0,3,1,3,2,2,1,2,1,1,1,2,1,1,0,1,0,1,3,0,1,3,1,0,0,2,1,1,0,0,1,1,1,1,1,1,3,2,2,0,1,3,1,1,1,2,0,1,2,1,0,3,0,1,1,2,3,1,1,1,0,2,0,2,1,1,2,2,2,0,2,2,2,2,1,2,2,0,2,3,0,1,1,2,1,0,2,1,2,0,1,1,1,1,1,2,0,0,0,0,1,2,0,3,1,1,1,1,1,0,2,0,0,1,0,1,2,2,1,1,2,0,1,1,2,1,1,1,1,2,0,1,0,1,2,3,1,2,1,0,0,2,2,1,1,2,0,1,1,2,2,2,2,1,0,0,1,2,2,3,0,2,2,2,1,2,1,1,0,1,1,1,2,1,3,1,0,1,1,2,1,1,1,1,0,1,1,1,2,2,1,1,0,2,0,1,0,1,2,0,2,2,1,1,0,2,1,2,2,0,0,1,1,1,1,0,1,2,2,1,1,2,1,2,1,1,0,3,2,1,1,1,1,2,2,1,2,1,1,1,1,1,1,1,1,2,0,0,1,1,3,1,1,1,1,1,2,1,0,1,1,1,0,1,2,2,1,0,1,1,1,0,1,0,1,2,1,1,3,3,0,0,2,2,0,2,2,0,2,1,2,1,1,2,2,0,1,1,1,1,0,2,1,1,0,1,1,1,0,1,2,2,1,1,1,2,3,1,2,2,1,1,1,0,0,2,2,1,1,1,1,2,0,0,1,0,1,3,2,1,1,2,2,1,1,1,2,0,2,1,0,2,0,0,2,3,1,1,2,1,2,1,0,3,1,2,3,1,1,2,3,2,2,1,1,1,1,1,2,0,2,1,0,1,1,2,0,1,1,1,1,1,1,1,3,1,0,0,2,1,1,1,1,1,1,1,1,2,0,2,2,2,2,1,3,1,1,0,0,1,0,2,0,0,1,2,2,0,3,0,0,2,1,1,2,3,1,0,0,2,1,0,0,2,1,1,2,2,3,2,1,1,2,2,2,2,2,1,1,1,0,0,0,0,1,1,2,1,1,1,0,0,1,0,0,1,0,1,0,0,1,2,3,1,1,0,3,0,1,2,0,1,0,2,2,1,2,0,1,1,2,0,2,1,0,0,1,2,0,1,2,1,1,2,0,1,1,0,2,1,1,0,2,2,0,1,1,0,1,0,1,2,2,2,0,1,1,0,1,1,1,0,1,1,2,1,1,0,2,1,1,3,1,0,1,2,3,1,0,3,0,1,0,1,2,1,3,3,1,2,1,1,2,0,3,1,1,2,2,1,1,2,1,1,1,0,0,1,2,1,1,0,3,0,1,1,1,1,2,0,1,2,1,1,1,2,1,1,2,0,0,2,3,0,1,1,2,1,1,1,0,2,1,1,2,1,1,1,2,0,2,1,2,1,2,2,2,2,1,1,0,1,1,2,2,1,1,1,2,1,1,1,2,1,2,0,2,2,1,1,2,0,1,0,2,2,0,2]
histogram(num_over)
┌─────────────────────────────────────────────┐
(-1.0,0.0]│▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ 221 │
(0.0,1.0]│▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ 460 │
(1.0,2.0]│▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ 266 │
(2.0,3.0]│▪▪▪▪▪ 53 │
└─────────────────────────────────────────────┘
I was thinking of a vertical version, but it seems like it could be kind of space inefficient. Anyway, thought I'd share this for now.
Hi
I have received this error when Julia> using UnicodePlots.jl
It follows
julia> using UnicodePlots
INFO: Precompiling module UnicodePlots.
ERROR: LoadError: LoadError: syntax: invalid type signature
in include_from_node1(::String) at ./loading.jl:488
in include_from_node1(::String) at /Applications/JuliaPro-0.5.0.4.app/Contents/Resources/julia/Contents/Resources/julia/lib/julia/sys.dylib:?
in include_from_node1(::String) at ./loading.jl:488
in include_from_node1(::String) at /Applications/JuliaPro-0.5.0.4.app/Contents/Resources/julia/Contents/Resources/julia/lib/julia/sys.dylib:?
in macro expansion; at ./none:2 [inlined]
in anonymous at ./<missing>:?
in eval(::Module, ::Any) at ./boot.jl:234
in eval(::Module, ::Any) at /Applications/JuliaPro-0.5.0.4.app/Contents/Resources/julia/Contents/Resources/julia/lib/julia/sys.dylib:?
in process_options(::Base.JLOptions) at ./client.jl:239
in _start() at ./client.jl:318
in _start() at /Applications/JuliaPro-0.5.0.4.app/Contents/Resources/julia/Contents/Resources/julia/lib/julia/sys.dylib:?
while loading /Applications/JuliaPro-0.5.0.4.app/Contents/Resources/pkgs-0.5.0.4/v0.5/UnicodePlots/src/canvas.jl, in expression starting on line 1
while loading /Applications/JuliaPro-0.5.0.4.app/Contents/Resources/pkgs-0.5.0.4/v0.5/UnicodePlots/src/UnicodePlots.jl, in expression starting on line 51
ERROR: Failed to precompile UnicodePlots to /Applications/JuliaPro-0.5.0.4.app/Contents/Resources/pkgs-0.5.0.4/lib/v0.5/UnicodePlots.ji.
in compilecache(::String) at ./loading.jl:593
in require(::Symbol) at ./loading.jl:422
in require(::Symbol) at /Applications/JuliaPro-0.5.0.4.app/Contents/Resources/julia/Contents/Resources/julia/lib/julia/sys.dylib:?
It's useful to have different styles of stair plots. Here's a variant where the step occurs before the next point:
diff --git a/src/scatterplot.jl b/src/scatterplot.jl
index 44ed684..888cac9 100644
--- a/src/scatterplot.jl
+++ b/src/scatterplot.jl
@@ -113,6 +113,27 @@ function stairs!{T<:Canvas,F<:Real,R<:Real}(plot::Plot{T}, X::Vector{F}, Y::Vect
lineplot!(plot, xVec, yVec; args...)
end
+function stairs_pre!{T<:Canvas,F<:Real,R<:Real}(plot::Plot{T}, X::Vector{F}, Y::Vector{R}; args...)
+ xVec = zeros(length(X) * 2 - 1)
+ yVec = zeros(length(X) * 2 - 1)
+ xVec[1] = X[1]
+ yVec[1] = Y[1]
+ o = 0
+ for i = 2:(length(X))
+ xVec[i + o] = X[i-1]
+ xVec[i + o + 1] = X[i]
+ yVec[i + o] = Y[i]
+ yVec[i + o + 1] = Y[i]
+ o += 1
+ end
+ lineplot!(plot, xVec, yVec; args...)
+end
+
+
function stairs{F<:Real,R<:Real}(X::Vector{F},Y::Vector{R}; args...)
xVec = zeros(length(X) * 2 - 1)
yVec = zeros(length(X) * 2 - 1)
I'll probably use the typical R structure unless someone has a better suggestion
Something along the lines of ...
function lineplot{T<:TimeType,R<:Real}(X::AbstractVector{T}, Y::AbstractVector{R};
This would require importing the Base.Dates
package.
ERROR: InexactError()
Stacktrace:
[1] trunc(::Type{Int64}, ::Float64) at ./float.jl:672
[2] ceil_neg_log10(::Float64)
...
@tbreloff Since I have to spend some time on UnicodePlots again soon to make it 0.5 ready anyway, I am considering what other task I should tackle while I am at it (aside from some open bugs). Do you have a list of suggestions that would be useful for Plots? For example, you mentioned the support for ColorTypes
before, which is something that I am considering doing (I had to spend quite some time with those recently for a different project, so I am already a little familiar with the basic gist).
Anything else that comes to mind? Everyone is welcome to chime in and propose things they would really like to see in UnicodePlots
Would be nice if you could set any color using RGB from Colors.jl (or just accepting a tuple of (R,G,B)?)
Thanks for a great plotting package. Thousands of times faster than anything else out there for Julia!
Here are a few feature requests:
stairs!()
)spy()
function to plot sparsity patterns:bc
(bottom center) location (and perhaps :tc
(top center))Here's the first feature:
function lineplot!{T <: Canvas, F <: Real, R <: Real}(plot :: Plot{T}, X :: Vector{F}, Y :: Vector{R}; color:: Symbol=:white, args...)
X = convert(Vector{FloatingPoint},X)
Y = convert(Vector{FloatingPoint},Y)
drawLine!(plot, X, Y, color)
end
function stairs!{T <: Canvas, F <: Real, R <: Real}(plot :: Plot{T}, X :: Vector{F} , Y :: Vector{R}; args...)
xVec = zeros(length(X) * 2- 1)
yVec = zeros(length(X) * 2 - 1)
xVec[1] = X[1]
yVec[1] = Y[1]
o = 0
for i = 2:(length(X))
xVec[i + o] = X[i]
xVec[i + o + 1] = X[i]
yVec[i + o] = Y[i-1]
yVec[i + o + 1] = Y[i]
o += 1
end
lineplot!(plot, xVec, yVec; args...)
end
And here's a primitive spy()
:
function spy(A :: SparseMatrixCSC, args...)
rows, cols, vals = findnz(A)
nrow, ncol = size(A)
canvas = BrailleCanvas(40, int(20 * nrow / ncol),
plotWidth=float(ncol)+1, plotHeight=float(nrow)+1)
spyplot = Plot(canvas, args...)
setPoint!(spyplot,
convert(Vector{FloatingPoint}, cols),
nrow + 1 - convert(Vector{FloatingPoint}, rows),
:green)
return spyplot
end
Not sure if this is the same as #21 but setting ylim=[0, 1.1]
actually ends up using [0, 2]
, which seems a bit overboard:
julia> using UnicodePlots
julia> lineplot(collect(1:100), rand(100), ylim=[0, 1.1])
┌────────────────────────────────────────┐
2 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⢠⠀⠀⠀⢠⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⢠⡄⠀⢀⠀⠀⡄⠀⠀⠀⡀⠀⠀⠀⢸⠀⡇⣿⣧⠀⠀⢸⣧⠀⠀⠀⠀⣷⠀⢠⠀⠀⢰⠀⠀⡆⠀⠀⢠⠀│
│⢸⢇⢰⣼⡇⣾⣇⢀⠀⢸⡇⠀⠀⠀⢸⡀⣷⣿⣿⠀⠀⢸⣿⡄⠀⠀⢀⢿⢀⣼⣇⢀⣼⠀⡆⣧⡆⢰⣾⠀│
│⢸⠘⡾⣿⣷⣿⣿⣸⠀⢸⡇⡆⠀⡀⢸⡇⣿⣿⣿⢰⡇⢸⠇⡇⠀⢀⣼⢸⢸⣿⣿⢸⡏⡆⣿⣿⢣⡸⣿⠀│
│⡜⠀⠁⢿⣿⢿⣿⡏⡆⢸⡇⣷⣷⣧⣼⣷⢻⢿⣿⢸⢇⢸⠀⡇⡄⢸⣿⢸⡎⠏⢻⢸⠀⣿⠸⣿⢸⡇⡿⣦│
│⠃⠀⠀⢸⣿⢸⣿⡇⡇⢸⣧⢻⠁⠘⡟⢿⢸⠸⠇⣿⢸⣿⠀⢣⣿⡎⡿⢸⡇⠀⠸⡇⠀⣿⠀⢸⢸⡇⡇⡇│
│⠀⠀⠀⢸⣿⠸⡇⠁⡇⢸⣿⠈⠀⠀⡇⠈⢸⠀⠀⣿⠀⣿⠀⢸⡏⠃⠁⠸⡇⠀⠀⡇⠀⠹⠀⠈⢸⠇⠀⡇│
0 │⠀⠀⠀⠘⠇⠀⠀⠀⠉⠋⠸⠀⠀⠀⠀⠀⠀⠀⠀⢿⠀⢹⠀⠘⠃⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀│
└────────────────────────────────────────┘
0 100
Testing other values of ylim
it seems the upper bound is rounded up to the next integer. Is that the case?
Since my main use-case for Julia right now is simulation/optimization and I still do my data analysis in R, I don't really need a boxplot in Julia.
That being said, I am very intrigued to implement one simply because there are perfect Unicode signs available to do this (they wouldn't even have a gap between the lines like they do here)
──┬──
│
┌─┴─┐
│ │
├───┤
│ │
└─┬─┘
│
──┴──
The only issue I guess would be scale. Alternatively one could use simply the BrailleCanvas
and draw lines, which would offer a better resolution.
Does anyone have an opinion on boxplots?
as discussed in #19
The labels are sometimes correct, but other times they are out of order, or cover nonsensical ranges, so you may need to run these a few times to see the problem.
julia> histogram(rand(Int32, 10),bins=10)
┌────────────────────────────────────────┐
(-2.0e9,5.0e8] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 1 │
(-1.5e9,1.0e9] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 1 │
(-1.0e9,1.5e9] │ 0 │
(-5.0e8,2.0e9] │ 0 │
(0.0,2.5e9] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 2 │
(5.0e8,3.0e9] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 1 │
(1.0e9,3.9999999999999995e9] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 2 │
(1.5e9,3.9999999999999995e9] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 1 │
(2.0e9,5.0e9] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 2 │
└────────────────────────────────────────┘
julia> histogram(rand(Float32, 10),bins=10)
┌────────────────────────────────────────┐
(0.30000000000000004,0.1] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 4 │
(0.4,0.2] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 2 │
(0.5,0.3] │ 0 │
(0.6000000000000001,0.4] │▇▇▇▇▇▇▇▇▇ 1 │
(0.7000000000000001,0.5] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 2 │
(0.8,0.6] │ 0 │
└────────────────────────────────────────┘
versioninfo():
Julia Version 0.3.8-pre+22
Commit 5078421* (2015-04-28 09:05 UTC)
Platform Info:
System: Linux (x86_64-amazon-linux)
CPU: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
WORD_SIZE: 64
BLAS: libmkl_rt
LAPACK: libmkl_rt
LIBM: libimf
LLVM: libLLVM-3.3
When using spy
the size of the plot currently defaults do a 1:1 aspect ratio, which isn't generally the best choice. I should change the size to depend on the matrix size (within some reasonable bounds) to reflect the structure of the matrix
I'm not sure how practical this is but I would like it if I could increase the canvas size of a plot.
Related to #19 .
When specifying a plot with xlim=[minimum(x),maximum(x)] for example, make sure that the limits won't end up being something like [0.3343223244234, 9.9352534323232432]
Might be related to #14 .
julia> histogram(rand(Int64, 10),bins=10)
ERROR: DomainError
in histrange at statistics.jl:555
in histogram at /home/jbrock/.julia/v0.3/UnicodePlots/src/histogram.jl:4
in histogram at /home/jbrock/.julia/v0.3/UnicodePlots/src/histogram.jl:14
versioninfo():
Julia Version 0.3.8-pre+22
Commit 5078421* (2015-04-28 09:05 UTC)
Platform Info:
System: Linux (x86_64-amazon-linux)
CPU: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
WORD_SIZE: 64
BLAS: libmkl_rt
LAPACK: libmkl_rt
LIBM: libimf
LLVM: libLLVM-3.3
julia> spy(eye(3))
WARNING: tty_size is deprecated. use `displaysize(io)` as a replacement
in depwarn(::String, ::Symbol) at ./deprecated.jl:64
in tty_size() at ./deprecated.jl:182
in #spy#62(::Int64, ::Int64, ::String, ::Int64, ::Int64, ::Int64, ::Int64, ::Symbol, ::Bool, ::Type{UnicodePlots.BrailleCanvas}, ::Array{Any,1}, ::UnicodePlots.#spy, ::Array{Float64,2}) at /home/ubuntu/.julia/v0.5/UnicodePlots/src/interface/spy.jl:116
in spy(::Array{Float64,2}) at /home/ubuntu/.julia/v0.5/UnicodePlots/src/interface/spy.jl:103
in eval(::Module, ::Any) at ./boot.jl:234
in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
in macro expansion at ./REPL.jl:95 [inlined]
in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68
while loading no file, in expression starting on line 0
julia --version
julia version 0.5.0
See plots starting from Line 4300 of this Travis log: https://travis-ci.org/yebai/Turing.jl/jobs/224394352
The horizontal spacing seems weird and there is also some unknown characters.
From issue: JuliaPlots/Plots.jl#231
I'm starting to look through this package for implementation in Plots.jl, but I can't figure out how you created the PNG files. Did you do that by hand? Any ideas of how to automate?
Thus height
and width
will in the next version be used to be able to specify the plot range. The named params rows
and columns
will then be used to specify the size of the plot itself in terms of characters
changed my mind. I'll do xmin
, xmax
, ymin
, ymax
instead and leave width and height alone
Newest Julia master allows to use a number as the color and will then print in the corresponding 256 color palette. The argument type for color
could hence be a bit relaxed if you want.
So I have been thinking about automatic plot-resizing that stretches the size of the terminal (similar to how large arrays are printed in the REPL). To achieve this I would have to store the data to be drawn and delay the actual drawing on the canvas until show is called. This would enable all kinds of cool things though, such as being able to resize the "virtual space" of the plot when new data is added onto it.
If I were to do this refactoring, it would make sense to base this package on Compose.jl (I think). I don't believe the API of UnicodePlots would change that much (if at all), but the compile-time would probably increase.
I wouldn't do this big refactoring right away, but I thought I'd ask around what people think about this.
Does anyone have an opinion on this?
julia> unicodeplots()
Plots.UnicodePlotsBackend()
julia> plot( rand(3))
WARNING: filter(flt, itr) is deprecated, use Iterators.filter(flt, itr) instead.
I think iTerm has line spacing, which doesn't get taken account by the painting algorithm, so the lines look off. Maybe the algorithm can be accounted to adjust for that (of course there will always be some spacing) or maybe @gnachman has a suggestion for how to make this look better (not that there is a real need since with iTerm you can always just embed a real plot as an inline image - but still).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.