Search In This Website

Selasa, 10 Juni 2025

Latex Linear Graph 1

1. Type this following Latex source code in Latex editor:

% !TEX ts-program=pdflatex

\documentclass{article}

\usepackage{tikz}

\usetikzlibrary{calc}

%% for preview only

\usepackage[active,tightpage]{preview}

\PreviewEnvironment{tikzpicture}

\setlength\PreviewBorder{5pt}

\begin{document}

\begin{figure}[ht]

\centering

\begin{tikzpicture}

\draw[style=help lines,gray!35](0, 0) grid [step={($(0.25, 0.25) - (0, 0)$)}] (4, 4);

%% specifying coordinate

\coordinate (A) at (0,3);

\coordinate (B) at (3,0);


%% Syntax For Specifying Points

%% Syntax For Path Specifications

%% Draw absis and ordinate line;

\draw[-latex, very thick] (-0.2,0) -- (4,0) coordinate (C) node[right] {$x$};

\draw[-latex, very thick] (0,-0.2) -- (0,4) coordinate (D) node[left] {$y$};


%% create a nodes

%% drawing slanted/skew/gradient line

\draw[thick] (0,3) coordinate(A) -- (3,0) coordinate(B);

\draw (A) node {\textbullet};

\draw (A) node[left] {a};

\draw (B) node {\textbullet};

\draw (B) node[below] {b};


%% rotational relative coordinates
\draw[-latex,dashed,thick] (B) to [bend right]  (D);
\draw[-latex,dashed,thick] (A) to [bend left]  (C);

\end{tikzpicture}
\end{figure}
\end{document}
2. Save as equationofstraightline1.tex
3. Compile or build the file.

Output



Bibliography

https://www.mathsisfun.com/
https://www.ncl.ac.uk/ ( university )

Tidak ada komentar:

Posting Komentar