Giter Club home page Giter Club logo

Comments (7)

kojix2 avatar kojix2 commented on May 21, 2024

Hello.
I see that you are proposing to add a log scale. Could you tell me what commands and command line options you are imagining?

from youplot.

katotheo avatar katotheo commented on May 21, 2024

Something per axis, e.g.
--ysetlogscale
defaulting to log of 10, or pass a number for different log...

I suppose one could process the data before feeding them to the plotter, but it would be a good convenience if plotter took care of that...

from youplot.

kojix2 avatar kojix2 commented on May 21, 2024

You can use log scale for bar and count.

curl -sL https://git.io/ISLANDScsv \
| sort -nk2 -t, \
| tail -n15 \
| uplot bar -d, -t "Areas of the World's Major Landmasses" --xscale log
                   Areas of the World's Major Landmasses
                 ┌                                        ┐ 
         Britain ┤■■■■■■■■■■■■■■ 84.0                       
          Honshu ┤■■■■■■■■■■■■■■ 89.0                       
         Sumatra ┤■■■■■■■■■■■■■■■■■ 183.0                   
          Baffin ┤■■■■■■■■■■■■■■■■■ 184.0                   
      Madagascar ┤■■■■■■■■■■■■■■■■■ 227.0                   
          Borneo ┤■■■■■■■■■■■■■■■■■■ 280.0                  
      New Guinea ┤■■■■■■■■■■■■■■■■■■ 306.0                  
       Greenland ┤■■■■■■■■■■■■■■■■■■■■■ 840.0               
       Australia ┤■■■■■■■■■■■■■■■■■■■■■■■■■ 2968.0          
          Europe ┤■■■■■■■■■■■■■■■■■■■■■■■■■■ 3745.0         
      Antarctica ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■ 5500.0        
   South America ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 6795.0       
   North America ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 9390.0      
          Africa ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 11506.0    
            Asia ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 16988.0   

when :barplot, :bar
sub_parser_add_symbol
sub_parser_add_fmt_yx
sub_parser_add_xscale
when :count, :c
sub_parser.on_head('-r', '--reverse', TrueClass, 'reverse the result of comparisons') do |v|
options.reverse = v
end
sub_parser_add_symbol
sub_parser_add_xscale

On the other hand, line, scatter, density, etc. cannot use log scale.

YouPlot is mostly a wrapper for the backend library UnicodePlot. So, it depends on unicode_plot whether log scaling is currently supported.

from youplot.

kojix2 avatar kojix2 commented on May 21, 2024

Reading the README.md of the original Julia implementation of UnicodePlot, it appears that log scale is now supported.

image

And I hope Ruby's UnicodePlot will support it as well.

from youplot.

katotheo avatar katotheo commented on May 21, 2024

Sounds great, I'll use bar or count.

Shall we close this or keep it open as a reminder for the work for line, scatter, etc. ?

from youplot.

kojix2 avatar kojix2 commented on May 21, 2024

Please leave this issue Open.

from youplot.

llimllib avatar llimllib commented on May 21, 2024

It would be very useful for hist as well, ex the graph this presents is not super useful:

$ cat /usr/share/dict/words | grep -o ...$ | sort | uniq -c | uplot hist -n 20
                      ┌                                        ┐ 
   [    0.0,   500.0) ┤▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 4068   
   [  500.0,  1000.0) ┤ 45                                       
   [ 1000.0,  1500.0) ┤ 16                                       
   [ 1500.0,  2000.0) ┤ 4                                        
   [ 2000.0,  2500.0) ┤ 5                                        
   [ 2500.0,  3000.0) ┤ 5                                        
   [ 3000.0,  3500.0) ┤ 4                                        
   [ 3500.0,  4000.0) ┤ 1                                        
   [ 4000.0,  4500.0) ┤ 1                                        
   [ 4500.0,  5000.0) ┤ 1                                        
   [ 5000.0,  5500.0) ┤ 0                                        
   [ 5500.0,  6000.0) ┤ 1                                        
   [ 6000.0,  6500.0) ┤ 1                                        
   [ 6500.0,  7000.0) ┤ 1                                        
   [ 7000.0,  7500.0) ┤ 0                                        
   [ 7500.0,  8000.0) ┤ 0                                        
   [ 8000.0,  8500.0) ┤ 0                                        
   [ 8500.0,  9000.0) ┤ 0                                        
   [ 9000.0,  9500.0) ┤ 1                                        
                      └                                        ┘ 

(interpretation: most words don't end in a common ending, but a few endings are very very common)

from youplot.

Related Issues (20)

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.