有没有办法在 IDL 中创建一个带有颜色渐变的绘图?我正在寻找的是类似于这个 Matlab question。我知道如何做的最好的事情是在for
循环中绘制线的每一段,但这似乎相当麻烦:
x = float(indgen(11) - 5)
y = x ^ 2
loadct, 2, /silent
!p.background = 255
plot, x, y
for i = 0, 9 do begin
oplot, x(i:i+1), y(i:i+1), color = i * 20, thick = 4
endfor
如果有区别,我正在使用 IDL 8.2。