Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 93a1f38

Browse files
committed
add matplotlib preview & API basic
1 parent 35f9655 commit 93a1f38

File tree

3 files changed

+316
-2
lines changed

3 files changed

+316
-2
lines changed

‎matplotlib/1-2.preview.ipynb

Lines changed: 201 additions & 0 deletions
Large diffs are not rendered by default.

‎matplotlib/1-3. API.ipynb

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# 1장. Matplotlib 입문\n",
8+
"\n",
9+
"## 1-3. API의 이해\n",
10+
"\n",
11+
"Matplotlib은 총 3가지 API를 제공합니다.\n",
12+
"\n",
13+
"**API**란 Application Programing Interface의 약자로, 응용 프로그램에서 사용할 수 있도록 운영 체제나 프로그래밍 언어가 제공하는 기능을 제어할 수 있게 만든 인터페이스를 뜻합니다. (출처 : Wikipedia)\n",
14+
"\n",
15+
"좀 더 쉽게 이야기 하면 Matplotlib에서 그래프를 그리는 방식이 3가지 있다는 의미입니다.\n",
16+
"\n",
17+
"1. pyplot API\n",
18+
"2. 객체지향(Object Oriented) API\n",
19+
"3. pylab API\n",
20+
"\n",
21+
"각각을 살펴봅시다."
22+
]
23+
},
24+
{
25+
"cell_type": "code",
26+
"execution_count": 2,
27+
"metadata": {},
28+
"outputs": [],
29+
"source": [
30+
"import matplotlib as mpl\n",
31+
"import numpy as np"
32+
]
33+
},
34+
{
35+
"cell_type": "markdown",
36+
"metadata": {},
37+
"source": [
38+
"### 1-3-1. pyplot API\n",
39+
"\n",
40+
"`matplotlib.pyplot`은 MATLAB처럼 작동하는 함수들의 모음입니다.\n",
41+
"각 pyplot의 함수들은 plot의 요소를 변경합니다. \n",
42+
"\n",
43+
"반응형(Interactive) Plot이나 간단한 plot을 그릴 때 유용합니다."
44+
]
45+
},
46+
{
47+
"cell_type": "markdown",
48+
"metadata": {},
49+
"source": [
50+
"### 1-3-2. 객체지향 API\n",
51+
"\n",
52+
"Matplotlib의 Plot과 그 외 요소들은 객체지향입니다.\n",
53+
"\n",
54+
"플롯을 보다 세밀하게 제어하고 사용자 정의 함수를 사용하기 위해서 객체를 직접 다루는 방법을 사용해야 합니다.\n",
55+
"\n",
56+
"`plt.subplots`을 사용하여 1개 이상의 Figure와 1개 이상의 Axes를 직접 다룰 수 있습니다.\n",
57+
"\n",
58+
"개별적인 플롯을 다룰 수 있기에 보다 직관적인 프로그래밍을 할 수 있습니다.\n",
59+
"\n",
60+
"다른 GUI 툴킷에서 인터랙티브하게 변경하는 등 활용도가 가장 높습니다.\n",
61+
"\n",
62+
"앞으로 사용하는 matplotlib 관련 함수는 대부분 객체지향 API를 사용합니다."
63+
]
64+
},
65+
{
66+
"cell_type": "markdown",
67+
"metadata": {},
68+
"source": [
69+
"### 1-3-3. pylab API\n",
70+
"\n",
71+
"pyplot, numpy 등 모든 함수를 전역 네임 스페이스로 가져와서 MATLAB과 유사한 방식으로 시각화를 진행하기 위해 만든 API입니다. 사용은 `matplotlib.pylab`을 이용하여 사용합니다. \n",
72+
" \n",
73+
"절차형 프로세스를 제공합니다. 하지만 현재는 사용하지 않는 방법이며, 공식 사이트에서도 이 API를 권장하지 않습니다."
74+
]
75+
},
76+
{
77+
"cell_type": "code",
78+
"execution_count": null,
79+
"metadata": {},
80+
"outputs": [],
81+
"source": []
82+
},
83+
{
84+
"cell_type": "code",
85+
"execution_count": null,
86+
"metadata": {},
87+
"outputs": [],
88+
"source": []
89+
}
90+
],
91+
"metadata": {
92+
"kernelspec": {
93+
"display_name": "Python 3",
94+
"language": "python",
95+
"name": "python3"
96+
},
97+
"language_info": {
98+
"codemirror_mode": {
99+
"name": "ipython",
100+
"version": 3
101+
},
102+
"file_extension": ".py",
103+
"mimetype": "text/x-python",
104+
"name": "python",
105+
"nbconvert_exporter": "python",
106+
"pygments_lexer": "ipython3",
107+
"version": "3.8.0"
108+
}
109+
},
110+
"nbformat": 4,
111+
"nbformat_minor": 4
112+
}

‎matplotlib/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212

1313
기본적인 문법 연습과 matplotlib를 가볍게 살펴봅시다.
1414

15-
- [1-1.기본적인 plot 3가지 (line, bar, scatter)](/matplotlib/1-1.3_basic_plots.ipynb)
16-
- API의 이해
15+
- [**1-1. 기본적인 plot 3가지 (line, bar, scatter)**](/matplotlib/1-1.3_basic_plots.ipynb)
16+
- [1-2. Matplotlib의 미리보기](/matplotlib/1-2.preview.ipynb)
17+
- [1-3. API의 이해](/matplotlib/1-3.API.ipynb)
1718
- Figure와 Axes
1819
- 색과 테마
1920
- Text의 종류와 위치

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /