当前位置: 首页>>代码示例>>Python>>正文


Python Circle.set_clip_path方法代码示例

本文整理汇总了Python中matplotlib.patches.Circle.set_clip_path方法的典型用法代码示例。如果您正苦于以下问题:Python Circle.set_clip_path方法的具体用法?Python Circle.set_clip_path怎么用?Python Circle.set_clip_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.patches.Circle的用法示例。


在下文中一共展示了Circle.set_clip_path方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: draw_vswr_circles

# 需要导入模块: from matplotlib.patches import Circle [as 别名]
# 或者: from matplotlib.patches.Circle import set_clip_path [as 别名]
    def draw_vswr_circles(self, vswr_radii, labels=False):
        for r in vswr_radii:
            c = Circle((0, 0), r, ls='dashed', **self.patch_options_light)

            c.set_clip_path(self.smith_circle)
            c.set_clip_box(self.ax.bbox)
            self.ax.add_patch(c)

        if labels:
            for r in vswr_radii:
                if r > 0:
                    vswr = (1 + r)/(1 - r)
                    self.ax.text(0, r, '%.1f' % vswr, **self.label_options)
开发者ID:fuesika,项目名称:PyTwoPort,代码行数:15,代码来源:smithplot.py

示例2: draw_chart_axes

# 需要导入模块: from matplotlib.patches import Circle [as 别名]
# 或者: from matplotlib.patches.Circle import set_clip_path [as 别名]
    def draw_chart_axes(self):
        # make outer circle
        self.smith_circle = Circle((0, 0), 1, transform=self.ax.transData, fc='none',
                              **self.patch_options_axis)
        self.ax.add_patch(self.smith_circle)

        # make constant r=1 circle
        z0_circle = Circle((0.5, 0), 0.5, transform=self.ax.transData, fc='none',
                              **self.patch_options_axis)
        z0_circle.set_clip_path(self.smith_circle)
        z0_circle.set_clip_box(self.ax.bbox)
        self.ax.add_patch(z0_circle)

        # make x-axis
        line = Line2D([-1,1],[0,0], **self.patch_options_axis)
        line.set_clip_path(self.smith_circle)
        line.set_clip_box(self.ax.bbox)
        self.ax.add_line(line)
开发者ID:fuesika,项目名称:PyTwoPort,代码行数:20,代码来源:smithplot.py

示例3: draw_impedance_circles

# 需要导入模块: from matplotlib.patches import Circle [as 别名]
# 或者: from matplotlib.patches.Circle import set_clip_path [as 别名]
    def draw_impedance_circles(self, intercept_x_coords, intercept_angles, labels=False):
        r_circle_coords, x_circle_coords, rs, xs = self._impedance_circle_coords(intercept_x_coords, intercept_angles)

        for center, radius in chain(r_circle_coords, x_circle_coords):
            c = Circle(center, radius, **self.patch_options_dark)

            c.set_clip_path(self.smith_circle)
            c.set_clip_box(self.ax.bbox)
            self.ax.add_patch(c)

        if labels:
            for x, r in zip(intercept_x_coords, rs):
                self.ax.text(x + 0.04, 0.03, '%.0f' % round(self.z0*r), **self.label_options)

            for a, x in zip(intercept_angles, xs):
                r = (a - 90) if x > 0 else (a + 90)
                a = np.radians(a)
                d = 1.04

                self.ax.text(d*cos(a), d*sin(a), '%.0fj' % round(self.z0*x), rotation=r, **self.label_options)
开发者ID:fuesika,项目名称:PyTwoPort,代码行数:22,代码来源:smithplot.py

示例4: draw_admittance_circles

# 需要导入模块: from matplotlib.patches import Circle [as 别名]
# 或者: from matplotlib.patches.Circle import set_clip_path [as 别名]
    def draw_admittance_circles(self, intercept_x_coords, intercept_angles, labels=False):
        r_circle_coords, x_circle_coords, rs, xs = self._impedance_circle_coords(intercept_x_coords, intercept_angles)

        # admittance circles have same coords as impedance ones, except flipped
        # on the y-axis
        for (x, y), radius in chain(r_circle_coords, x_circle_coords):
            c = Circle((-x, -y), radius, **self.patch_options_light)

            c.set_clip_path(self.smith_circle)
            c.set_clip_box(self.ax.bbox)
            self.ax.add_patch(c)

        if labels:
            for x, r in zip(intercept_x_coords, rs):
                self.ax.text(-x, 0, '%.1f' % (1/(50*r)), **self.label_options)

            for a, x in zip(intercept_angles, xs):
                r = (a - 90) if x < 0 else (a + 90)
                a = np.radians(a)

                self.ax.text(cos(pi - a), sin(pi - a), '%.1f' % (1/(50*x)), rotation=r, **self.label_options)
开发者ID:fuesika,项目名称:PyTwoPort,代码行数:23,代码来源:smithplot.py


注:本文中的matplotlib.patches.Circle.set_clip_path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。