2017-01-16 11 views
0

私はjuliaでプロットするために海軍を使用します。しかし、私はどのようにset_styleのcertaiinプロパティを解析するのか分かりません。 Pythonでの行は、最小限の例を与えるためにJuliaでPyCall経由で海軍の設定

sns.set_style('darkgrid', {'axes.linewidth': 2, 'axes.edgecolor':'black'}) 

次のようになります。

using PyPlot 
using PyCall 
@pyimport seaborn as sns 


test_plot() 
function test_plot() 
    clf() 
    #- - - 
    sns.set_style("ticks",???) 
    # - - - 
    tmp_plt=figure("plot1",figsize=(4.5, 3.5)) 
    x=collect(0:0.5:3) 
    plot(x,0.4.*x) 
    plot(x,x.^0.5) 
end 

は交換する方法を誰もが知っている「???」それはpythonの入力{'axes.linewidth': 2, 'axes.edgecolor':'black'}に対応するようにジュリアで?

どうもありがとう:)

編集:私はseabornについて見当がつかない

using PyPlot 
using PyCall 
@pyimport seaborn as sns 

close() 
test_plot() 
function test_plot() 
    sns.set_context("notebook", font_scale=1.4) 
    sns.set_style("ticks") 
    rc("font",family ="Computer Modern Roman") 
    rc("lines",linewidth = 2.5) 
    rc("axes",linewidth = 2,edgecolor=".55") 
    rc("axes",grid=true) 
    rc("grid",linestyle="-",color="1.0") 
    rc("legend",frameon=true,edgecolor="none",facecolor="0.85") 
    rc("axes",facecolor="0.96") 
    rc("axes",titlesize="large") 
    tmp_plt=figure("plot1",figsize=(8, 6)) 
    ax=gca() 
    x=collect(0:0.5:3) 
    plot(x,0.4.*x) 
    plot(x,x.^0.5) 
    tmp=legend(["Tmp 1", "Tmp 2"],loc=2,bbox_to_anchor=[0.0015,0.997],borderaxespad=0) 
    xlabel("basic x",labelpad =5.0) 
    ylabel("basic y",labelpad =5.0) 
    title("\$ \\sum x^2\$",y=1.08) 
    tight_layout() 
    savefig("fig2.pdf") 
end 
+0

なぜシーボーンに関わっていますか? (また、PyPlotバックエンドでPlots.jlを使用できるときにPyPlotを使用する理由) –

+0

@LyndonWhiteおそらく、OPはちょうど彼らの足がジュリアに濡れていて、おなじみのパッケージに頼っています。 Seabornはmatplotlibで構築されており、統計プロットのための便利で強力なインターフェースを提供します。 –

答えて

0

が、Pythonの

とジュリア相当:私は、将来の参照のためにRCを使用して回避策を見つけ
{'axes.linewidth': 2, 'axes.edgecolor':'black'} 

は、単に

Dict("axes.linewidth" => 2, "axes.edgecolor" => "black") 
関連する問題