我想用 python 中的包制作密度圖PyX。我使用代碼 from pyx import * import numpy import math from pyx.graph import axis g = graph.graphxy(height=8, width=8, x=graph.axis.linear(min=0.0, max=2.0, title=r"$x-axis$"), y=graph.axis.linear(min=0.0, max=2.0, title=r'$y-axis$')) g.plot(graph.data.file("datatotest.dat", xmin=1, xmax=2, ymin=3, ymax=4, color=5, title=r"$bar$"), [graph.style.rect(gradient=color.gradient.Gray)] ) g.writePDFfile()我使用數據 0 1 0 1 0.12 0 1 1 2 0.56 1 2 0 1 0.98 1 2 1 2 0.23我得到了結果我想要更有趣的顏色。但使用時color.gradient.Rainbow會出現錯誤消息:“顏色空間字符串不適用于 hsb 顏色”.color.gradient.Hue.例如,在使用 Reverse 時,我會遇到類似的錯誤。問題:除了灰色之外,還有什么其他顏色漸變可以使用?
添加回答
舉報
0/150
提交
取消