rotation=rotation, **opts)] # Register plots with HoloViews Store.register({LineContours: LineContourPlot, FilledContours: FilledContourPlot, Image: GeoImagePlot, Feature: FeaturePlot, WMTS: WMTSPlot, Tiles: WMTSPlot, Points: GeoPointPlot, Labels: GeoLabelsPlot, VectorField: GeoVectorFieldPlot, Text: GeoTextPlot, Layout: LayoutPlot, NdLayout: LayoutPlot, Overlay: GeoOverlayPlot, Polygons: GeoPolygonPlot, Path: GeoPathPlot, Contours: GeoContourPlot, RGB: GeoRGBPlot, Shape: GeoShapePlot, Graph: GeoGraphPlot, TriMesh: GeoTriMeshPlot, Nodes: GeoPointPlot, EdgePaths: GeoPathPlot, HexTiles: GeoHexTilesPlot, QuadMesh: GeoQuadMeshPlot}, 'matplotlib') # Define plot and style options options = Store.options(backend='matplotlib')
class GeoTextPlot(GeoAnnotationPlot, TextPlot): "Draw the Text annotation object" def draw_annotation(self, axis, data, crs, opts): (x,y, text, fontsize, horizontalalignment, verticalalignment, rotation) = data opts['fontsize'] = fontsize x, y = axis.projection.transform_point(x, y, src_crs=crs) return [axis.text(x, y, text, horizontalalignment=horizontalalignment, verticalalignment=verticalalignment, rotation=rotation, **opts)] # Register plots with HoloViews Store.register({Contours: GeoContourPlot, Image: GeoImagePlot, GeoFeature: GeoFeaturePlot, WMTS: WMTSPlot, GeoTiles: GeoTilePlot, Points: GeoPointPlot, Text: GeoTextPlot, Layout: LayoutPlot, Overlay: OverlayPlot}, 'matplotlib') # Define plot and style options opts = Store.options(backend='matplotlib') OverlayPlot.aspect = 'equal'
horizontalalignment=horizontalalignment, verticalalignment=verticalalignment, rotation=rotation, **opts) ] # Register plots with HoloViews Store.register( { LineContours: LineContourPlot, FilledContours: FilledContourPlot, Image: GeoImagePlot, Feature: FeaturePlot, WMTS: WMTSPlot, Tiles: TilePlot, Points: GeoPointPlot, Text: GeoTextPlot, Layout: LayoutPlot, NdLayout: LayoutPlot, Overlay: OverlayPlot, Polygons: GeoPolygonPlot, Path: GeoPathPlot, Shape: GeoShapePlot }, 'matplotlib') # Define plot and style options options = Store.options(backend='matplotlib') options.Shape = Options('style', edgecolor='black', facecolor='#30A2DA')
opts['fontsize'] = fontsize x, y = axis.projection.transform_point(x, y, src_crs=crs) return [ axis.text(x, y, text, horizontalalignment=horizontalalignment, verticalalignment=verticalalignment, rotation=rotation, **opts) ] # Register plots with HoloViews Store.register( { Contours: GeoContourPlot, Image: GeoImagePlot, GeoFeature: GeoFeaturePlot, WMTS: WMTSPlot, GeoTiles: GeoTilePlot, Points: GeoPointPlot, Text: GeoTextPlot, Layout: LayoutPlot, Overlay: OverlayPlot }, 'matplotlib') # Define plot and style options opts = Store.options(backend='matplotlib') OverlayPlot.aspect = 'equal'