【问题标题】:Julia Plot Log colorscaleJulia Plot Log 色标
【发布时间】:2020-08-11 20:58:37
【问题描述】:

我正在尝试使用plot 函数在julia 中构建一个颜色为log10 比例的3D 曲面图。我只希望颜色在 log10 比例而不是实际值本身。

using Plots
N = 51
x = range(-10, stop = 10, length = N)
y = x
f(x,y)=x^2+y^2
Plots.plot(x,y,f,st=:surface,color=:jet,camera=(25,65))

下面是输出。

下面是使用GNUPLOT 创建的相同函数,颜色为对数刻度。您将如何使用 plot 在Julia 中创建图表。

【问题讨论】:

    标签: plot julia surface


    【解决方案1】:

    Colors 支持带有logscale=true 参数的调色板,例如:

    using Colors
    
    Plots.plot(x,y,f,st=:surface,color=Colors.diverging_palette(20,300,20, logscale=true,  wcolor=colorant"red",dcolor1=colorant"green", dcolor2=colorant"red", b=0.1,d1=1.0,d2=1.0),camera=(25,65))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-18
      • 2017-10-07
      • 1970-01-01
      相关资源
      最近更新 更多