Change color from plot with GPy package

63 Views Asked by At

I made a plot by combining the GPY and matplotlib packages. However, for some reason I can not change the color of the line and the confidence interval, see code below. I changed the color of the plot to red, but nothing happens. In the package documentation is written that "The methods in GPy.plotting (and child classes GPy.plotting.gpy_plot and GPy.plotting.matplot_dep) are not intended to be called directly, but rather are ‘injected’ into other classes (notably GPy.core.gp.GP).", which I thought could be the cause. However, I do not understand what it means or how to solve it. Can anybody help me change the color of the line and the confidence interval?

enter image description here

from matplotlib import pyplot as plt
import GPy
import numpy as np
import GPyOpt

X = np.linspace(0.05,0.95,10)[:,None]
Y = -np.cos(np.pi*X) +np.sin(4*np.pi*X) + np.random.randn(10,1)*0.05
k = GPy.kern.RBF(input_dim=1, variance=1., lengthscale=1.)
m = GPy.models.GPRegression(X,Y,k)
m.optimize()
m.plot(figsize=(14, 10))
plt.savefig('Gaussian.png', color='r')
0

There are 0 best solutions below