Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GPy/plotting/matplot_dep/plot_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def add_to_canvas(self, ax, plots, legend=False, title=None, **kwargs):
#ax.legend(prop=fontdict)
legend_ontop(ax, ncol=legend, fontdict=fontdict)
if title is not None: ax.figure.suptitle(title)
return plots
return ax

def show_canvas(self, ax, **kwargs):
ax.figure.canvas.draw()
Expand Down
17 changes: 17 additions & 0 deletions GPy/testing/plotting_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,23 @@ def test_plot():
'samples', 'in_error']], extensions=extensions):
yield (do_test, )


def test_show():
np.random.seed(111)
import matplotlib
matplotlib.rcParams.update(matplotlib.rcParamsDefault)
matplotlib.rcParams[u'text.usetex'] = False
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore")
X = np.random.uniform(-3.,3.,(20,1))
Y = np.sin(X) + np.random.randn(20,1)*0.05
kernel = GPy.kern.RBF(input_dim=1, variance=1., lengthscale=1.)
m = GPy.models.GPRegression(X,Y,kernel)
fig = m.plot()
GPy.plotting.show(fig, filename='show fig test')


def test_twod():
np.random.seed(11111)
import matplotlib
Expand Down