Hacker News new | ask | show | jobs
by TeMPOraL 3895 days ago
For those without a R interpreter handy, Emacs to the rescue:

       ^
       |  |                                                                           |  
       |  |                                                                           |  
       |  |                                                                           |  
       |  |                                                                           |  
       |  \                                                                           /  
       |   |                                                                         |   
       |   \                                                                         /   
       |    |                                                                       |    
       |    \                                                                       /    
       |     \                                                                     /     
       |      \                                                                   /      
    B  |       \                                                                 /       
    S  |        \                                                               /        
       |         -\                                                           /-         
       |           \                                                         /           
       |            -\                                                     /-            
       |              -\                                                 /-              
       |                --\                                           /--                
       |                   --\                                     /--                   
       |                      ---\                             /---                      
       |                          -----\                 /-----                          
       |                                -----------------                                
       |                                                                                 
       +--------------------------------------------------------------------------------->
                                            Prestige
(Also an on-line R interpreter: http://www.r-fiddle.org/.)
1 comments

What package(s) did you use to create this?
I used http://r-fiddle.org to verify what was the intended function, then used built-in Artist Mode (M-x artist-mode) to draw an ellipse for function and square for axes, and finally cut it down in fundamental-mode and added labels. It's basically vanilla Emacs, but I admit to using multiple-cursors.el for some cleanup. It's an excellent addon mode offering a more interactive way to do some things you'd otherwise do via keyboard macros. Check out [0] and [1].

[0] - https://github.com/magnars/multiple-cursors.el

[1] - http://emacsrocks.com/e13.html

Ah thanks, I was aware of artist-mode, I thought there was some ESS like package that could output ascii graphs of functions :) R-fiddle is new to me though, thanks for that.
There's also orgtbl-ascii-plot[0], there was a mode for writing out flow diagrams in Emacs that used a web backend to render them (I don't remember the name), and I'm pretty sure you could abuse some graphics-to-ascii or DOT file command line tools to get the required result in Emacs buffer - particularly via org-babel, which lets you invoke external programs to "evaluate" code blocks. I remember using some Java-based local tool to render graphs through org-babel, but again I don't recall the name or URL.

[0] - http://orgmode.org/worg/org-contrib/orgtbl-ascii-plot.html