python
ã§ã
matplotlib
.pyplotã§ã¯ãå³ã®ãµã€ãºãã¢ã¹ãã¯ãæ¯ã¯ã
ã€ã³ãã§æå®ããŸãã
*
1ã€ã³ãã¯72ptã§ãã
#A4
plt.rcParams['figure.figsize'] = [8.35 ,5.91 ]ã#[21.21cm, 15.00cm]
plt.rcParams['font.size'] = 24
plt.rcParams['lines.linewidth'] = 1.5
plt.rcParams['figure.figsize'] = [15, 10]
fig, axes = plt.subplots(figsize=(7,4))
*
è¡š
2
.
ããã°ã©ãã³ã°èšèªã®çš®é¡
çš®é¡ |
åé¡ |
èšèª
|
ç¹åŸŽ |
| | | | |
ã€ã³ã¿ããªã¿ |
Webã¢ããª
|
JavaScript
|
Webãã©ãŠã¶äžã§åäœïŒã¯ã©ã€ã¢ã³ããµã€ãïŒ
|
vb
script(vbs,vba,asp)
1
)
|
1964
éçº
ããŒããŒããšãã£ã¹ãã¬ã€ãå¿
èŠ
|
AI
Webã¢ããª
|
python
2
)
*
|
ããã°ããŒã¿
ããŒã¿ãµã€ãšã³ã¹
*
ã
ãããªã¢ã«ãºã€ã³ãã©ããã£ã¯ã¹
*ã |
æè² |
Scratch |
ããžã¥ã¢ã«ããã°ã©ãã³ã° |
ã³ã³ãã€ã« |
OS
|
C
3
)
|
ãã€ã³ã¿ãæ§é äœ
|
æ±çš
|
VB.NET
|
ãªããžã§ã¯ãæåïŒå€éç¶æ¿ãªãïŒ
|
æ±çš
|
Kotlin
|
ã¢ã³ããã€ãã¢ããªåã
|
OS
|
C++
|
ãªããžã§ã¯ãæå
|
colab
jupyter
ãã¡ã€ã«ããŒã¹ã®ã·ã¹ãã ã§ã¯ãã³ã³ãã€ã©èšèªã¯å®è¡å¯èœãªãã¡ã€ã«ãçæãã
ã€ã³ã¿ããªã¿èšèªã¯ãããçæããªããšããéãããããŸããã
ããããã¯ã©ãŠãããŒã¹ã«ãªã£ãŠãå®è¡ãã¡ã€ã«ãã®ãã®ãã¯ã©ã€ã¢ã³ãã«ããŠã³ããŒãããªããªãã
ãžã£ã¹ãã€ã³ã³ã³ãã€ã«ã§å®è¡çµæã ããå©çšããããã«ãªããš
ã³ã³ãã€ã©èšèªãšã€ã³ã¿ããªã¿èšèªã®éãã¯ãããŸãæ¬è³ªçã§ãªããªããŸããã
ç§åŠæè¡çšã®äŒçµ±çãªèšèªãšããŠã¯ãFORTRANããããŸãã
FORTRANç³»åã®èšèªãšããŠã¯ãBASICãpythonããããŸãã
çµ±èšçšèšèªãšããŠRããããŸãã
ã¢ã«ãŽãªãºã éèŠã®äŒçµ±çãªèšèªãšããŠALGOLããããŸãã
ALGOLã¯ãPascal, C, C++, C#,java, javascript, typescript, Kotlinãšé²åããŠããŸããã
juliaã¯Cã«è¿«ãèšç®é床ãèªããŸãã
ãµãŒããŒãµã€ãã§äœ¿ãããŠããPerlã
Ruby
ãã¯ã©ãŠãã§å©çšã§ããããã«ãªã£ãŠããŸããã
人工ç¥èœã§äŒçµ±çãªèšèªLispã¯ãF#ã
Schemeãã¯ã©ãŠãã§å©çšã§ããããã«ãªã£ãŠããŸããã
人æ°
ããã°ã©ãã³ã°èšèª
ã¯ãjava scriptããããŠpython*ãšç¶ããŸãã
*
pythonïŒãã€ãœã³ïŒ
è²ã®åå
è¡š
4
.
è²ã®åå
åé¡
|
å称
|
泚é
|
è²
|
| | |
|
ð
ðšâð«
åç©
|
ããŒãžã¥
|
駱é§
|
ã»ãã¢
|
ã€ã«å¢š
|
|
ð
ðšâð«
æ€ç©
|
ãã³ã¯ïŒç³ç«¹ïŒ
|
æ«åã«äŒŒãè±
|
pink
#FFC0CB
|
åžžç£
|
æãæŸãªã©ã®åžžç·ã®è
|
#00664d
#006428
forestgreen
ããŽã®è²
|
ðšâð«
ç·
|
èæšã®æ°èœãåå€ã®è¥è
|
green
,#00FF00
|
è
|
èããäœã£ã
ææ
|
|
çŽ
*
*
|
çŽ
è±ããäœã£ã
ææ
|
|
è
*
|
èã®æ ¹ããäœã£ã
ææ
ã
ðšâð« 匥çæ代 ã«ã¯äœ¿ãããŠããã
|
|
é±ç©
|
ç
€ïŒççŽ ïŒ
|
ç
€ãé¡æãšããè ããã€ã³ããŒãšããŠåºããææ¿å
·ã墚ãšããã
墚ãæ°Žã«åæ£ããåæ£æ¶²ã墚æ±ãšèšããŸãã
çŽ
ã«å¢šæ±ã§æžãããæžã¯ã
çŽ
ã«é¡æãæã¿èŸŒãã§ããŸãã®ã§ã
ããžã¿ã«æ
å ±ãšã¡ãã£ãŠ
æ¹ç«ãé£ããã§ãã
|
|
æ±ïŒ
ð§ª
ð
ç¡«åæ°Žéã蟰ç ãäž¹ïŒ
|
ðšâð« 匥çæ代
|
#e94709
#EF454A
|
ç©ççŸè±¡
|
ðšâð«
èµ€ïŒæããïŒred,#FF0000
éïŒéãïŒblue,#00FFFF
ç·ãéãšèšã£ããéä¿¡å·ã¯æ¬æ¥ç·ã
é»ïŒæãïŒ
|
é»
|
|
è¹è²ïŒäžè²ïŒã®ã²ãšã€
圢容è©ã«ã§ããŸãã
é»è²ãã«å ããŠãã³ã¯ããªã©ã®åœ¢å®¹è©æŽ»çšãã
|
éå±ã®è¡šé¢åå°
|
éè²
|
éè²ã¯éå±ã®åå°ã®ç¶æ
ã§ãã
|
æ°Žè²
|
|
æ°Žè²ã¯æ°Žã®åå°ãšå±æã®ç¶æ
ã§ãã
|
å·¥æ¥è£œå
|
ã©ã ã
|
|
ã©ã ãã¯ãã¬ã¢ããŒãã®è±èªé³ã
ã¬ã¢ã³ã®é
žå³ãç°æ±ã§æããæž
涌飲ææ°Žã§ãã
é«çŽãªå®¹åšã§åå䟡å€ãé«ããããšããŠãã³ãã«éè²ã«çè²ããŸããã
ãã®ã³ãã®è²ãã©ã ãè²ãšåŒã³ãªãããããŸããã
|
è²ã®ååã¯ã
ææã®ååã«ç±æ¥ããããšãå€ãã§ãã
htmlã®styleãcssã§ã¯ãcolorãbackground-colorã«è²åã䜿çšå¯èœã
python
matplotlibã§ã¯ã
r
g
b
w
m
y
c
k
ã¯äžæåã®
ååã§æå®å¯èœã
è²ã¯è²èŠã䜿ã£ãæ
å ±äŒéã«äœ¿ãããŸãã
ä¿¡å·æ©ãæµæåšã®ã«ã©ãŒã³ãŒããªã©ã
å³åœ¢
è¡š
5
.
å³åœ¢
å称
|
圢åŒ
|
ã°ã©ã
|
説æ
|
|
|
|
|
æ圢
ïŒå€è§åœ¢ïŒ
|
ðšâð«
svg
|
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' viewBox='0, 0, 200, 200'>
<polygon points='100,0 158,180 4,69 195, 69 41,180'
stroke='black' stroke-width='1' fill='none' />
</svg>
|
|
python
+
matplotlib
patches.
Polygon
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import math
xy = [ (math.sin(p), math.cos(p)) for p in \
np.arange(start = 0, stop = 4 * math.pi, step = 4 * math.pi/5)]
fig, ax = plt.subplots(figsize=(5.8, 4.2))
plt.axis("off")
ax.set_aspect('equal');ax.set_xlim([-1,1]);ax.set_ylim([-1,1])
ax.add_patch(patches.Polygon(xy, \
closed=True,facecolor="b",edgecolor="none"))
plt.show()
|
å
|
|
|
ç·å
|
|
|
|
çŽç·
|
|
|
ðšâð«
TeXãšMathML
è¡š
6
.
TeXãšMathML
é
ç®
|
html
|
MathML
|
TeX
|
ASCIIMath
|
|
|
|
|
|
|
|
å€æ°
|
x
|
|
$$x$$
|
é
|
R
|
|
$$R$$
|
é
|
Cs
|
|
$$C_\mathrm{s}$$
|
|
éåã§ã¯ãäžä»ãæåã¯ãç«äœæåïŒããŒãã³äœïŒã䜿ããŸãã
MathMLã§ã¯ãmathvariantå±æ§ã«"normal"ãæå®ããŸãã
TeXã§ã¯ã\(C_\mathrm{s}\)ãšããã®ã«ã_\mathrm{s}ãªã©ãšè¡šçŸããŸãã
|
ååŠåŒ
|
CO2
|
|
$$\mathrm{CO}_2$$
|
|
ã®ãªã·ã£æå
|
α,Ω
*
|
|
$$\Omega,\vartheta$$
*
python
ã®
matplotlibãªã©ã§ã®ãªã·ã£æåã
\u03b8ã
\N{greek small letter theta}
ã®ããã«
å¥æåå
**
ã䜿ããŸãã
|
|
ãã¬ãŒãå³
ã»ã«ã®é»æ°æµæãšé»è§£æ¶²ã®æµæç
ååž°
ååž°
å
æ¥äœæãã
https://a.yamagata-u.ac.jp/py/regression.py
ã¯CGIã§pythonãããããŠãŸãã®ã§ïŒãªã¯ãšã¹ãã
æ¥ããã³ã«pythonãèµ·åããŸãïŒãªãœãŒã¹ãæ¶è²»ããã®ã§
CGIã§ã¯ãªãDjnagoã¿ãããªãã¬ãŒã ã¯ãŒã¯ãã€ãã
æ¹åã®ããã§ãïŒpythonã®cgiããã±ãŒãžã¯
ver3.11(çŸè¡ç)ã§éæšå¥šïŒver3.13ã§åé€ãšã®ããšïŒ
çŸåšã®èšå®ã ãšïŒDjangoã¯16ããã»ã¹ãŸã§èµ·åãããŸãïŒ
Edgeã§
https://a.yamagata-u.ac.jp/dj/regression/
ã衚瀺ããïŒF5ãé£æããŠã¿ãŠãã ããïŒ30åãšã
æ·»ä»ã®å³ã¿ãããªã®ãåºããšæããŸãïŒ
ããŸãæžãæ¹ããããã ãããªãšã¯æããŸãïŒ
(IISã®åèµ·åãå¿
èŠãããããŸãã)
ãŸãCGIã§é£æããããšãµãŒããŒãèœã¡ããšæãã®ã§
ã©ã£ã¡ãã©ã£ã¡ã ãšæããŸããïŒ
ååž°åæ
è¡š
7
.
ããã°ã©ãã³ã°èšèªã®çš®é¡
çš®é¡ |
åé¡ |
èšèª
|
ç¹åŸŽ |
| | | | |
ã€ã³ã¿ããªã¿ |
Webã¢ããª
|
JavaScript
|
Webãã©ãŠã¶äžã§åäœïŒã¯ã©ã€ã¢ã³ããµã€ãïŒ
|
vb
script(vbs,vba,asp)
6
)
|
1964
éçº
ããŒããŒããšãã£ã¹ãã¬ã€ãå¿
èŠ
|
AI
Webã¢ããª
|
python
7
)
*
|
ããã°ããŒã¿
ããŒã¿ãµã€ãšã³ã¹
*
ã
ãããªã¢ã«ãºã€ã³ãã©ããã£ã¯ã¹
*ã |
æè² |
Scratch |
ããžã¥ã¢ã«ããã°ã©ãã³ã° |
ã³ã³ãã€ã« |
OS
|
C
8
)
|
ãã€ã³ã¿ãæ§é äœ
|
æ±çš
|
VB.NET
|
ãªããžã§ã¯ãæåïŒå€éç¶æ¿ãªãïŒ
|
æ±çš
|
Kotlin
|
ã¢ã³ããã€ãã¢ããªåã
|
OS
|
C++
|
ãªããžã§ã¯ãæå
|
colab
jupyter
ãã¡ã€ã«ããŒã¹ã®ã·ã¹ãã ã§ã¯ãã³ã³ãã€ã©èšèªã¯å®è¡å¯èœãªãã¡ã€ã«ãçæãã
ã€ã³ã¿ããªã¿èšèªã¯ãããçæããªããšããéãããããŸããã
ããããã¯ã©ãŠãããŒã¹ã«ãªã£ãŠãå®è¡ãã¡ã€ã«ãã®ãã®ãã¯ã©ã€ã¢ã³ãã«ããŠã³ããŒãããªããªãã
ãžã£ã¹ãã€ã³ã³ã³ãã€ã«ã§å®è¡çµæã ããå©çšããããã«ãªããš
ã³ã³ãã€ã©èšèªãšã€ã³ã¿ããªã¿èšèªã®éãã¯ãããŸãæ¬è³ªçã§ãªããªããŸããã
ç§åŠæè¡çšã®äŒçµ±çãªèšèªãšããŠã¯ãFORTRANããããŸãã
FORTRANç³»åã®èšèªãšããŠã¯ãBASICãpythonããããŸãã
çµ±èšçšèšèªãšããŠRããããŸãã
ã¢ã«ãŽãªãºã éèŠã®äŒçµ±çãªèšèªãšããŠALGOLããããŸãã
ALGOLã¯ãPascal, C, C++, C#,java, javascript, typescript, Kotlinãšé²åããŠããŸããã
juliaã¯Cã«è¿«ãèšç®é床ãèªããŸãã
ãµãŒããŒãµã€ãã§äœ¿ãããŠããPerlã
Ruby
ãã¯ã©ãŠãã§å©çšã§ããããã«ãªã£ãŠããŸããã
人工ç¥èœã§äŒçµ±çãªèšèªLispã¯ãF#ã
Schemeãã¯ã©ãŠãã§å©çšã§ããããã«ãªã£ãŠããŸããã
人æ°
ããã°ã©ãã³ã°èšèª
ã¯ãjava scriptããããŠpython*ãšç¶ããŸãã
*
colabã®æŠèŠ
pythonïŒãã€ãœã³ïŒ
è¡š
8
.
python
èšèªã®äœ¿ãæ¹
å¿çšäŸ |
|
| | |
|
ç¡äœçºæœåº
|
extracted = random.sample(data, 10)
|
å¹³å
|
average = statistics.mean(data)
average = np.mean(data)
|
æšæºåå·®
|
std = statistics.stdev(data)
std = np.std(data)
std = np.std(data, ddof=1) # æšæ¬æšæºåå·®
|
æ£åžå³
*
|
import numpy as np
import matplotlib.pyplot as plt
# ä¹±æ°ãçæ
x = np.random.rand(100)
y = np.random.rand(100)
# æ£åžå³ãæç»
plt.scatter(x, y)
|
ãã¹ãã°ã©ã
|
import matplotlib.pyplot as plt
ax1 = fig.add_subplot(211)
ax1.hist(x1, bins=bins)
|
ç»å
(matplotlib)
ã®äŸïŒ
|
|
ãšãã²ããŠããš
å¯èªæ§éèŠã®ç§åŠèšç®åãã
9
)
10
)
Phthon
(ãã€ãœã³ïŒã¯ãå€æ§ãªããŒã¿æ§é ãçµã¿èŸŒãŸããŠããã®ã§ãããŒã¿åŠçãããã
èšèªã§ãã
AnacondaïŒã¢ãã³ã³ãïŒãã
Google Colaboratoy
ãªã©ã®éçºç°å¢ããããŸãã
Phthonã«ã¯ãæ°å€èšç®ã©ã€ãã©ãªNumPyããããŸãã
NumPyã¯ãCããµFORTRANã§ãå®è£
ãããŠããŠãé«éã§å®è¡ã§ããŸãã
ã»ãã«ããMatplotlib(ã°ã©ãæç»ã©ã€ãã©ãªïŒ pandas(ããŒã¿åæã©ã€ãã©ãªïŒ TensorFlow(æ©æ¢°åŠç¿ã©ã€ãã©ãªïŒãOpenCVïŒç»ååŠçã©ã€ãã©ãªïŒ
ãªã©äŸ¿å©ãªã©ã€ãã©ãªãå€æ°ãããŸãã
pymatgenã©ã€ãã©ãªã¯ããŸã ããŸãæ®åããŠããªãã
*
Webã¢ããª
ãæžãã«ã¯ã
django
ãã©ãããã©ãŒã ããã£ãã»ããããããã
Matplotlib
Matplotlibã§ã¯ã
è²ã
æ°åŒã®è¡šçŸãè±å¯ã§ãã
ãã€ãœã³ã§æããã³ãŒã«ã³ãŒã«ãããã
2dã°ã©ãã£ã¯ã¹
- 1. å æ¡å€ªéãã»ãïŒå,å·¥æ¥æ
å ±æ°ç,å®æåºç,4. BASICã«ããããã°ã©ãã³ã°, 79(2023)
- 2. ,ãšã»ã»ã®Pythonå
¥é
- 3. å æ¡å€ªéãã»ãïŒå,å·¥æ¥æ
å ±æ°ç,å®æåºç,5. Cã«ããããã°ã©ãã³ã°, 127(2023)
- 4. èšé管çæ°æç§æžäœæå§å¡äŒ,èšé管çã®åºç€ãšå¿çš,ã³ãã瀟,7.2. å質ã®æ¹åã®ææ³, p.236(2020)
- 5. 森äžæ£å
žãã岡æéžç¢ãäœè€éå¹ãäŒè€æºåãç«è±åå®,第148åè¬æŒå€§äŒ(2023).
- 6. å æ¡å€ªéãã»ãïŒå,å·¥æ¥æ
å ±æ°ç,å®æåºç,4. BASICã«ããããã°ã©ãã³ã°, 79(2023)
- 7. ,ãšã»ã»ã®Pythonå
¥é
- 8. å æ¡å€ªéãã»ãïŒå,å·¥æ¥æ
å ±æ°ç,å®æåºç,5. Cã«ããããã°ã©ãã³ã°, 127(2023)
- 9. ,ãšã»ã»ã®Pythonå
¥é
- 10. ,pythonã®åºç€ïŒjupyternotebookçïŒ
- 11. èšé管çæ°æç§æžäœæå§å¡äŒ,èšé管çã®åºç€ãšå¿çš,ã³ãã瀟,4.3.5. äºã€ã®æ¯å¹³åã®éãã®çµ±èšçæ€å®(2020)
ðððð¯ð