1. Type this following latex code in the latex editor:
% !TEX TS-program=pdflatex
% !TEX encoding=UTF-8 Unicode
%
%% File name: linearGraphTypes1b.tex
%% Document Definitions:
%% LINEAR FUNCTIONS GRAPH
%%-----------------------------------
\documentclass[12pt,a4paper]{report}
%% Load Packages
\usepackage{amsmath}
\usepackage{bm}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{0.25pt}
\usepackage{libertine}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\pgfplotsset{%
axis line origin/.style args={#1,#2}{
x filter/.append code={ % Check for empty or filtered out numbers
\ifx\pgfmathresult\empty\else\pgfmathparse{\pgfmathresult-#1}\fi
},
y filter/.append code={
\ifx\pgfmathresult\empty\else\pgfmathparse{\pgfmathresult-#2}\fi
},
xticklabel=\pgfmathparse{\tick+#1}\pgfmathprintnumber{\pgfmathresult},
yticklabel=\pgfmathparse{\tick+#2}\pgfmathprintnumber{\pgfmathresult}
}
}
\makeatletter \newcommand{\pgfplotsdrawaxis}{\pgfplots@draw@axis} \makeatother
\pgfplotsset{
every tick/.append style={color=black},
after end axis/.append code={
\pgfplotsset{
axis line style=opaque,
ticklabel style=opaque,
tick style=opaque,
grid=none
}
\pgfplotsdrawaxis
},
} % applies to major and minor ticks,
\begin{document}
\begin{tikzpicture}
%% Function Title
\node (0,0) {\textbf{Vertical Line Test}};
\node[below] at (0,-0.10) {\textbf{Function}};
\node[below] at (0,-0.45) {\textbf{in}};
\node[below] at (0,-0.75) {\textbf{Coordinate Cartesian}};
\node[below] at (0,-1.1) {\textbf{Plane}};
\end{tikzpicture}
\begin{tikzpicture}[scale=1]
\begin{axis}[x=1cm,y=1cm,
latex-latex,
axis lines = middle,
xlabel = {$x$},
ylabel = {$y$},
xtick = \empty,
ytick = \empty,
xmin=-3.2, xmax=3.2,
ymin=-3.1, ymax=3.1,small, axis on top, grid=none, minor grid style={very thin,gray!30}, major grid style={very thin,gray!30}]
% Plot 2 undefined slope, x = constant, type of line: vertical
\addplot [
domain = -1:5,
samples = 1000,blue,very thick] coordinates {(-1.5,-6)(-1.5,6)}
node [pos=.65, left, black] {\bfseries $\mathbf{x=b}$};
\end{axis}
\end{tikzpicture}
\end{document}
2. Save file as linearGraphTypes1b.tex
3. Then build or typeset the Latex code.
Output
< Previous Linear Functions Graph in Latex 1
Tidak ada komentar:
Posting Komentar