예제 #1
0
 def as_polygons(self, polygons, **kwargs):
     """plot a list of polygons"""
     # use the default values if not user input
     # https://stackoverflow.com/a/6354485/1457481
     options = ChainMap({}, kwargs, self.polygon_defaults)
     # should change this for better support of huge data
     projected_polygons = [
         self._close_polygon(
             np.transpose(
                 self.projection.direct(segment,
                                        invert_positive=False,
                                        rotate=False)))
         for circle in polygons for segment in self._join_segments(
             self._clip_lines(np.dot(circle, self.projection.R.T)))
     ]
     poly_collection = PolyCollection(projected_polygons, **options)
     poly_collection.set_clip_path(self.primitive)
     self.axis.add_collection(poly_collection)
예제 #2
0
파일: os_plot.py 프로젝트: spamlab-iee/os
 def plot_polygons(self, polygons, polygon_settings):
     projected_polygons = [
         au_close_polygon(
             np.transpose(
                 self.project(
                     *np.transpose(segment),
                     invert_positive=False  # , rotate=False
                 )
             )
         )
         for circle in polygons
         for segment in au_join_segments(
             au_clip_lines(np.dot(circle, self.projection.R.T))
         )
     ]
     polygon_segments = PolyCollection(
         projected_polygons, **polygon_settings
     )
     polygon_segments.set_clip_path(self.circle)
     self.plotaxes.add_collection(polygon_segments, autolim=True)
     return polygon_segments