利用python/R语言绘制圣诞树实例代码

目录
  • Python
  • R语言
  • 总结

圣诞节快到了,想着用python、r来画画圣诞树玩,就在网络上各种找方法,不喜勿喷哈~~

Python

1、

import turtle

screen = turtle.Screen()
screen.setup(800,600)

circle = turtle.Turtle()
circle.shape('circle')
circle.color('red')
circle.speed('fastest')
circle.up()

square = turtle.Turtle()
square.shape('square')
square.color('green')
square.speed('fastest')
square.up()

circle.goto(0,280)
circle.stamp()

k = 0
for i in range(1, 17):
    y = 30*i
    for j in range(i-k):
        x = 30*j
        square.goto(x,-y+280)
        square.stamp()
        square.goto(-x,-y+280)
        square.stamp()

    if i % 4 == 0:
        x =  30*(j+1)
        circle.color('red')
        circle.goto(-x,-y+280)
        circle.stamp()
        circle.goto(x,-y+280)
        circle.stamp()
        k += 2

    if i % 4 == 3:
        x =  30*(j+1)
        circle.color('yellow')
        circle.goto(-x,-y+280)
        circle.stamp()
        circle.goto(x,-y+280)
        circle.stamp() 

square.color('brown')
for i in range(17,20):
    y = 30*i
    for j in range(3):
        x = 30*j
        square.goto(x,-y+280)
        square.stamp()
        square.goto(-x,-y+280)
        square.stamp()        

turtle.exitonclick()

2、

import random
height = 11
for i in range(height):
    print(' ' * (height - i), end='')
    for j in range((2 * i) + 1):
        if random.random() < 0.1:
            color = random.choice(['\033[1;31m', '\033[33m', '\033[1;34m'])
            print(color, end='')  #  the lights
        else:
            print('\033[32m', end='')  #  green
        print('*', end='')
    print()
print((' ' * height) + '|')

3、

n = 50
from turtle import *
speed("fastest")  #没有这一行,会very very慢
left(90)
forward(3*n)
color("orange", "yellow")
begin_fill()
left(126)
for i in range(5):
    forward(n/5)
    right(144)
    forward(n/5)
    left(72)
end_fill()
right(126)
color("dark green")
backward(n*4.8)
def tree(d, s):
    if d <= 0: return
    forward(s)
    tree(d-1, s*.8)
    right(120)
    tree(d-3, s*.5)
    right(120)
    tree(d-3, s*.5)
    right(120)
    backward(s)
tree(15, n)
backward(n/2)

 

4、

def paintleaves(m):
    for i in range(m):
        if(i == 10):
            print( ' '*(m-i) + '*'*( 2*i + 1-len( 'happy Christmas')) + 'happy Christmas'+ ' '*(m-i))
            continue
        if(i == 20):
            print( ' '*(m-i) + '*'*( 2*i + 1-len( 'I Love You')) +'I Love You'+ ' '*(m-i))
            continue
        if(i == m-1):
            print( ' '*(m-i) + 'liang yu'+ '*'*( 2*i + 1-len( 'liang yu')) + ' '*(m-i))
            continue
        print(' '*(m-i) + '*'*(2*i + 1) + ' '*(m-i))
def paintTrunk(n):
    for j in range (8 ):
        print(' '*(n - 5) + '*'*10 + ' '*(n - 5))
paintleaves(25)
paintTrunk(25)

 

5、

#!/usr/bin/env python
# coding:utf-8
import os
import sys
import platform
import random
import time

class UI(object):
    def __init__(self):
        os_name = platform.uname()[0]
        self.IS_WIN = os_name == 'Windows'
        self.IS_MAC = os_name == 'Darwin'
        print(os_name)
        if self.IS_WIN:
            self.RED = 0x0C
            self.GREY = 0x07
            self.BLUE = 0x09
            self.CYAN = 0x0B
            self.LINK = 0x30
            self.BLACK = 0x0
            self.GREEN = 0x0A
            self.WHITE = 0x0F
            self.PURPLE = 0x0D
            self.YELLOW = 0x0E
        else:
            self.RED = '\033[1;31m'
            self.GREY = '\033[38m'
            self.BLUE = '\033[1;34m'
            self.CYAN = '\033[36m'
            self.LINK = '\033[0;36;4m'
            self.BLACK = '\033[0m'
            self.GREEN = '\033[32m'
            self.WHITE = '\033[37m'
            self.PURPLE = '\033[35m'
            self.YELLOW = '\033[33m'
        self.p = self.win_print if self.IS_WIN else self.os_print

    def clear(self):
        os.system('cls' if self.IS_WIN else 'clear')
        return self

    def win_reset(self, color):
        from ctypes import windll
        handler = windll.kernel32.GetStdHandle(-11)
        return windll.kernel32.SetConsoleTextAttribute(handler, color)

    def win_print(self, msg, color, enter=True):
        color = color or self.BLACK
        self.win_reset(color | color | color)
        sys.stdout.write(('%s\n' if enter else '%s') % msg)
        self.win_reset(self.RED | self.GREEN | self.BLUE)
        return self

    def os_print(self, msg, color, enter=True):
        color = color or self.BLACK
        sys.stdout.write(
            ('%s%s%s\n' if enter else '%s%s%s') % (color, msg, self.BLACK))
        return self

def tree(ui, level=3):
    a = range(0, (level + 1) * 4, 2)
    b = list(a[0:2])
    print(b)
    for i in range(2, len(a) - 2, 2):
        b.append(a[i])
        b.append(a[i + 1])
        b.append(a[i])
        b.append(a[i + 1])
    b.append(a[-2])
    b.append(a[-1])
    light = True
    while True:
        ui.clear()
        ui.p(u'\t圣诞节快乐!\n\t\t\tLiang Yu.Shi 2021', ui.RED)
        print
        light = not light
        lamp(ui, b, light)
        for i in range(2, len(b)):
            ui.p(
                '%s/' % (' ' * b[len(b) - i - 1]), ui.GREEN, enter=False)
            neon(ui, 2 * b[i] + 1)
            ui.p('\\', ui.GREEN, enter=True)
        time.sleep(1.2)

def neon(ui, space_len):
    colors = [ui.RED, ui.GREY, ui.BLUE, ui.CYAN, ui.YELLOW]
    for i in range(space_len):
        if random.randint(0, 16) == 5:
            ui.p('o', colors[random.randint(0, len(colors) - 1)], enter=False)
        else:
            ui.p(' ', ui.RED, enter=False)

def lamp(ui, tree_arr, light):
    colors = [ui.WHITE, ui.BLUE]
    if not light:
        colors.reverse()
    ui.p(' ' * (tree_arr[-1] + 1), ui.BLACK, enter=False)
    ui.p('|', colors[1])
    ui.p(' ' * tree_arr[-1], ui.BLACK, enter=False)
    ui.p('\\', colors[1], enter=False)
    ui.p('|', colors[0], enter=False)
    ui.p('/', colors[1])
    ui.p(' ' * tree_arr[-2], ui.BLACK, enter=False)
    ui.p('-', colors[0], enter=False)
    ui.p('-', colors[1], enter=False)
    ui.p('=', colors[0], enter=False)
    ui.p('O', colors[1], enter=False)
    ui.p('=', colors[0], enter=False)
    ui.p('-', colors[1], enter=False)
    ui.p('-', colors[0], enter=True)

    ui.p(' ' * tree_arr[-1], ui.BLACK, enter=False)
    ui.p('/', colors[1], enter=False)
    ui.p('|', colors[0], enter=False)
    ui.p('\\', colors[1])
    ui.p(' ' * tree_arr[-2], ui.BLACK, enter=False)
    ui.p('/  ', ui.GREEN, enter=False)
    ui.p('|', colors[1], enter=False)
    ui.p('  \\', ui.GREEN, enter=True)

def main():
    ui = UI()
    max_rows = 4
    tree(ui, max_rows)

main()

 

这个在使用python运行的时候,要用Python2,python3的话,颜色是不会变的。 嗯,最起码我是这样的。

6、

import argparse
import os
import random
import time

BALL = '⏺'
COLOR = {
    'blue': '\033[94m',
    'yellow': '\033[93m',
    'cyan': '\033[96m',
    'green': '\033[92m',
    'magenta': '\033[95m',
    'white': '\033[97m',
    'red': '\033[91m'
}
STAR = '★'

def random_change_char(string, value):
    indexes = random.sample(range(0, len(string)), value)
    string = list(string)
    for idx in indexes:
        if string[idx] != ' ' and string[idx] == '_':
            string[idx] = BALL
    return ''.join(string)

def tree(height=13, screen_width=80):
    star = (STAR, 3*STAR)
    if height % 2 != 0:
        height += 1
    body = ['/_\\', '/_\_\\']
    trunk = '[___]'
    begin = '/'
    end = '\\'
    pattern = '_/'
    j = 5
    for i in range(7, height + 1, 2):
        middle = pattern + (i - j) * pattern
        line = ''.join([begin, middle[:-1], end])
        body.append(line)
        middle = middle.replace('/', '\\')
        line = ''.join([begin, middle[:-1], end])
        body.append(line)
        j += 1

    return [line.center(screen_width) for line in (*star, *body, trunk)]

def balls(tree):
    for idx, _ in enumerate(tree[:-3], 2):
        tree[idx] = random_change_char(tree[idx], len(tree[idx])//8)
    return tree

def colored_stars_balls(tree):
    for idx, _ in enumerate(tree):
        string = list(tree[idx])
        for pos, _ in enumerate(string):
            if string[pos] == STAR:
                string[pos] = ''.join([COLOR['yellow'], STAR, '\033[0m'])
            elif string[pos] == BALL:
                string[pos] = ''.join([random.choice(list(COLOR.values())), BALL, '\033[0m'])
        tree[idx] = ''.join(string)
    return tree

def cli():
    parser = argparse.ArgumentParser(prog="Python Christmas Tree by Chico Lucio from Ciencia Programada",
                                     epilog="Ctrl-C interrupts the Christmas :-(")
    parser.add_argument('-s', '--size', default=13, type=int,
                        help="Tree height. If even it will be subtracted 1. If less than 7, considered 5. Default: 13")
    parser.add_argument('-w', '--width', default=80, type=int,
                        help="Screen width. Used to center the tree. Default: 80")
    parser.add_argument('-t', '--terminal', action='store_true',
                        help="Uses the terminal size to center the tree. -s and -w will be ignored")
    args = parser.parse_args()

    if args.terminal:
        screen_width, height = os.get_terminal_size()
        height -= 2
    else:
        height = args.size
        screen_width = args.width
    while True:
        try:
            time.sleep(random.uniform(.1, 1))
            os.system('cls' if os.name == 'nt' else 'clear')
            print('\n'.join(colored_stars_balls(balls(tree(height, screen_width)))))
        except KeyboardInterrupt:
            os.system('cls' if os.name == 'nt' else 'clear')
            print(f"\n{'Merry Christmas!!':^{screen_width}}", end='\n\n')
            break

if __name__ == '__main__':
    cli()

来源:A simple terminal Christmas tree made with Python | PythonRepo



update:2021-12-23

import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure(figsize=(8,8))
ax = fig.add_subplot(111, projection="3d")
def init():
    k=300
    Z = [i for i in range(k)]
    X = [math.cos(i/5)*(k-i) for i in range(k)]
    Y = [math.sin(i/5)*(k-i) for i in range(k)]
    ax.scatter(X,Y,Z, c="green", marker="^")
    step = 3
    c = [(i/k,abs(0.5-i/k),i/k) for i in range(1,k,step)]
    Z = [i for i in range(1,k,step)]
    X = [math.cos(i/5+2)*(k-i+10) for i in range(1,k,step)]
    Y = [math.sin(i/5+2)*(k-i+10) for i in range(1,k,step)]
    ax.scatter(X,Y,Z, c=c, marker="o",s=40)
    plt.xlim(-500,500)
    plt.ylim(-500,500)
    return fig,
def animate(f):
    fig.clear()
    ax = fig.add_subplot(111, projection="3d")
    k=300
    Z = [i for i in range(k)]
    X = [math.cos(i/5+f/10)*(k-i) for i in range(k)]
    Y = [math.sin(i/5+f/10)*(k-i) for i in range(k)]
    ax.scatter(X,Y,Z, c="green", marker="^")
    step = 3
    c = [(i/k,abs(0.5-i/k),i/k) for i in range(1,k,step)]
    Z = [i for i in range(1,k,step)]
    X = [math.cos(i/5+2+f/10)*(k-i+10) for i in range(1,k,step)]
    Y = [math.sin(i/5+2+f/10)*(k-i+10) for i in range(1,k,step)]
    ax.scatter(X,Y,Z, c=c, marker="o",s=40)
    plt.xlim(-500,500)
    plt.ylim(-500,500)
    return fig,
ani=animation.FuncAnimation(fig, animate, init_func=init,
                               frames=90, interval=50, blit=True)
ani.save("christmas_tree.mp4")

来源:https://medium.com/analytics-vidhya/how-to-draw-a-3d-christmas-tree-with-matplotlib-aabb9bc27864

R语言

1、

L <-  matrix(c(0.03,0,0,0.1,0.85,0.00,0.00,0.85,0.8,0.00,0.00,0.8,0.2,-0.08,0.15, 0.22, -0.2,0.08,0.15, 0.22,0.25, -0.1,0.12, 0.25,-0.2,0.1,0.12, 0.2),nrow=4)
B <- matrix(c(0,0,0,1.5,0,1.5,0,0.85,0,0.85,0,0.3,0, 0.4),nrow=2)
prob = c(0.02, 0.6,.08, 0.07, 0.07, 0.07, 0.07)
N = 1e5
x = matrix(NA,nrow=2,ncol=N)
x[,1] = c(0,2)
k <- sample(1:7,N,prob,replace=TRUE)
for(i in 2:N)
{
 x[,i] = crossprod(matrix(L[,k[i]],nrow=2),x[,i-1]) + B[,k[i]]
}
par(bg='black',mar=rep(0,4))
plot(x=x[1,],y=x[2,],col=grep('green',colors(),value=TRUE),axes=FALSE,cex=.1, xlab='', ylab='',pch='.')
bals <- sample(N,20)
points(x=x[1,bals],y=x[2,bals]-.1,col=c('red','blue','yellow','orange'),cex=1.5,pch=19)
text(x=-.7,y=8, labels='liangYuShi', adj=c(.5,.5), srt=35,
vfont=c('script','plain'),cex=3,col='gold' )
text(x=0.7,y=8,labels='Merry Christmas',adj=c(.5,.5),srt=-35,
vfont=c('script','plain'),cex=3, col='gold' ) 

text(x=-0.6,y=0,cex=0.8,labels="By Jimmy Wu", col="white")

2、

par(bg='black',mar=rep(0,4))
plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n")
rect(-1,0,1,2,col="tan3",border="tan4",lwd=3)
polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3)
polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3)
polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3)
polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3)
points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19)
points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19)
points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19)
points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19)
points(0,7.5,pch=8,cex=5,col="gold",lwd=3)
xPres = runif(10,-4.5,4.5)
xWidth = runif(10,0.1,0.5)
xHeight=runif(10,0,1)
for(i in 1:10){
  rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1))
  rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1))
}

 

后面再找到好玩的,好看的,会更新在这里~

总结

到此这篇关于利用python/R语言绘制圣诞树的文章就介绍到这了,更多相关python/R绘制圣诞树内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!

(0)

相关推荐

  • 使用Python画了一棵圣诞树的实例代码

    分享给大家一篇文章,教你怎样用Python画了一棵圣诞树,快来学习. 如何用Python画一个圣诞树呢? 最简单: height = 5 ​ stars = 1 for i in range(height): print((' ' * (height - i)) + ('*' * stars)) stars += 2 print((' ' * height) + '|') 效果: 哈哈哈哈,总有一种骗了大家的感觉. 其实本文是想介绍Turtle库来画圣诞树. import turtle ​ sc

  • 使用python图形模块turtle库绘制樱花、玫瑰、圣诞树代码实例

    今天为大家介绍几个Python"装逼"实例代码,python绘制樱花.玫瑰.圣诞树代码实例,主要使用了turtle库 Python绘制樱花代码实例 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch, t): time.sleep(0.0005) if branch > 3: if 8 <= branch <= 12:

  • 节日快乐! Python画一棵圣诞树送给你

    本文实例为大家分享了Python画圣诞树的具体代码,供大家参考,具体内容如下 源代码 from turtle import * import random import time #from unittest.mock import right #import color as color #import down as down #from cv2.cv2 import circle n = 80.0 speed("fastest") screensize(bg='seashell'

  • 用Python画圣诞树代码示例

    拿去给自己所思所念之人 from turtle import * import time setup(500, 500, startx=None, starty=None) speed(0) pencolor("pink") pensize(10) penup() hideturtle() goto(0, 150) showturtle() pendown() shape(name="classic") # 1 seth(-120) for i in range(1

  • 使用Python制作缩放自如的圣诞老人(圣诞树)

    圣诞节又要到了,虽说我们中国人不提倡过西方的节日,但是商家们还是很喜欢的,估计有对象的男孩纸女孩纸们也很喜欢吧. 今天的主题是为大家展示如何用python做一个不断变大的圣诞老人,就像西游记中能够随意变幻大小的神仙妖怪那样,算是送给大家的小礼物,先上个图吧! 不要心急,盯着图片看5秒 思路要点: 通过缩放获取等比大小的一组图片 将上述图片叠加到固定大小的底图中 按顺序组合图片生成动图 1.图片缩放 本篇文章的大部分工作都是基于opencv实现,而opencv进行图片缩放是极其容易的,不过这次我们

  • python圣诞树编写实例详解

    python圣诞树代码 1.简单的绘制圣诞树 新建tree1.py或者直接输入下面代码运行 #声明树的高度 height = 5 #树的雪花数,初始为1 stars = 1 #以数的高度作为循环次数 for i in range(height): print((' ' * (height - i)) + ('*' * stars)) stars += 2 #输出树干 print((' ' * height) + '|') 2.使用turtle绘制简单圣诞树 新建tree2py,输入以下代码 #导

  • 利用python/R语言绘制圣诞树实例代码

    目录 Python R语言 总结 圣诞节快到了,想着用python.r来画画圣诞树玩,就在网络上各种找方法,不喜勿喷哈~~ Python 1. import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle() circle.shape('circle') circle.color('red') circle.speed('fastest') circle.up() square = turt

  • R语言绘制散点图实例分析

    散点图显示在笛卡尔平面中绘制的许多点. 每个点表示两个变量的值. 在水平轴上选择一个变量,在垂直轴上选择另一个变量. 使用plot()函数创建简单散点图. 语法 在R语言中创建散点图的基本语法是 - plot(x, y, main, xlab, ylab, xlim, ylim, axes) 以下是所使用的参数的描述 - x是其值为水平坐标的数据集. y是其值是垂直坐标的数据集. main要是图形的图块. xlab是水平轴上的标签. ylab是垂直轴上的标签. xlim是用于绘图的x的值的极限.

  • R语言绘制直方图实例讲解

    直方图表示被存储到范围中的变量的值的频率. 直方图类似于条形图,但不同之处在于将值分组为连续范围. 直方图中的每个柱表示该范围中存在的值的数量的高度. R语言使用hist()函数创建直方图. 此函数使用向量作为输入,并使用一些更多的参数来绘制直方图. 语法 使用R语言创建直方图的基本语法是 hist(v,main,xlab,xlim,ylim,breaks,col,border) 以下是所使用的参数的描述 v是包含直方图中使用的数值的向量. main表示图表的标题. col用于设置条的颜色. b

  • 利用Python/R语言分别解决金字塔数求和问题

    目录 前言 1.前N阶乘求和 1.1 图解问题 1.2 算法流程 1.3 代码实现 1.4实验小结 2.金字塔数求和运算 2.1 图解问题 2.2 算法流程 2.3 代码实现 2.4 实验小结 总结 前言 此专栏为python与R语言对比学习的文章:以通俗易懂的小实验,带领大家深入浅出的理解两种语言的基本语法,并用以实际场景!感谢大家的关注,希望对大家有所帮助. “博观而约取,厚积而薄发!”谨以此言,望诸君共勉 本文将前两个小实验整理拼凑再了一起 :分别是“前N阶乘求和.金字塔数求和”.具体的项

  • python 自动轨迹绘制的实例代码

    用到的思维: 自动化思维,数据和功能分开处理,用数据驱动程序自动运行 接口化设计,数据与程序的对接方式要清晰明了 二维数据应用,应用维度组织数据,二维数据最常用 代码 # AutoTrace.py import turtle as t t.title("自动轨迹绘制") t.setup(800,600) t.pencolor("red") t.pensize(5) t.speed(10) # 数据读取 datals=[] f=open("data.trac

  • R语言绘制地图实例讲解

    setwd("C:/Users/75377/Desktop/SHEEP_ROH") png("12.png",width = 7000,height = 5500,pointsize = 170) par(mai = c(12,12,12,12),mgp = c(2.1,0.5,0)) #地图数据下载http://cos.name/wp-content/uploads/2009/07/chinaprovinceborderdata_tar_gz.zip librar

  • 利用Python进行数据可视化的实例代码

    目录 前言 首先搭建环境 实例代码 例子1: 例子2: 例子3: 例子4: 例子5: 例子6: 总结 前言 前面写过一篇用Python制作PPT的博客,感兴趣的可以参考 用Python制作PPT 这篇是关于用Python进行数据可视化的,准备作为一个长贴,随时更新有价值的Python可视化用例,都是网上搜集来的,与君共享,本文所有测试均基于Python3. 首先搭建环境 $pip install pyecharts -U $pip install echarts-themes-pypkg $pi

  • 利用Python求阴影部分的面积实例代码

    一.前言说明 今天看到微信群里一道六年级数学题,如下图,求阴影部分面积 看起来似乎并不是很难,可是博主添加各种辅助线,写各种方法都没出来,不得已而改用写Python代码来求面积了 二.思路介绍 1.用Python将上图画在坐标轴上,主要是斜线函数和半圆函数 2.均匀的在长方形上面洒满豆子(假设是豆子),求阴影部分豆子占比*总面积 三.源码设计 1.做图源码 import matplotlib.pyplot as plt import numpy as np def init(): plt.xla

  • python+matplotlib实现动态绘制图片实例代码(交互式绘图)

    本文研究的主要是python+matplotlib实现动态绘制图片(交互式绘图)的相关内容,具体介绍和实现代码如下所示. 最近在研究动态障碍物避障算法,在Python语言进行算法仿真时需要实时显示障碍物和运动物的当前位置和轨迹,利用Anaconda的Python打包集合,在Spyder中使用Python3.5语言和matplotlib实现路径的动态显示和交互式绘图(和Matlab功能类似). Anaconda是一个用于科学计算的Python发行版,支持 Linux, Mac, Windows系统

  • R语言绘制折线图实例分析

    折线图是通过在它们之间绘制线段来连接一系列点的图. 这些点在它们的坐标(通常是x坐标)值之一中排序. 折线图通常用于识别数据中的趋势. R语言中的plot()函数用于创建折线图. 语法 在R语言中创建折线图的基本语法是 - plot(v,type,col,xlab,ylab) 以下是所使用的参数的描述 - v是包含数值的向量. 类型采用值"p"仅绘制点,"l"仅绘制线和"o"绘制点和线. xlab是x轴的标签. ylab是y轴的标签. main是

随机推荐