Julia Plot Log色标

问题描述

我正在尝试使用julia函数在plot中以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))

下面是输出。

enter image description here

以下是使用GNUPLOT创建的功能,其颜色为对数刻度。您将如何使用图在Julia中创建图表。

enter image description here

解决方法

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))

enter image description here

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...