Using Sho Visualization from F# interactive

Unanswered Using Sho Visualization from F# interactive

  • Friday, May 20, 2011 9:29 AM
     
     

    Hi Everyone,

    Please could someone post a little example of producing a plot from within F# interactive. I've have Yin's example of using the array library from within F# working but I just can't seem to get a plot to work. 

    Also, I'd just like to add my support for Sho. Like many here I'm excited to see Sho (and technical computing in general) coming out of Microsoft. I am a long time user of Matlab (for quant finance) but I would really love to leave it behind for a modern language. I like python and I love F# and for me its the interactive visualisation part that still needs some work.

    I've tried various 3rd party libraries and some are ok but I'd really like to see a single nice complete and consistent set of viz functions. Sho looks like its going that way. More please!

    many thanks,

    Paul.

All Replies

  • Sunday, May 29, 2011 7:04 AM
     
      Has Code

    Hi Paul,

     

    Here is the code snippet you need:

     

     

    // Reference Sho runtime
    #r "MathFunc.dll"
    #r "MatrixInterf.dll"
    #r "ShoArray.dll"
    #r "ShoViz.dll"
    #r "PythonExt.dll"
    
    // Open Sho namespaces 
    open ShoNS.Array
    open ShoNS.Visualization
    open ShoNS.MathFunc  
    
     

     

     

    // s is an sho array 

    // Draw line chart with circles for each value ShoPlotHelper.Plot(s, "ro-") // Draw bar chart ShoPlotHelper.Bar(s)

     

    The visualization in Sho is a C# wrapper to Microsoft Chart Controls.

    I would also like to recommend you two other F# wrappers to Microsoft Chart Controls:

     

    http://blogs.msdn.com/b/dsyme/archive/2011/04/01/fsharpchart-wrapping-the-system-windows-forms-datavisualization-charting-charting-types.aspx

    http://blogs.msdn.com/b/fsharpteam/archive/2011/04/15/getting-started-with-fsharpchart.aspx

    http://lucabolognese.wordpress.com/2010/02/19/lchart-displaying-charts-in-f-part-iii/


    - Yin Zhu