mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-03 16:52:39 +02:00
[plotting] got the old way in again
This commit is contained in:
parent
327ed46c6e
commit
b236896fbd
4 changed files with 10 additions and 5 deletions
|
|
@ -13,6 +13,7 @@ def change_plotting_library(lib):
|
|||
if lib == 'matplotlib':
|
||||
import matplotlib
|
||||
from .matplot_dep.plot_definitions import MatplotlibPlots
|
||||
from .matplot_dep import visualize, mapping_plots, priors_plots, ssgplvm, svig_plots, variational_plots, img_plots
|
||||
current_lib[0] = MatplotlibPlots()
|
||||
if lib == 'plotly':
|
||||
import plotly
|
||||
|
|
@ -22,10 +23,11 @@ def change_plotting_library(lib):
|
|||
current_lib[0] = None
|
||||
#===========================================================================
|
||||
except (ImportError, NameError):
|
||||
raise
|
||||
config.set('plotting', 'library', 'none')
|
||||
import warnings
|
||||
warnings.warn(ImportWarning("{} not available, install newest version of {} for plotting".format(lib, lib)))
|
||||
|
||||
|
||||
from ..util.config import config
|
||||
lib = config.get('plotting', 'library')
|
||||
change_plotting_library(lib)
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ def get_x_y_var(model):
|
|||
and Y the outputs
|
||||
|
||||
If (X, X_variance, Y) is given, this just returns.
|
||||
|
||||
|
||||
:returns: (X, X_variance, Y)
|
||||
"""
|
||||
# model given
|
||||
|
|
@ -285,7 +285,10 @@ def get_x_y_var(model):
|
|||
else:
|
||||
X = model.X.values
|
||||
X_variance = None
|
||||
Y = model.Y.values
|
||||
try:
|
||||
Y = model.Y.values
|
||||
except AttributeError:
|
||||
Y = model.Y
|
||||
if sparse.issparse(Y): Y = Y.todense().view(np.ndarray)
|
||||
return X, X_variance, Y
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ try:
|
|||
from matplotlib import pyplot as pb
|
||||
except:
|
||||
pass
|
||||
from .base_plots import x_frame1D, x_frame2D
|
||||
|
||||
|
||||
def plot_mapping(self, plot_limits=None, which_data='all', which_parts='all', resolution=None, levels=20, samples=0, fignum=None, ax=None, fixed_inputs=[], linecol=Tango.colorsHex['darkBlue']):
|
||||
|
|
@ -52,6 +51,7 @@ def plot_mapping(self, plot_limits=None, which_data='all', which_parts='all', re
|
|||
ax = fig.add_subplot(111)
|
||||
|
||||
plotdims = self.input_dim - len(fixed_inputs)
|
||||
from ..gpy_plot.plot_util import x_frame1D, x_frame2D
|
||||
|
||||
if plotdims == 1:
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ def plot_SpikeSlab(parameterized, fignum=None, ax=None, colors=None, side_by_sid
|
|||
a.set_xticklabels('')
|
||||
# binary prob plot
|
||||
a = fig.add_subplot(*sub2)
|
||||
a.bar(x,gamma[:,i],bottom=0.,linewidth=0,width=1.0,align='center')
|
||||
a.bar(x,gamma[:,i],bottom=0.,linewidth=1.,width=1.0,align='center')
|
||||
a.set_xlim(x.min(), x.max())
|
||||
a.set_ylim([0.,1.])
|
||||
pb.draw()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue