def plot_circles(self, circles, circle_settings): projected_circles = \ [segment for circle in circles for segment in clip_lines(np.transpose(self.project(*circle.T, invert_positive=False)))] circle_segments = LineCollection(projected_circles, **circle_settings) circle_segments.set_clip_path(self.circle) self.plotaxes.add_collection(circle_segments, autolim=True) return circle_segments
def plot_circles(self, circles, **kwargs): """plot a list of circles, either great or small""" # use the default values if not user input # https://stackoverflow.com/a/6354485/1457481 options = dict(self.circle_defaults.items() + kwargs.items()) # should change this for better support of huge data projected_circles = [ np.transpose( self.project(segment, invert_positive=False, rotate=False)) for circle in circles for segment in clip_lines(self.rotate(circle)) ] circle_collection = LineCollection(projected_circles, **options) circle_collection.set_clip_path(self.primitive) self.axis.add_collection(circle_collection)
def as_lines(self, lines, **kwargs): """plot a list of lines""" # use the default values if not user input # https://stackoverflow.com/a/6354485/1457481 options = ChainMap({}, kwargs, self.line_defaults) # should change this for better support of huge data projected_lines = [ np.transpose( self.projection.direct(segment, invert_positive=False, rotate=False)) for circle in lines for segment in self._join_segments( self._clip_lines(np.dot(circle, self.projection.R.T))) ] circle_collection = LineCollection(projected_lines, **options) circle_collection.set_clip_path(self.primitive) self.axis.add_collection(circle_collection)