Cov txheej txheem:

Matplotlib chart yog dab tsi?
Matplotlib chart yog dab tsi?

Video: Matplotlib chart yog dab tsi?

Video: Matplotlib chart yog dab tsi?
Video: Web Development with Python! Embedding a Plotly Graph within a Website 2024, Hlis ntuj nqeg
Anonim

Matplotlib yog ib lub tsev qiv ntawv plotting rau Python programming lus. Nws tso cai rau ua kom zoo kab kos nyob rau hauv ob peb kab ntawm code. Feem ntau ntawm lwm lub tsev qiv ntawv python plotting yog tsim rau saum Matplotlib . Nws ua rau qhov kev nkag siab yooj yim. ntawm matplotlib tej zaum yuav tsum tau ua ib yam daim duab nrog python.

Kuj paub, Matplotlib siv rau dab tsi?

Matplotlib yog ib lub tsev qiv ntawv plotting rau cov Python programming lus thiab nws cov lej lej txuas ntxiv NumPy. Nws muab cov khoom siv-oriented API rau embedding cov phiaj xwm rau hauv daim ntawv thov siv cov khoom siv dav dav GUI zoo li Tkinter, wxPython, Qt, lossis GTK +.

Ib yam li ntawd, Matplotlib puas tuaj nrog Python? Yog. Matplotlib yog ib feem, theej hais ib lub tsev qiv ntawv ntawm python . Siv Matplotlib Koj tuaj yeem npaj cov duab, histogram thiab bar zaj duab xis thiab tag nrho cov khoom ntawd. Thiab tom qab ntawd koj tuaj yeem mus nrog cufflinks thiab plotly raws li lawv yuav muab koj qhov kev sib tham sib tham rau koj cov phiaj xwm.

Kuj kom paub, koj ua li cas npaj ib daim duab hauv Matplotlib?

Cov kauj ruam hauv qab no tau ua raws li:

  1. Txhais cov x-axis thiab coj y-axis qhov tseem ceeb raws li cov npe.
  2. Npaj lawv ntawm canvas siv. plot() muaj nuj nqi.
  3. Muab lub npe rau x-axis thiab y-axis siv. xlabel() thiab. ylabel() ua haujlwm.
  4. Muab lub npe rau koj zaj dab neeg uas siv. lub npe () ua haujlwm.
  5. Thaum kawg, saib koj zaj dab neeg, peb siv. show() muaj nuj nqi.

Puas yog NumPy sai dua pandas?

Yog li ntawd, kev ua haujlwm ntawm NumPy arrays tuaj yeem ua tau zoo heev sai dua kev ua haujlwm ntawm Pandas series. NumPy arrays tuaj yeem siv rau qhov chaw Pandas series thaum ntxiv functionality muab los ntawm Pandas series tsis tseem ceeb. Khiav qhov kev ua haujlwm rau NumPy array tau ua tiav lwm qhov kev txhim kho plaub zaug.

Pom zoo: