是否可以在 python 的 guiqwt 模块中使用您自己的颜色(可能由十六进制代码指定)?我的意思是这样的:
my_colour = '#EE686B'
figure('my figure')
plot(x, y, '-', color = my_colour)
show()
非常感谢您提前。
Sure, I don't see the problem in your code. I don't know the guiqwt module but try using Matplotlib: http://matplotlib.sourceforge.net/api/colors_api.html
You can also try this color table:
from PyQt4 import QtCore, QtGui
red = QtGui.QColor(200, 0, 0)
green = QtGui.QColor(0, 200, 0)
blue = QtGui.QColor(0, 0, 200)
black = QtGui.QColor(0, 0, 0)
white = QtGui.QColor(255, 255, 255, 0)
试试这个例子:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-10, 10)
plt.plot(x, x**2, 'r+')
plt.show()