Sabtu, 09 November 2024

Draw A Cartesian Coordinate In Latex 1

  • Open the Latex editor
  • Type this following latex code in your Latex editor: 
%! TEX TS-program=pdflatex
%! TEX encoding=utf-8
\documentclass[12pt,titlepage]{report}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{fouriernc}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{pgfplots}
\usepackage[active,tightpage,pdftex]{preview}
\PreviewEnvironment[{[]}]{tikzpicture}
\setlength\PreviewBorder{0.25pt}
\author{private course and after school tutor}

\begin{document}

% -------------------

% title

% -------------------

\begin{figure}


\begin{tikzpicture}
\draw (0,0) node [anchor=center] {\Huge{Koordinat}};
\draw (0,-1) node [anchor=center] {\Huge{ Cartesius}};
\end{tikzpicture}
\end{figure}

% -------------------

% step 1

% -------------------

\begin{figure}

\begin{tikzpicture}%[->]

%draw gridline

\draw[help lines,opacity=.25] (-5,-5) grid (5,5);


% -------------------

%draw 0,0 node

% -------------------

\draw (0,0) node [anchor=north east, font=\bfseries] {$0$};


% -------------------

% draw axes line

% -------------------

\draw[-latex,thick,font=\bfseries] (-4.5,0) -- (4.5,0) node [anchor=north] {\large{$\mathsf{sumbu\ x}$}};

\draw[-latex,thick] (0,-4) -- (0,4) node [anchor=west] {\large{$\mathsf{sumbu\ y}$}};


% -------------------

% draw axes label

% -------------------

\foreach \i in {1, ..., 3} \draw(\i,2.5pt) -- +(0,-5pt) node [anchor=north, font=\bfseries] {\large{$\i$}} (-\i,2.5pt) -- +(0,-5pt) node [anchor=north, font=\bfseries,fill=white] {\large{$-\i$}} (2.5pt,\i) -- + (-5pt,0) node [anchor=east, font=\bfseries] {\large{$\i$}} (2.5pt,-\i) -- + (-5pt,0) node [anchor=east, font=\bfseries, fill=white] {\large{$-\i$}};

\end{tikzpicture}

\end{figure}

\end{document}

  • save file as koordinatKartesius1.tex
  • Typeset or Build.

Output

Notes To see the more clear picture, click on the picture.


Tidak ada komentar:

Posting Komentar

Various Other Posts