Matplotlib

Matplotlib

Matplotlib is a cross-platform, data visualization and graphical plotting library for Python and its numerical extension NumPy. As such, it offers a viable open source alternative to MATLAB. Developers can also use matplotlib’s APIs (Application Programming Interfaces) to embed plots in GUI applications.

A Python matplotlib script is structured so that a few lines of code are all that is required in most instances to generate a visual data plot. The matplotlib scripting layer overlays two APIs:

  • The pyplot API is a hierarchy of Python code objects topped by?matplotlib.pyplot
  • An OO (Object-Oriented) API collection of objects that can be assembled with greater flexibility than pyplot. This API provides?direct access to Matplotlib’s backend layers.??

Matplotlib and Pyplot in Python

The pyplot?API has a convenient MATLAB-style stateful interface. In fact, matplotlib was originally written as an open source alternative for MATLAB. The OO API and its interface is more customizable and powerful than pyplot, but considered more difficult to use. As a result, the pyplot interface is more commonly used, and is referred to by default in this article.?

Understanding matplotlib’s pyplot API is key to understanding how to work with plots:

  • matplotlib.pyplot.figure: Figure?is the top-level container. It includes everything visualized in a plot including one or more?Axes.
  • matplotlib.pyplot.axes:?Axes?contain most of the elements in a?plot:?Axis, Tick, Line2D, Text,?etc., and sets the coordinates. It is the area in which data is plotted. Axes include the X-Axis, Y-Axis, and possibly a Z-Axis, as well.

要查看或添加评论,请登录

NISHI KUMARI的更多文章

  • Data Analysis Expressions (DAX)

    Data Analysis Expressions (DAX)

    Data Analysis Expressions (DAX) is a formula expression language used in Analysis Services, Power BI, and Power Pivot…

  • What is Django Web Framework?

    What is Django Web Framework?

    Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It follows…

  • What is Email Marketing?

    What is Email Marketing?

    Email marketing refers to a digital marketing strategy that uses email to promote business offerings and build…

  • SQL Query Performance

    SQL Query Performance

    To improve SQL query performance, it’s crucial to understand the factors that can impact its efficiency. Various…

  • Apache HBase

    Apache HBase

    Apache HBase is an open-source, distributed, column-oriented database modeled after Google's Bigtable. It is developed…

  • What is graphic design?

    What is graphic design?

    Graphic design is a form of communication that uses colors, shapes, images, and words to create visual content in many…

  • Azure Synapse

    Azure Synapse

    Azure Synapse is an enterprise analytics service that accelerates time to insight across data warehouses and big data…

  • Bloomberg Terminal

    Bloomberg Terminal

    The Bloomberg Terminal is a premium financial software platform that provides professionals with real-time market data,…

  • OOPs

    OOPs

    One of the more favored programming approaches, object-oriented programming (OOP), is built on objects, i.e.

  • Gateway

    Gateway

    A gateway is a network connectivity device that connects two different configuration networks. Gateways are also known…

社区洞察

其他会员也浏览了