Python Drawing Diary __python

Source: Internet
Author: User
# #!/usr/bin/env Python #-*-coding:utf-8-*-# "" "# @version: python2.7.8 # @author: Xiangguosun # @contact: Sunxian Gguodut@qq.com # @file: 4.py # @time: 2017/2/16 11:07 # @software: Pycharm # "" "Import sys reload (SYS) Sys.setdefaultenco

Ding (' utf-8 ') import NumPy as NP import Matplotlib.pyplot as PLT from Mpl_toolkits.mplot3d.art3d import poly3dcollection
    def randrange (n, Vmin, Vmax): Return Np.random.randint (Vmin,vmax,n) def fun (Ax,ben,color,n): Zl, en = (0, 100) x5 = Randrange (n, 0) Y5 = Randrange (n, 0) Z5=randrange (n,5,6) Ax.scatter (X5, Y5, Z5,s=50,c=color,m Arker= ' o ') Poly3d = [[(0, 0, Ben), (0, Ben), (MB, Ben), (0, Ben)]] Ax.add_collection3d (poly3dcoll Ection (Poly3d, Facecolors=color, Linewidths=1, alpha=0.2)) FIG = plt.figure () ax = FIG.GCA (projection= ' 3d ') Fun (ax,5, "re  D "," Fun (ax,50, "green",) Fun (ax,90, "Blue", "n" = color= "Yellow" Zl, en = (0) xa = randrange (n, 0, m) ya = Randrange (n, 0,) za= Randrange (N, Zl, en) ax.scatter (xa, ya, za,s=50,c=color,marker= ' o ') ax.set_xlabel (' $x ^{(1)}$ ', size=20) # $x ^{(1)}$ is latex expression ax.set_xlim3d (0) Ax.set_ylabel (' $x ^{(2)}$ ', size=20) Ax.set_ylim3d (0,100) Ax.set_zlabel (' $z $ ', size=20 ) Ax.set_zlim3d (0,100) plt.show ()



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.