Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated style with new show_frame settings #1610

Merged
merged 8 commits into from
Jun 26, 2017
14 changes: 13 additions & 1 deletion holoviews/plotting/bokeh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@
Spikes: SpikesPlot,
Area: AreaPlot,
VectorField: VectorFieldPlot,
Histogram: HistogramPlot,

# Rasters
Image: RasterPlot,
RGB: RGBPlot,
HSV: HSVPlot,
Raster: RasterPlot,
HeatMap: HeatmapPlot,
Histogram: HistogramPlot,
QuadMesh: QuadMeshPlot,

# Paths
Expand Down Expand Up @@ -94,6 +94,15 @@
ElementPlot.show_grid = True
RasterPlot.show_grid = True

ElementPlot.show_frame = True
else:
# Raster types, Path types and VectorField should have frames
for framedcls in [VectorFieldPlot, ContourPlot, PathPlot, PolygonPlot,
RasterPlot, RGBPlot, HSVPlot, QuadMeshPlot, HeatMapPlot]:
framedcls.show_frame = True




AdjointLayoutPlot.registry[Histogram] = SideHistogramPlot
AdjointLayoutPlot.registry[Spikes] = SideSpikesPlot
Expand Down Expand Up @@ -122,6 +131,9 @@ def colormap_generator(palette):
box_line_color='black', outlier_color='black')
options.Scatter = Options('style', color=Cycle(), size=point_size, cmap=dflt_cmap)
options.Points = Options('style', color=Cycle(), size=point_size, cmap=dflt_cmap)
if not config.style_17:
options.Points = Options('plot', show_frame=True)

options.Histogram = Options('style', line_color='black', fill_color=Cycle())
options.ErrorBars = Options('style', color='black')
options.Spread = Options('style', color=Cycle(), alpha=0.6, line_color='black')
Expand Down
15 changes: 14 additions & 1 deletion holoviews/plotting/mpl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ def grid_selector(grid):
SideHistogramPlot.show_grid = True
PointPlot.show_grid = True

MPLPlot.show_frame = True
for framelesscls in [RasterGridPlot, GridPlot,
AdjoinedPlot, Plot3D, CurvePlot, HistogramPlot]:
framelesscls.show_frame = False
else:
# Raster types, Path types and VectorField should have frames
for framedcls in [VectorFieldPlot, ContourPlot, PathPlot, RasterPlot,
QuadMeshPlot, HeatMapPlot, PolygonPlot]:
framedcls.show_frame = True


options = Store.options(backend='matplotlib')
dflt_cmap = 'hot' if config.style_17 else 'fire'
Expand All @@ -181,6 +191,10 @@ def grid_selector(grid):
# Charts
options.Curve = Options('style', color=Cycle(), linewidth=2)
options.Scatter = Options('style', color=Cycle(), marker='o', cmap=dflt_cmap)

if not config.style_17:
options.Points = Options('plot', show_frame=True)

options.ErrorBars = Options('style', ecolor='k')
options.Spread = Options('style', facecolor=Cycle(), alpha=0.6, edgecolor='k', linewidth=0.5)
options.Bars = Options('style', ec='k', color=Cycle())
Expand Down Expand Up @@ -234,4 +248,3 @@ def grid_selector(grid):

# Interface
options.TimeSeries = Options('style', color=Cycle())

9 changes: 0 additions & 9 deletions holoviews/plotting/mpl/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ class CurvePlot(ChartPlot):
If plotted quantity is cyclic and center_cyclic is enabled,
will compute tick labels relative to the center.""")

show_frame = param.Boolean(default=False, doc="""
Disabled by default for clarity.""")

show_grid = param.Boolean(default=False, doc="""
Enable axis grid.""")

Expand Down Expand Up @@ -244,12 +241,6 @@ class HistogramPlot(ChartPlot):
animation.
"""

show_frame = param.Boolean(default=False, doc="""
Disabled by default for clarity.""")

show_grid = param.Boolean(default=False, doc="""
Whether to overlay a grid on the axis.""")

style_opts = ['alpha', 'color', 'align', 'visible', 'facecolor',
'edgecolor', 'log', 'capsize', 'error_kw', 'hatch',
'linewidth']
Expand Down
3 changes: 0 additions & 3 deletions holoviews/plotting/mpl/chart3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ class Plot3D(ColorbarPlot):
projection = param.ObjectSelector(default='3d', objects=['3d'], doc="""
The projection of the matplotlib axis.""")

show_frame = param.Boolean(default=False, doc="""
Whether to draw a frame around the figure.""")

show_grid = param.Boolean(default=True, doc="""
Whether to draw a grid in the figure.""")

Expand Down
7 changes: 1 addition & 6 deletions holoviews/plotting/mpl/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class MPLPlot(DimensionedPlot):
May also supply a custom projection that is either a matplotlib
projection type or implements the `_as_mpl_axes` method.""")

show_frame = param.Boolean(default=True, doc="""
show_frame = param.Boolean(default=False, doc="""
Whether or not to show a complete frame around the plot.""")

_close_figures = True
Expand Down Expand Up @@ -287,9 +287,6 @@ class GridPlot(CompositePlot):
If enabled the x-axes of the GridSpace will be drawn from the
objects inside the Grid rather than the GridSpace dimensions.""")

show_frame = param.Boolean(default=False, doc="""
Whether to draw a frame around the Grid.""")

show_legend = param.Boolean(default=False, doc="""
Legends add to much clutter in a grid and are disabled by default.""")

Expand Down Expand Up @@ -1113,8 +1110,6 @@ class AdjoinedPlot(DimensionedPlot):
border_size = param.Number(default=0.25, doc="""
The size of the border expressed as a fraction of the main plot.""")

show_frame = param.Boolean(default=False)

show_title = param.Boolean(default=False, doc="""
Titles should be disabled on all SidePlots to avoid clutter.""")

Expand Down
12 changes: 6 additions & 6 deletions holoviews/plotting/mpl/seaborn.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from ...interface.seaborn import Regression, TimeSeries, Bivariate, Distribution
from ...interface.seaborn import DFrame as SNSFrame
from ...core.options import Store
from ...core import config
from .element import ElementPlot
from .pandas import DFrameViewPlot
from .plot import MPLPlot, AdjoinedPlot, mpl_rc_context
Expand Down Expand Up @@ -105,9 +106,6 @@ class TimeSeriesPlot(SeabornPlot):
curve.
"""

show_frame = param.Boolean(default=False, doc="""
Disabled by default for clarity.""")

show_legend = param.Boolean(default=True, doc="""
Whether to show legend for the plot.""")

Expand Down Expand Up @@ -138,9 +136,6 @@ class DistributionPlot(SeabornPlot):
apply_ranges = param.Boolean(default=False, doc="""
Whether to compute the plot bounds from the data itself.""")

show_frame = param.Boolean(default=False, doc="""
Disabled by default for clarity.""")

style_opts = ['bins', 'hist', 'kde', 'rug', 'fit', 'hist_kws',
'kde_kws', 'rug_kws', 'fit_kws', 'color']

Expand Down Expand Up @@ -328,3 +323,8 @@ def _update_plot(self, axis, view, style):
DataFrameView: SNSFramePlot}, 'matplotlib')

MPLPlot.sideplots.update({Distribution: SideDistributionPlot})


if config.style_17:
for framelesscls in [TimeSeriesPlot, DistributionPlot]:
framelesscls.show_frame = False