[plotting] library is unfolding and should be working tonight

This commit is contained in:
mzwiessele 2015-10-03 13:59:01 +01:00
parent a6c0d82ef7
commit c3afb4eaaf
13 changed files with 648 additions and 263 deletions

View file

@ -2,14 +2,23 @@
# Licensed under the BSD 3-clause license (see LICENSE.txt)
try:
#===========================================================================
# Load in your plotting library here and
# save it under the name plotting_library!
# This is hooking the library in
# for the usage in GPy:
from ..util.config import config
lib = config.get('plotting', 'library')
if lib == 'matplotlib':
import matplotlib
from . import matplot_dep as plotting_library
from .matplot_dep import plot_definitions
plotting_library = plot_definitions.MatplotlibPlots()
#===========================================================================
except (ImportError, NameError):
raise
import warnings
warnings.warn(ImportWarning("{} not available, install newest version of {} for plotting").format(lib, lib))
warnings.warn(ImportWarning("{} not available, install newest version of {} for plotting".format(lib, lib)))
config.set('plotting', 'library', 'none')
if config.get('plotting', 'library') is not 'none':
@ -20,12 +29,15 @@ if config.get('plotting', 'library') is not 'none':
from ..core import GP
GP.plot_data = gpy_plot.data_plots.plot_data
GP.plot_mean = gpy_plot.gp_plots.plot_mean
GP.plot_confidence = gpy_plot.gp_plots.plot_confidence
from . import matplot_dep
# Still to convert to new style:
GP.plot = plotting_library.models_plots.plot_fit
GP.plot_f = plotting_library.models_plots.plot_fit_f
GP.plot_density = plotting_library.models_plots.plot_density
GP.plot = matplot_dep.models_plots.plot_fit
GP.plot_f = matplot_dep.models_plots.plot_fit_f
GP.plot_density = matplot_dep.models_plots.plot_density
GP.plot_errorbars_trainset = plotting_library.models_plots.plot_errorbars_trainset
GP.plot_magnification = plotting_library.dim_reduction_plots.plot_magnification
GP.plot_errorbars_trainset = matplot_dep.models_plots.plot_errorbars_trainset
GP.plot_magnification = matplot_dep.dim_reduction_plots.plot_magnification