Giter VIP home page Giter VIP logo

unicodeplots.jl's Issues

UnicodePlots with Emacs ESS

First of all thanks for a great library. I have been trying to get the library to work inside Emacs. Unfortunately the graphs are not legible with the exception of bar plot. Any suggestion if it would be possible to make the library work inside of Emacs.

unicode_plot

plot in external window

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.

UTF8 Warnings in julia 0.5

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
...

Improve documentation

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.

Support for DejaVu Sans?

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?

I attached an image under LXTerminal
unicodeplots

InexactError() when plotting

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

Integrate with TerminalUI.jl

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.

createPlotWindow missing

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?

Tweak automatic plotting range a little

Although it is a lot better than before, I am still not really happy with it.

  • get happy about it by either finding a good solution or Stockholm syndrome
  • also include options to specify xlim and ylim

Feature: Histograms

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.

ERROR: LoadError: LoadError: syntax: invalid type signature

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:?

"pre" stairs plot

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)

Support plotting time series

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.

Get more useful as a Plots backend

@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

Support Colors.Colorant

Would be nice if you could set any color using RGB from Colors.jl (or just accepting a tuple of (R,G,B)?)

Feature requests

Thanks for a great plotting package. Thousands of times faster than anything else out there for Julia!

Here are a few feature requests:

  1. add stair plots one by one (stairs!())
  2. a spy() function to plot sparsity patterns
  3. add axis labels in addition to "ticks"
  4. add :bc (bottom center) location (and perhaps :tc (top center))
  5. colored annotations (e.g., for colored legends)

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

screen shot 2015-08-18 at 10 20 41

ylim exaggerated

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?

Boxplots

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?

Default canvas shows question marks only (windows)

I guess this is because windows cmd cannot display unicode characters (can it?), but just to let you know, the default canvas looks "questionable" ;)

unicodeplots_on_windows

is there any terminal that works with UnicodePlots on windows?

histogram bin labels are sometimes incorrect

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

Automatic sparsity pattern aspect ration

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

Modify canvas size

I'm not sure how practical this is but I would like it if I could increase the canvas size of a plot.

DomainError when using histogram with Int64

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

tty_size is deprecated

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

how to save as PNG?

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?

Stem Leaf Plot

How would you feel about adding a stem leaf plot? I think that with some changes to the barplot function we can have a sensible stem leaf plot.

One issue is that symb only takes one character. It would have to be changed to allow integers.

screen shot 2016-12-15 at 1 59 29 pm

Support for 256 colors.

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.

Base on Compose.jl

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?

filter deprecated warning

julia> unicodeplots()
Plots.UnicodePlotsBackend()

julia> plot( rand(3))
WARNING: filter(flt, itr) is deprecated, use Iterators.filter(flt, itr) instead.

Plots don't look quite as good in iterm

screen shot 2015-08-16 at 5 48 11 pm

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).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.