微量元素:
\documentclass[12pt,a4paper]{article}
\usepackage[a4paper,bindingoffset=0.2in,left=0.7in,right=0.7in,top=0.7in,bottom=0.7in,footskip=.25in]{geometry}
\usepackage[centertags]{amsmath}
\usepackage{latexsym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{newlfont}
\usepackage{enumerate}
\usepackage{makeidx}
\usepackage{tikz}
\usetikzlibrary{backgrounds,intersections}
\setlength\columnsep{10pt} % This is the default columnsep for all pages
\begin{document}
\begin{center}
\begin{tikzpicture}
\draw[thick,latex-latex] (-4,0) -- (4,0)node[right]{$x$};
\foreach \x in {-3,-2,-1,0,1,2,3}{
\node[fill,circle,inner sep=1.5pt,label=below:$\x$] at (\x,0) {};
};
\end{tikzpicture}
\end{center}
\end{document}
問題:如何增加數軸節點之間的距離?
答案1
三種可能性:
- 透過將(其中 是大於 1 的數字)新增至選項中
xscale=N
,在 x 方向縮放圖表。N
tikzpicture
x=Ncm
透過新增選項,將 x 單位向量設定為比預設 1cm 更長的值tikzpicture
。- 將所有 x 座標乘以某個大於 1 的數字。
\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}[xscale=1.5]
\draw[thick,latex-latex] (-4,0) -- (4,0)node[right]{$x$};
\foreach \x in {-3,-2,-1,0,1,2,3}{
\node[fill,circle,inner sep=1.5pt,label=below:$\x$] at (\x,0) {};
};
\end{tikzpicture}
\begin{tikzpicture}[x=1.5cm]
\draw[thick,latex-latex] (-4,0) -- (4,0)node[right]{$x$};
\foreach \x in {-3,-2,-1,0,1,2,3}{
\node[fill,circle,inner sep=1.5pt,label=below:$\x$] at (\x,0) {};
};
\end{tikzpicture}
\begin{tikzpicture}
\draw[thick,latex-latex] (-4*1.5,0) -- (4*1.5,0)node[right]{$x$};
\foreach \x in {-3,-2,-1,0,1,2,3}{
\node[fill,circle,inner sep=1.5pt,label=below:$\x$] at (\x*1.5,0) {};
};
\end{tikzpicture}
\end{center}
\end{document}