美文网首页
matplot的使用,类matlab api

matplot的使用,类matlab api

作者: MrRed | 来源:发表于2017-04-28 20:18 被阅读0次

    <code>

    -- coding: utf-8 --

    """
    Created on Fri Apr 28 20:08:07 2017

    @author: Administrator
    """

    """使用类MATLAB API"""
    from pylab import *

    from numpy import *
    x = linspace(0,5,10)
    y = x**2
    figure()
    plot(x,y,'r')
    xlabel('x')
    ylabel('y')
    title('title')
    show()
    <code>

    image.png

    使用类matlab api画出的图形

    也可以使用subplot函数,以及定义线的形状
    <code>
    subplot(1,2,1)
    plot(x,y,'r--')
    subplot(1,2,2)
    plot(y,x,'g*-')
    <code>

    image.png

    相关文章

      网友评论

          本文标题:matplot的使用,类matlab api

          本文链接:https://www.haomeiwen.com/subject/msuazttx.html