Created
November 26, 2016 11:09
-
-
Save hyuki0000/1a18e78f82a7647d382c232fcbd67a52 to your computer and use it in GitHub Desktop.
y = 90/x (1 <= x <= 90) のグラフで格子点をプロットする
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \documentclass[dvipdfmx,a4paper,10pt]{jsbook} | |
| \usepackage{tikz} | |
| \usepackage{ifthen} | |
| \usepackage{calc} | |
| \pagestyle{empty} | |
| \begin{document} | |
| \begin{tikzpicture}[line join=round,line cap=round,>=latex,x=1mm,y=1mm] | |
| \tikzset{AXIS/.style={color=black,thin,->}} | |
| \tikzset{GRID/.style={color=gray!50!white,very thin}} | |
| \def\MINT{0}\def\MAXT{90}\def\MINX{0}\def\MAXX{90}\def\MINY{0}\def\MAXY{90} | |
| \draw[AXIS] (\MINX,0) -- (\MAXX,0); | |
| \draw[AXIS] (0,\MINY) -- (0,\MAXY); | |
| \foreach \t in {\MINT,...,\MAXT} { | |
| \draw[GRID] (\MINX,\t) -- (\MAXX,\t); | |
| \draw[GRID] (\t,\MINY) -- (\t,\MAXX); | |
| } | |
| \newcounter{xy} | |
| \foreach \x in {\MINX,...,\MAXX} { | |
| \foreach \y in {\MINY,...,\MAXY} { | |
| \setcounter{xy}{\x*\y} | |
| \ifthenelse{\value{xy}=\MAXT} { | |
| \fill[red] (\x,\y) circle (1.5pt); | |
| \ifthenelse{\x < \y} { | |
| \draw (\x,\y) node[above right] {\tiny$(\x,\y)$}; | |
| }{ | |
| \draw (\x,\y) node[below left] {\tiny$(\x,\y)$}; | |
| }; | |
| }{}; | |
| } | |
| } | |
| \end{tikzpicture} | |
| \end{document} |
Author
hyuki0000
commented
Nov 26, 2016

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment