ãã®èšäºã§ã¯ãäžè¬çãªLaTeXãã¹ã¯ããããããªãã·ã³ã°ã·ã¹ãã çšã«éçºãããPGFPlotsããã±ãŒãžã®äœ¿çšæ¹æ³ã«ã€ããŠèª¬æããŸãã ãã ããåŸè ã«è©³ãããªãå Žåã§ããããã¯åæºããŠãã®èšäºãèªãã®ããããçç±ã§ã¯ãããŸããããããããåŸã§æäŸãããçŽ æŽãããäŸãšPGFPlotsã®äžŠå€ããåãšäŸ¿å©ããLaTeXãåŠã¶æ°ã«ãããããã§ãã
玹ä»ãšåæ©
ããŒã¿ã®ãããããšèŠèŠåã«ã¯ããŸããŸãªã·ã¹ãã ããããŸãã ãã¡ãããPGPlotsãããããã¹ãŠã眮ãæããããšãã§ãããšã¯èšããŸããïŒããšãã°ãRç°å¢ã§äœæ¥ããå Žåãç¬èªã®ã°ã©ãäœæã¡ã«ããºã ã«äŸåããŠãæ§ç¯ãããã°ã©ããç»åãšããŠããã¥ã¡ã³ãã«åçŽã«è¿œå ããæ¹ã䟿å©ãªå ŽåããããŸãïŒãããããé©çšããæ確ã§éèŠãªãããããããŸã䟿å©ïŒææ; åŠçãšããŠãããããäœããã®åœ¢ã§ãã¹ãŠãè¡ã£ãããŸããŸãªã¬ããŒãã ç°¡åãªããŒã¿èŠèŠåãªã©
以äžã¯ãèšãããããšã確èªããã ãã§ãªãããã®ã·ã¹ãã ã®æ©èœããã®ãããªã·ã¹ãã ã«å¯Ÿããæ¥ã ã®èŠä»¶ãè¶ ããããšããå€ãããšã瀺ããŠããäŸã§ãïŒäŸã®ãœãŒã¹ã³ãŒããèŠãã«ã¯ç»åãã¯ãªãã¯ããŠãã ããïŒïŒ
|
|
|
|
ãµã³ãã«ã䜿çšããã«ã¯ãã€ã³ã¹ããŒã«ãããLaTeXãã£ã¹ããªãã¥ãŒã·ã§ã³ãå¿ èŠã§ãã æ®å¿µãªãããã€ã³ã¹ããŒã«ãšèšå®ã¯ãã®èšäºã®ç¯å²ãè¶ ããŠãããããã€ã³ã¹ããŒã«ãšèšå®ã«ç ©ããããããªãã ãããã§èª¬æããæ©èœãè©Šãããå Žå㯠ã Overleaf ã ShareLaTeX ã Papeeriaãªã©ã®ãªã³ã©ã€ã³ãµãŒãã¹ãè©Šãããšãã§ããŸãã
ããã§ã¯å§ããŸãããïŒ
ããã±ãŒãžæ¥ç¶
PGFPlotãæ¥ç¶ããã«ã¯ãã³ãã³ããããã¥ã¡ã³ãã®ããªã¢ã³ãã«ã«è¿œå ããã ãã§ãã
\usepackage{pgfplots}
ãã®åŸãããã±ãŒãžãããŠã³ããŒãããã³ã€ã³ã¹ããŒã«ãããŸãã ãã ããäœããã®çç±ã§ãããçºçããªãå Žåã¯ããã®ããã±ãŒãžãã€ã³ã¹ããŒã«ããããŸããŸãªæ¹æ³ã詳现ã«èª¬æãããŠããããã¥ã¡ã³ã ïŒpã11ïŒãåç §ããŠãã ããã
ããã«ãåŸæ¹äºææ§ãæåŸ ããŠPGFPlotsãèšèšãããŠããããã®ããã±ãŒãžã®å€ãããŒãžã§ã³ã䜿çšããŠäœæããããããžã§ã¯ãã¯ãæ°ããããŒãžã§ã³ã®ã³ã¹ãã«é¢ä¿ãªããå€æŽããã«éããŠè¡šç€ºããããšããäºå®ã«æ³šæããå¿ èŠããããŸãã ãã ããããã±ãŒãžã«ã¯äžäœäºææ§ã«éåããå€æŽãå°å ¥ãããŠãããããããæ¥ç¶ããã«ã¯ãããªã¢ã³ãã«ã§äœ¿çšãããããŒãžã§ã³ãæ瀺çã«æå®ããå¿ èŠããããŸãïŒããŒãžã§ã³1.9ã¯ä»¥äžã®äŸã«ç€ºãããŠããŸãïŒã
\pgfplotsset{compat=1.9}
ã°ã©ãã®åºæ¬
ãŸããã°ã©ãäœæã®æãåçŽãªäŸãæ€èšããPGGFPlotsã®ã»ãŒãã¹ãŠã®ã°ã©ããæ§æããäž»èŠã³ã³ããŒãã³ãã®ç®çã説æããŸãã
% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} % \begin{document} \begin{tikzpicture} \begin{axis}[ title = Exponenta, xlabel = {$x$}, ylabel = {$y$}, minor tick num = 2 ] \addplot[blue] {e^x}; \end{axis} \end{tikzpicture} \end{document}
Tikzpictureç°å¢
PGFPlotsã¯TikZïŒããã¯LaTeXã§ã°ã©ãã£ã«ã«ã€ã¡ãŒãžãäœæããããã«èšèšãããå¥ã®åªããããã±ãŒãžã§ãïŒã«åºã¥ããŠããããããã£ãŒãã¯ãã®ããã±ãŒãžã®å¯Ÿå¿ããtikzpictureç°å¢ã«é 眮ãããŸãã
\begin{tikzpicture} ... \end{tikzpicture}
TikZãšPGFPlotsã®ãã®ãããªå¯æ¥ãªé¢ä¿ã¯å€§ããªãã©ã¹ã§ããããšã«æ³šæããŠãã ãããããã¯ããŸããTikZã§äœæãããããŸããŸãªå³é¢ã«éåžžã«ããŸãã°ã©ããçµ±åããéã«ãã°ã©ããæäœãããšãã«TikZã®æ©èœã䜿çšã§ããããã§ãïŒåç §è¯ãäŸ ïŒã
ã°ã©ãã®è»žãèšå®ããç°å¢
ããã«ãäžèšã®ç°å¢å ã§ã¯ãã°ã©ãã®è»žãå®çŸ©ããå¥ã®ç°å¢ãå®çŸ©ãããŠããŸãã 次ã®è¡šã«ããã®ãããªç°å¢ã®äž»ãªçš®é¡ã瀺ããŸãã
ç°å¢ã®çš®é¡ | äºå® |
軞 | ç·åœ¢ã¹ã±ãŒãªã³ã°ã®æšæºè»ž |
ç察æ°è»ž | 察æ°x軞ã¹ã±ãŒãªã³ã°ãšæšæºy軞ã¹ã±ãŒãªã³ã° |
semilogyaxis | y軞ã®å¯Ÿæ°ã¹ã±ãŒãªã³ã°ãšx軞ã®æšæºã¹ã±ãŒãªã³ã° |
loglogaxis | 䞡軞ã®å¯Ÿæ°ã¹ã±ãŒãªã³ã° |
\pgfplotsset{title = Undefined chart}
ãã®ãããªããããã£ã¯å€æ°ããããã£ãŒãã®å€èŠ³ã®ã»ãšãã©ãã¹ãŠã®åŽé¢ãã«ã¹ã¿ãã€ãºã§ããŸãããããã¯ãã¹ãŠããã¥ã¢ã«ã«ãªã¹ããããŠããŸãã 以äžã¯ãæ€èšäžã®ç°å¢ã®æãäžè¬çãªããããã£ã®ãªã¹ãã§ãã
ç©ä»¶ | äºå® | å¯èœãªå€ |
å¹ ãé«ã | ã°ã©ãã®å¹ ãšé«ããããããèšå®ããŸã | |
ãã¡ã€ã³=æå°ïŒæ倧 | é¢æ°ã®å€ã®ç¯å²ãæå°ããæ倧ã®ç¯å²ã§èšå®ããŸã | |
xminãxmax | 暪軞ã«ããããæå°å€ãšæ倧å€ãèšå®ããŸã | |
yminãymax | 瞊軞ã«ããããæå°å€ãšæ倧å€ãèšå®ããŸã | |
xlabelãylabel | ãã£ãã·ã§ã³ã暪座æšãšçžŠåº§æšã«ããããèšå®ããŸã | |
èŠã | ã«ã¡ã©ã®å転ãèšå®ããŸããããããã£ã¯æ¬¡ã®ããã«æå®ãããŸããview = {azimuth} {elevation angle}; ãã®å Žåãæ¹äœè§ã¯ã«ã¡ã©äœçœ®ãšz軞ã®éã®è§åºŠã§ãããä»°è§ã¯ã«ã¡ã©äœçœ®ãšx軞ã®éã®è§åºŠã§ãã | |
ã°ãªãã | ã°ãªããã®ã¿ã€ãã瀺ããŸãã | major-ã°ãªããç·ã¯ã¡ã€ã³åºåã®ã¿ãééãã ãã€ã㌠-ã°ãªããç·ã¯è¿œå ã®åºåãééããŸãïŒã¡ã€ã³åºåã®éïŒã äž¡æ¹ -ã°ãªããç·ã¯äž¡æ¹ã®ã¿ã€ãã®åºåãééãã ãªã -ã°ãªããã¯ååšããŸãã[ããã©ã«ã] |
ã«ã©ãŒããã | 䜿çšããé è²ãèšå®ããŸã | hotãhot2ãjetãblackwhiteãblueredãcoolãgreenyellowãredyellowãviolet ãããã³ãŠãŒã¶ãŒãäœæãããã®ä» |
ãã£ãŒããè¿œå ãã
æ€èšããäŸã§ã¯ãã°ã©ããaddplotã³ãã³ãã䜿çšããŠè¿œå ãããããšãæãåºããŠãã ããããã®ã³ãã³ãã§ã¯ãã°ã©ãããããããããé¢æ°ãšã°ã©ãã®è²ãã¡ã€ã³ãã©ã¡ãŒã¿ãŒãšããŠæå®ãããŠããŸãã
\addplot[blue] {e^x};
䜿çšãããaddplotã³ãã³ãïŒ2次å ã°ã©ãã®å ŽåïŒããã³ãã®ã¢ããã°addplot3 ïŒ3次å ã°ã©ãã®å ŽåïŒã¯ãã°ã©ããäœæããããã®æãäžè¬çãªæ段ã§ãã ãã®ã³ãã³ãã®äžè¬çãªåœ¢åŒã¯æ¬¡ã®ãšããã§ãã
\addplot[<options>] <input data> <trailing path commands>;
ãªãã·ã§ã³<options>ã¯ãªãã·ã§ã³ã®ãã©ã¡ãŒã¿ãŒã§ããããã£ãŒãã®ã¿ã€ããè²ãã¹ã¿ã€ã«ãããŒã«ãŒã®ã¿ã€ããªã©ã瀺ããŸãã
å ¥åããŒã¿<input data>ã¯ãã°ã©ãã®äœæå 容ã«åºã¥ããŠæ±ºå®ããŸãããã®äŸã§ã¯ãé¢æ°ãå ¥åããŒã¿ãšããŠæå®ãããŸããããåŸã§ç€ºãããã«ãå ¥åããŒã¿ã®éžæã¯ã¯ããã«åºãã§ãã
ç°¡åãªèŠçŽãšããŠ
ãããã£ãŠãPGGFPlotsã®æŠèŠãèŠçŽããŸãã
- ãã¹ãŠã®ã°ã©ãã£ãã¯ã¯tikzpictureç°å¢ã«é
眮ãããŸãã
\begin{tikzpicture} ... \end{tikzpicture}
- ã°ã©ãã衚瀺ããã«ã¯ãããã«äœ¿çšããã軞ã®ã¿ã€ãã決å®ããç°å¢ãäœæããå¿
èŠããããŸããããšãã°ã axisã§ãã
\begin{axis} ... \end{axis}
- 次ã«ãäœæãããç°å¢å
ã§ã \ addplotããã³\ addplot3ã³ãã³ãã䜿çšããŠããã£ãŒããæãé »ç¹ã«è¿œå ãããŸã ã
\addplot[<options>] <input data> <trailing path commands>;
å ¥åããŒã¿
ããã¥ã¡ã³ã ïŒppã40-63ïŒã«æžãããå 容ãè€è£œããããå ¥åããŒã¿ãæäœããããšã®åŸ®åŠãªç¹ãè¿°ã¹ããããããšãæãŸãªããããæãäžè¬çãªåœ¢åŒã®äž»ãªæ¹æ³ã«çŠç¹ãåœãŠããããã説æããããã€ãã®äŸãæããŸãã
æ°åŠããŒã¹ã®ã°ã©ã
æ°åŒã«åºã¥ããã£ãŒãäœæããŒã ã®äžè¬çãªèŠæ¹ã¯ããã§ã«ããªãã¿ã®ã¯ãã§ãã
\addplot[<options>] {math_expression} <trailing path commands>;
æ°åŒãåŠçããã«ã¯ãçµã¿èŸŒã¿ã®ããŒãµãŒã䜿çšãããŸããããã¯ãå€ãã®ã³ã³ãã¥ãŒã¿ãŒä»£æ°ã·ã¹ãã ã«ããªãè¿ãæ§æãæã£ãŠããããããã®æäœã¯ç¹ã«é£ãããããŸããã æ°åŠçãªæŒç®åãšé¢æ°ã®å®å šãªãªã¹ãã¯ã ãã®ããã¥ã¡ã³ã ïŒpã933ïŒã«ãããŸãã äžè¬çãªå°è±¡ããŸãšãããã®ã®ããã€ãã以äžã«ç€ºããŸãã
ãªãã¬ãŒã¿ãŒ | äºå® |
+ | å ç®æŒç®å |
- | æžç®æŒç®å |
* | ä¹ç®æŒç®å |
/ | é€ç®æŒç®å |
^ | ã¹ãä¹æŒç®å |
mod | å°äœæŒç®å |
ïŒ | åŸçœ®éä¹æŒç®å |
< ã > ã == ã <= ã > = | æ¯èŒæŒç®å |
æ©èœ | äºå® |
è ¹ç | ã¢ãžã¥ãŒã«ã¯æ©èœãåããŸã |
sinãcosãtanãasinãacosãatan | åºæ¬çãªäžè§é¢æ°ãšãã®éé¢æ° |
lnãlog2ãlog10 | èªç¶ã2é²æ°ããã³10é²æ°ã®å¯Ÿæ° |
deg | ã©ãžã¢ã³ã床ã«å€æããæ©èœïŒããã©ã«ãã§ã¯ãåé¡ã®ããŒãµãŒãã©ãžã¢ã³ã§ã¯ãªã床ã§æ©èœããããšãèæ ®ãããšç¹ã«äŸ¿å©ã§ãïŒ |
以äžã¯ãæ°åŒã«åºã¥ããŠ3Dã°ã©ããäœæããäŸã§ãã
% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} % \begin{document} \begin{tikzpicture} \begin{axis}[ view={110}{10}, colormap/greenyellow, colorbar ] \addplot3[surf] {-sin(x^2 + y^2)}; \end{axis} \end{tikzpicture} \end{document}
åè¿°ã®colorbarã³ãã³ãã䜿çšããããšã«æ³šæããŠãã ããããã®ã³ãã³ãã¯ãè²ãšé¢æ°ã®å€ã®éã®å¯Ÿå¿ãèšå®ããã¹ã±ãŒã«ãè¿œå ããŸãã
å ¥å座æšã«åºã¥ãããããã
ãã®æ¹æ³ã¯åã®æ¹æ³ãããã¯ããã«åçŽã§ããããŠãŒã¶ãŒã¯åã«é åºãã¢ïŒxãyïŒ ïŒ2次å ã°ã©ãã®å ŽåïŒãŸãã¯ïŒxãyãzïŒ ïŒ3次å ã°ã©ãã®å ŽåïŒã®ãªã¹ããæå®ããã ãã§ããããã«åºã¥ããŠã°ã©ããäœæãããããšãæå³ããŸãã
\addplot[<options>] coordinates {<coordinate list>} <trailing path commands>
ããã«äŸãæ€èšããŠãã ããïŒ
% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} % \begin{document} \begin{tikzpicture} \begin{axis} \addplot coordinates { (0,1) (2,4) (7,8) (10,15) }; \end{axis} \end{tikzpicture} \end{document}
é åºä»ããã¢ã¯ãç¹å¥ãªåºåãæåã䜿çšããã«ã¹ããŒã¹ã§åºåãã ãã§ããããšã«æ³šæããŠãã ããã
ããŒãã«ã«åºã¥ããã£ãŒã
ããŒãã«ã«åºã¥ããã£ãŒãã¯ãããŸããŸãªãã£ãŒããäœæããããã®éåžžã«äžè¬çã§äŸ¿å©ãªæ¹æ³ã®1ã€ã§ãã
\addplot table [<column selection>] {(file or inline table)}.
ãŸããããŒãã«ãæäœããåºæ¬ååãå®çŸ©ããŸãã
- è¡ã¯æ¹è¡ã§åºåãããŸãã ãã®åœ¹å²ã§\\æåã䜿çšããã«ã¯ã次ã®ããããã£ãèšå®ããå¿
èŠããããŸãã
table/row sep = \\
- éåžžãåã¯ã¹ããŒã¹ãŸãã¯ã¿ãã§åºåãããŸãã 次ã®ããããã£ã䜿çšããŠããã®ããŒã«ãä»ã®ãã£ã©ã¯ã¿ãŒã«èšå®ã§ããŸãã
table/col sep = space|tab|comma|colon|semicolon|braces|&|ampersand
- ïŒãŸãã¯ïŒ ã§å§ãŸãè¡ã¯ç¡èŠãããŸãã
æå¹ãªããŒãã«ã®äŸã以äžã«ç€ºããŸãã
abc 1 1 1 2 3 4 3 5 5 4 8 6 5 2 7
<åã®éžæ>ãã©ã¡ãŒã¿ãŒã¯ãç¹å®ã®è»žïŒãŸãã¯åŸã»ã©èª¬æããã¡ã¿æ å ±ã®ãœãŒã¹ïŒãšåã®éã®å¯Ÿå¿ãå®çŸ©ããŸãã察å¿ã¯è¡šã®æåã®è¡ã§èšå®ãããŸããããã¯ä»¥äžã®äŸã§æ確ã«ããããŸãã
åã蟌ã¿ããŒãã«ã«åºã¥ãããããïŒã€ã³ã©ã€ã³ïŒ
% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} % \begin{document} \begin{tikzpicture} \begin{axis} \addplot3 table [x = b, y = a, z = c] { abc 1 1 1 2 3 4 3 5 5 4 8 6 5 2 7 }; \end{axis} \end{tikzpicture} \end{document}
å€éšãã¡ã€ã«ã®ããŒãã«ã«åºã¥ããŠã°ã©ãããããããã
ããå®çšçãªäŸãèããŠã¿ãŸãããã 次ã®ãªã³ã¯ã«ã¯ãçŽ1äžçŽã®ãã·ã¢ã®äººå£çµ±èšç¶æ³ïŒRSFSRïŒã«é¢ããããŒã¿ãå«ãŸãã.csvãã¡ã€ã«ãå«ãŸããŠããŸãã
% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} % \begin{document} \begin{tikzpicture} \begin{axis}[ table/col sep = semicolon, height = 0.6\paperheight, width = 0.65\paperwidth, xmin = 1927, xmax = 2014, /pgf/number format/1000 sep={} ] \addplot table [x={Year}, y={Average population}] {RussianDemography.csv}; \end{axis} \end{tikzpicture} \end{document}
åœç¶ããããã¯ãã¹ãŠã®æ¹æ³ãšã¯ã»ã©é ããã®ã§ãããç§ãã¡ã®æ€èšãã¯ããã«è¶ ããŠãPGPlotsã¯ä»ã®ã¢ããªã±ãŒã·ã§ã³ïŒããšãã°GNUPlotïŒãšã®çžäºäœçšãã°ã©ãäœæã§ã®ã¹ã¯ãªããã®äœ¿çšãå€éšã°ã©ãã£ãã¯ã¹ã®å°å ¥ãªã©ãè¡ããŸã
ãã£ãŒãã®èšå®
ãã£ãŒãã®å ¥åããŒã¿ãã©ã®ããã«èŠããããããã£ãã®ã§ãä»åºŠã¯ãã£ãŒããæ§æããããç解ããããèŠèŠçã«ããæ¹æ³ã«æ³šæãåãããšãã§ãã
å¡äŸã°ã©ãã£ãã¯ã¹
å¡äŸã¯ããã£ãŒãã«è¡šç€ºãããå 容ã説æãã眲åã§ãã å¡äŸã䜿çšãããšãè€æ°ã®ç°ãªãã°ã©ããããå Žåã«ç¹ã«äŸ¿å©ã§ãã
å¡äŸã説æããã«ã¯ã \ legend {...}ã³ãã³ãã䜿çšã§ããŸãããã®ã³ãã³ãå ã§ã¯ãã°ã©ãã®èª¬æãã«ã³ãã§ãªã¹ããããŸãïŒPGFPlotsã¯ã説æãšã°ã©ããè¿œå ãããé åºã§èª¬æãšã°ã©ãã®å¯Ÿå¿ã決å®ããŸãïŒã
% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} % \begin{document} \begin{tikzpicture} \begin{axis} [ legend pos = north west, ymin = 0, grid = major ] \legend{ $\log_2(x)$, $\ln(x)$, $\log_{10}(x)$ }; \addplot {log2(x)}; \addplot {ln(x)}; \addplot {log10(x)}; \end{axis} \end{tikzpicture} \end{document}
ãã®äŸã§ã¯ãå¡äŸã«åºã¥ããŠã°ã©ããäœæãããæ°åŒã衚瀺ãããŸãããäžè¬çã«ã¯ãä»»æã®ããã¹ãã䜿çšã§ããŸãã
ããã«ã å¡äŸposããããã£ã䜿çšãããŸãããããã«ããããã£ãŒãäžã®å¡äŸã®äœçœ®ïŒ å西ãåæ±ãå西ãåæ±ãå€åŽåæ± ïŒãæå®ã§ããŸãã
ã«ã¹ã¿ã ã¹ã¿ã€ã«
æãåçŽãªäŸãèããŠã¿ãŸããããå®éšããŒã¿ãåæ ããã°ã©ãã¯èµ€ã§åŒ·èª¿è¡šç€ºãããæ°åŠã¢ãã«ã®ã°ã©ããåæ ããé¢æ°ã®ã°ã©ãã¯éã§ããããšãããã¥ã¡ã³ãã§æ £äŸãšãªã£ãŠããŸãã ããã¯ãçœé»ã®èšäºã®ã¿ãåãå ¥ãããšåºç瀟ãç§ãã¡ã«åãããŸã§æ£ç¢ºã«åãå ¥ãããããããã°ã©ãã®å€èŠ³ãå€æŽããå¿ èŠãããã倧ããªããã¥ã¡ã³ãã®ãã¬ãŒã ã¯ãŒã¯å ã§ã¯å°é£ã§éå±ãªäœæ¥ã§ãã
ãããã£ãŠããã®ãããªç¶æ³ã§ã¯ãããã¥ã¡ã³ãå ã®1ã€ã®å Žæã§ã¹ã¿ã€ã«ãèšè¿°ããããããã£ãŒãã«é©çšããæ¹ãã¯ããã«åªããŠããŸãã ãã®ãããªã«ã¹ã¿ã ã¹ã¿ã€ã«ãäœæããã«ã¯ã次ã®åŒæ°ãæå®ãã\ pgfplotssetã³ãã³ãã䜿çšããŸãã
\pgfplotsset{<style_name>/.style={<key-value-list>}};
ããã«ãå ã»ã©èª¬æããäŸã«äŒŒãäŸãèããŠã¿ãŸãããã
% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} % \pgfplotsset{model/.style = {blue, samples = 100}} \pgfplotsset{experiment/.style = {red}} % \begin{document} \begin{tikzpicture} \begin{axis}[xmin = 0, ymax = 125] \addplot[model]{e^(x)}; \addplot[experiment] table { xy 0.1 1.5 1.3 2.1 2.7 12.2 3.5 25.6 4.1 57.0 5.3 121.6 }; \end{axis} \end{tikzpicture} \end{document}
ããŒã«ãŒ
ããŒã«ãŒã¯ãæãäžè¬çãªçšèªã§ã¯ããã£ãŒãäžã®ãã€ã³ãã§ãã ããã¥ã¡ã³ãã«ã¯ããŸããŸãªã¿ã€ãã®æšæºããŒã«ãŒã®è©³çŽ°ãªãªã¹ãããããŸã ïŒpã160ïŒã
ãã€ãã®ããã«ãããããèšå®ããããã®å€ãã®ããŒã«ããããŸããåç §ããããã¥ã¡ã³ãã§ãããã¹ãŠã説æãããŠããããã§ã¯ãããŸããã æãäžè¬çãªæ§ææ¹æ³ãæ€èšããŠãã ããã
ããŒã«ãŒã¿ã€ãã®éžæã¯ã次ã®ããããã£ã䜿çšããŠå®è¡ãããŸãã
mark = <type_of_marker>
次ã®ããããã£ã䜿çšããŠã3ã€ã®åºæ¬çãªãã©ã¡ãŒã¿ãŒïŒããŒã«ãŒã®ãµã€ãºãå¡ãã€ã¶ãã®è²ãããã³èŒªéïŒãæ§æã§ããŸãã
mark options={scale = <relative_scaling>, fill = <color>, draw = <color>
å®çŸ©æžã¿ã®è²ã¯ãããããããŸãããããšãã°æ¬¡ã®ã³ãã³ãã䜿çšããŠããã€ã§ãç¬èªã®è²ãè¿œå ã§ããŸãã
\definecolor{<name_of_color}{rgb}{..., ..., ... }
äŸãèããŠã¿ãŸãããïŒ
% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \definecolor{chucknorris}{rgb}{192,0,0} % \begin{document} \begin{tikzpicture} \begin{axis} \addplot[ mark = *, mark options = { scale = 1.5, fill = pink, draw = chucknorris } ]{x^2}; \end{axis} \end{tikzpicture} \end{document}
ã°ã©ãã£ãã¯ã¹ç·ãšãã®è²
ãããªãã·ã£ãŒåãã®çœé»ã°ã©ãã£ãã¯ã¹ã«ã€ããŠä»¥åã«è©±ãããšãã確ãã«ãã°ã©ãã£ãã¯ãåºå¥ãã1ã€ã®æ¹æ³ã¯ã1ã€ãç¹ç·ã§åŒ·èª¿è¡šç€ºãããã1ã€ãå®ç·ã§åŒ·èª¿è¡šç€ºããããšã ãšããããšãçããã¯èŠããŠããŸããã ãã¡ãããããã¯ãã¹ãŠããã§è¡ãããšãã§ããŸãã
ãã¹ãŠã®ç·ã¹ã¿ã€ã«ïŒäž»ã«ããŸããŸãªçš®é¡ã®ç Žç·ïŒã¯ãããã¥ã¡ã³ã ïŒpã165ïŒã«èšèŒãããŠããŸã ã ã°ã©ãã£ãã¯ãªã©ã®ãªãã·ã§ã³ã§ã¹ã¿ã€ã«åãæ瀺çã«æå®ããããšã§èšå®ãããŸãã
ã°ã©ãã®ç·ã®å€ªãã¯ã ç·å¹ ããããã£ã䜿çšããŠèšå®ãããŸãã
line width = <width_of_line>
ã°ã©ãã®ç·ã®è²ã¯ã drawããããã£ã䜿çšããŠèšå®ãããŸãã
draw = <color>
% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} % \begin{document} \begin{tikzpicture} \begin{axis}[ domain=0:1, legend pos = north west ] \legend{$e^x$, $1 + x + x^2/2$} \addplot[dashed, draw = blue]{e^x}; \addplot[solid, draw = red]{1 + x + x^2/2}; \end{axis} \end{tikzpicture} \end{document}
ããã€ãã®ã¿ã€ãã®2Dã°ã©ãã£ãã¯ã¹ã®äŸ
æ¢å®ã§ã¯ã2次å ã°ã©ãã¯ç·åœ¢ã°ã©ãã§ãïŒãã®ã¿ã€ããæ瀺çã«éžæããã«ã¯ãè¿œå ãããã°ã©ãã®ãªãã·ã§ã³ã§ã·ã£ãŒãããããããããã£ãæå®ããå¿ èŠããããŸãïŒã å®éããã®ã¿ã€ãã®ãã£ãŒãã¯ã瀺ããããã€ã³ããçŽç·ã§åçŽã«æ¥ç¶ããŸãã ãã ããå®éã«ã¯ã2次å ã°ã©ãã«ã¯ããã«å€ãã®çš®é¡ãããã ããã¥ã¡ã³ã ïŒpã75-114ïŒã§èª¬æãããŠããŸã ã
次ã«ãäŸãšããŠãå®éã«äœ¿çšããå¿ èŠã®ããä»ã®ã¿ã€ãã®ã°ã©ããããã€ãæ€èšããŸãã
æ£ã°ã©ã
ãã¹ãã°ã©ã ãäœæããã«ã¯ã xbarããããã£ã«å¯Ÿå¿ããæ°Žå¹³ãã¹ãã°ã©ã ãšybarããããã£ã«å¯Ÿå¿ããåçŽãã¹ãã°ã©ã ã®2çš®é¡ã®ã°ã©ãããããŸãã
以äžã¯ã2010幎ãã2014幎ã«äºç®ã«èšäžããã人ã ã®å°åæ§é ãåæ ããåçŽæ£ã°ã©ãã®äœæäŸã§ãã HSEã§ïŒ
% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} % \begin{document} \begin{tikzpicture} \begin{axis}[ ybar, width = 250pt, /pgf/number format/1000 sep={}, legend style={ at={(0.5,-0.25)}, anchor=south, legend columns=-1 } ] \addplot coordinates { (2010, 34) (2011, 39) (2012, 39) (2013, 36) (2014, 32.6) }; \addplot coordinates { (2010, 12) (2011, 11) (2012, 14) (2013, 12) (2014, 10.7) }; \addplot coordinates { (2010, 54) (2011, 50) (2012, 47) (2013, 52) (2014, 56.7) }; \legend{Moscow, Moscow region, Other regions} \end{axis} \end{tikzpicture} \end{document}
æ£åžå³
æ£åžå³ã¯ãããŒã«ãŒã®ã¿ãå«ãããããã®å€§ããªååã§ããã€ãŸããããããäžã®å€ãã®ãã€ã³ããè¡šããŸãã ãã®ã¿ã€ãã®ãã£ãŒããéžæããã«ã¯ã marksããããã£ã®ã¿ã䜿çšãããŸãã
ããã«å®çšçãªäŸãèããŠã¿ãŸããããæåã®2åããã€ã³ãã®2次å 座æšãåæ ãã3çªç®ã3ã€ã®ã¯ã©ã¹ã¿ãŒã®1ã€ã«å±ããããŒãã«ãæã£ãŠããŸãã äžæ¹ã§ã¯ç©ºéå ã®ç¹ã®äœçœ®ããä»æ¹ã§ã¯ç¹å®ã®ã¯ã©ã¹ã¿ãŒã«å±ããç¹ã®äœçœ®ãåæ ããã°ã©ããäœæããå¿ èŠããããŸãã
% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.9} % \begin{document} \begin{tikzpicture} \begin{axis} \addplot[ mark=halfcircle*, mark size=3pt, only marks, point meta=explicit symbolic, scatter, scatter/classes={ a={blue}, b={red}, c={black} }] table [meta=class] { xy class 1 4 a 1 2 a 0 3 a 0 2 a 5 6 b 5 5 b 4 5 b 5 7 b 9 9 c }; \end{axis} \end{tikzpicture} \end{document}
æåã«æ³šæããå¿ èŠãããã®ã¯ãããŒãã«ããããã£ã§ãåã ã¡ã¿ã瀺ãããšã§ãããã®çµæãéžæããã¯ã©ã¹åãããŒãã«èŠçŽ ã®äžéšã®ã¡ã¿ããããã£ãæ åœããŸãã
次ã«ããã©ã¡ãŒã¿ãŒã¯ã以åã«è¡ã£ãããŒã«ãŒã®å€èŠ³ã瀺ãã次ã«ã metaã³ãã³ãã䜿çšããŸããããã¯ãã¡ã¿æ å ±ãååŸããå Žæãšæ¹æ³ã瀺ãPGFPlotã瀺ããŸãã
point meta = none|<math_expression>|x|y|z|f(x)|explicit|explicit symbolic
詳现ã«ã€ããŠã¯ããã¥ã¡ã³ãïŒpã185ïŒãåç §ããŠãã ããã æ瀺çãªã·ã³ããªãã¯å€ãéžæããããšããäºå®ã«ã€ããŠã®ã¿èª¬æããŸããã€ãŸããã¡ã¿ããŒã¿ã¯ãããŒãã«ããããã£ã«ç»é²ãããŠããåããååŸãããŸãã
ãããŠæåŸã«ãç¹å®ã®ã¯ã©ã¹ã¿ãŒã®åº§æšãŸãã¯ã¡ã³ããŒã·ããã«å¿ããŠããŒã«ãŒã®å€èŠ³ãå€æŽããããšãå«ãã æ£åžã®é¡èãªç¹æ§ã瀺ãããŸããã ãããšçµã¿åãããŠã scatter / classesããããã£ã䜿çšãããŸããããã¯ãããŒã«ãŒãç¹å®ã®ã¯ã©ã¹ã¿ãŒã«å±ãããã©ããã«å¿ããŠããŒã«ãŒã®å€èŠ³ãã©ã®ããã«å€æŽããããèšå®ããŸãã
ãŸãšãããš
ããã§ãèšäºã¯çµãããŸããããããŠããããŸã§èªãã§ãããçããã«æè¬ããŸãã ããã§ã¯æ°·å±±ã®äžè§ã ããèæ ®ãããŠããããšãPGGFPlotsãæäŸããæ©äŒã®äžéšã®ã¿ãèæ ®ãããŠããããšãããç¥ã£ãŠããŸãããã¡ãããèå³æ·±ãæçšãªãã®ãããããæ®ãããŠããŸãã ããããããã§ããªãããã®èšäºããã®èª²é¡ãéæããããšãé¡ã£ãŠããŸããããã¯çŽ¹ä»ãšèå³ãåŒãããšã§ãã
ãã®ãããªå ¥éèšäºã§èŠããããšãäœããèŠèœãšãããŠããããéã«ã©ããã詳现ããããšèããããŠããããšã«ã€ããŠããæ°è»œã«ãèŠæããèãããã ããã
ãããªãç 究ã®ããã®æç®ãšåèæç®
1.ãã®ããã±ãŒãžã«é¢ããæãä¿¡é Œã§ããäž»èŠãªæ å ±æºã¯ãåè¿°ã®èšå€§ãªå ¬åŒããã¥ã¡ã³ãã§ãã
2. PGFPlots.netã ãã§ãªãã ãã¡ãã«ãå€æ°ã®äŸããããŸã ã
3. PGFPlotã«é¢é£ããå€æ°ã®è³ªåã«ã€ããŠã¯ã ããã§åçãåãåããŸãã ã