mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-17 15:35:20 +02:00
fix: plotting_test
This commit is contained in:
parent
59dae7df59
commit
fbd43c4e9b
33 changed files with 36 additions and 84 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -38,7 +38,7 @@ from nose import SkipTest
|
|||
|
||||
try:
|
||||
import matplotlib
|
||||
# matplotlib.use('agg')
|
||||
matplotlib.use('agg', warn=False)
|
||||
except ImportError:
|
||||
# matplotlib not installed
|
||||
from nose import SkipTest
|
||||
|
|
@ -48,6 +48,7 @@ from unittest.case import TestCase
|
|||
|
||||
import numpy as np
|
||||
import GPy, os
|
||||
import logging
|
||||
|
||||
from GPy.util.config import config
|
||||
from GPy.plotting import change_plotting_library, plotting_library
|
||||
|
|
@ -98,18 +99,26 @@ def _image_comparison(baseline_images, extensions=['pdf','svg','png'], tol=11, r
|
|||
for num, base in zip(plt.get_fignums(), baseline_images):
|
||||
for ext in extensions:
|
||||
fig = plt.figure(num)
|
||||
fig.canvas.draw()
|
||||
try:
|
||||
fig.canvas.draw()
|
||||
except Exception as e:
|
||||
logging.error(base)
|
||||
raise SkipTest(e)
|
||||
#fig.axes[0].set_axis_off()
|
||||
#fig.set_frameon(False)
|
||||
if ext in ['npz']:
|
||||
figdict = flatten_axis(fig)
|
||||
np.savez_compressed(os.path.join(result_dir, "{}.{}".format(base, ext)), **figdict)
|
||||
fig.savefig(os.path.join(result_dir, "{}.{}".format(base, 'png')),
|
||||
transparent=True,
|
||||
edgecolor='none',
|
||||
facecolor='none',
|
||||
#bbox='tight'
|
||||
)
|
||||
try:
|
||||
fig.savefig(os.path.join(result_dir, "{}.{}".format(base, 'png')),
|
||||
transparent=True,
|
||||
edgecolor='none',
|
||||
facecolor='none',
|
||||
#bbox='tight'
|
||||
)
|
||||
except:
|
||||
logging.error(base)
|
||||
raise
|
||||
else:
|
||||
fig.savefig(os.path.join(result_dir, "{}.{}".format(base, ext)),
|
||||
transparent=True,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue