2016-11-05 124 views
1

我有用下面的代碼的錯誤消息:(從sudipta慕克吉例如代碼)FsPlot的OSX塞拉利昂

#load "./packages/FsPlot.0.6.6/FsPlotBootstrap.fsx" 
open FsPlot.Highcharts.Charting 

// Logistic Regression 
let z = [for i in -10. .. 10. -> (i,1./(1.+exp -i))] 
z 
|> Chart.Spline 
|> Chart.WithTitle "Sigmoid Function" 
|> Chart.WithName "g(z)" 

當我執行的代碼,我已得到在FSI的錯誤消息:

Loading /eUSB/sync/fsharp/packages/FsPlot.0.6.6/FsPlotBootstrap.fsx] 
namespace FSI_0008 
    System.ComponentModel.Win32Exception: ApplicationName='/eUSB/sync/fsharp/packages/FsPlot.0.6.6/./tools/chromedriver.exe', 
    CommandLine='--port=53810', CurrentDirectory='', Native error= Access denied 
     at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process p 
    rocess) <0x11eab6f10 + 0x006f3> in <filename unknown>:0 
    Stopped due to error 

看來錯誤是win32相關的,而FsPlot不支持OSX。

請隨時通知。我應該怎麼做才能解決這個錯誤?

回答

2

將源代碼遷移到XPlot(FsLab包的一部分),它運行平穩。

#load "./packages/FsLab.1.0.2/FsLab.fsx" 
open XPlot.GoogleCharts 

// Logistic Regression 
let z = [for i in -10. .. 10. -> (i,1./(1.+exp -i))] 

let options = 
    Options 
    (title = "Sigmoid Function", curveType = "function", 
     legend = Legend(position = "bottom")) 

[z] 
|> Chart.Line 
|> Chart.WithOptions options 
|> Chart.WithLabels ["g(z)"]