當前位置: 首頁>>代碼示例>>Python>>正文


Python FancyArrowPatch.draw方法代碼示例

本文整理匯總了Python中matplotlib.patches.FancyArrowPatch.draw方法的典型用法代碼示例。如果您正苦於以下問題:Python FancyArrowPatch.draw方法的具體用法?Python FancyArrowPatch.draw怎麽用?Python FancyArrowPatch.draw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在matplotlib.patches.FancyArrowPatch的用法示例。


在下文中一共展示了FancyArrowPatch.draw方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: drawSphere

# 需要導入模塊: from matplotlib.patches import FancyArrowPatch [as 別名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 別名]
def drawSphere(xCenter, yCenter, zCenter, r):
    # draw sphere
    u, v = np.mgrid[0:2 * np.pi:20j, 0:np.pi:10j]
    x = np.cos(u) * np.sin(v)
    y = np.sin(u) * np.sin(v)
    z = np.cos(v)
    # shift and scale sphere
    x = r * x + xCenter
    y = r * y + yCenter
    z = r * z + zCenter
    return (x, y, z) 
開發者ID:jiacheng-xu,項目名稱:vmf_vae_nlp,代碼行數:13,代碼來源:draw_gauss_ball.py

示例2: draw

# 需要導入模塊: from matplotlib.patches import FancyArrowPatch [as 別名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 別名]
def draw(self, renderer):
        xs3d, ys3d, zs3d = self._verts3d
        xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
        self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
        FancyArrowPatch.draw(self, renderer) 
開發者ID:jiacheng-xu,項目名稱:vmf_vae_nlp,代碼行數:7,代碼來源:draw_gauss_ball.py

示例3: draw

# 需要導入模塊: from matplotlib.patches import FancyArrowPatch [as 別名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 別名]
def draw(self, renderer):
            """
            Draw the axis line.
             1) transform the path to the display coordinate.
             2) extend the path to make a room for arrow
             3) update the path of the FancyArrowPatch.
             4) draw
            """
            path_in_disp = self._line_transform.transform_path(self._line_path)
            mutation_size = self.get_mutation_scale() #line_mutation_scale()
            extented_path = self._extend_path(path_in_disp,
                                              mutation_size=mutation_size)

            self._path_original = extented_path
            FancyArrowPatch.draw(self, renderer) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:17,代碼來源:axisline_style.py

示例4: draw

# 需要導入模塊: from matplotlib.patches import FancyArrowPatch [as 別名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 別名]
def draw(self, renderer):
            """Draw the arrow."""
            xs3d, ys3d, zs3d = self._verts3d
            xs, ys, _ = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
            self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
            FancyArrowPatch.draw(self, renderer) 
開發者ID:Qiskit,項目名稱:qiskit-terra,代碼行數:8,代碼來源:state_visualization.py

示例5: draw

# 需要導入模塊: from matplotlib.patches import FancyArrowPatch [as 別名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 別名]
def draw(self, renderer):
        xs3d, ys3d, zs3d = self._verts3d
        xs, ys, _ = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
        self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
        FancyArrowPatch.draw(self, renderer)


############################################################################### 
開發者ID:empymod,項目名稱:empymod,代碼行數:10,代碼來源:coordinate_system.py

示例6: draw

# 需要導入模塊: from matplotlib.patches import FancyArrowPatch [as 別名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 別名]
def draw(self, renderer):
    xs3d, ys3d, zs3d = self._verts3d
    xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
    self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
    FancyArrowPatch.draw(self, renderer) 
開發者ID:ethz-asl,項目名稱:hand_eye_calibration,代碼行數:7,代碼來源:hand_eye_calibration_plotting_tools.py

示例7: draw

# 需要導入模塊: from matplotlib.patches import FancyArrowPatch [as 別名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 別名]
def draw(self, renderer):
            """
            Draw the axis line.
             1) transform the path to the display coordinate.
             2) extend the path to make a room for arrow
             3) update the path of the FancyArrowPatch.
             4) draw
            """
            path_in_disp = self._line_transform.transform_path(self._line_path)
            mutation_size = self.get_mutation_scale()  # line_mutation_scale()
            extended_path = self._extend_path(path_in_disp,
                                              mutation_size=mutation_size)
            self._path_original = extended_path
            FancyArrowPatch.draw(self, renderer) 
開發者ID:boris-kz,項目名稱:CogAlg,代碼行數:16,代碼來源:axisline_style.py

示例8: plot_samples_3D

# 需要導入模塊: from matplotlib.patches import FancyArrowPatch [as 別名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 別名]
def plot_samples_3D(self):
        """
        Plots the orientations in a sphere.
        Returns: Nothing, it just plots.
        """
        # (this code is partially from stackoverflow)
        fig = plt.figure(figsize=[5, 5])
        ax = fig.gca(projection='3d')
        ax.set_aspect("equal")
        ax.view_init(azim=30)

        # render the sphere mesh
        u, v = np.mgrid[0:2 * np.pi:20j, 0:np.pi:10j]
        # print(u,v)
        x = np.cos(u) * np.sin(v)
        y = np.sin(u) * np.sin(v)
        z = np.cos(v)
        ax.plot_wireframe(x, y, z, color="lightgray")
        plt.axis('on')

        # coordinate system in centre of sphere
        origin = [0, 0, 0]
        X, Y, Z = [1, 0, 0], [0, 1, 0], [0, 0, 1]
        O, O, O = zip(origin, origin, origin)
        X, Y, Z = zip(X, Y, Z)
        ax.quiver(O, O, O, X, Y, Z, arrow_length_ratio=0.1, color='k')

        ax.set_xlabel('X')
        ax.set_ylabel('Y')
        ax.set_zlabel('Z')

        class Arrow3D(FancyArrowPatch):
            def __init__(self, xs, ys, zs, *args, **kwargs):
                FancyArrowPatch.__init__(self, (0, 0), (0, 0), *args, **kwargs)
                self._verts3d = xs, ys, zs

            def draw(self, renderer):
                xs3d, ys3d, zs3d = self._verts3d
                xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
                self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
                FancyArrowPatch.draw(self, renderer)

        # Plot arrows
        for i in self.samples_xyz:
            ax.add_artist(Arrow3D([0, i[0]], [0, i[1]], [0, i[2]], mutation_scale=20, lw=1, arrowstyle="-|>",
                                  color="darkgreen"))  # samples
        try:
            ax.add_artist(
                Arrow3D([0, self.mean[0]], [0, self.mean[1]], [0, self.mean[2]], mutation_scale=20, lw=1, arrowstyle="-|>",
                        color="darkorange"))  # mean
        except AttributeError:
            pass
        plt.show()
        return fig 
開發者ID:cgre-aachen,項目名稱:gempy,代碼行數:56,代碼來源:fishdist.py


注:本文中的matplotlib.patches.FancyArrowPatch.draw方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。