增加數軸數字之間的距離

增加數軸數字之間的距離

微量元素:

\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. 透過將(其中 是大於 1 的數字)新增至選項中xscale=N,在 x 方向縮放圖表。Ntikzpicture
  2. x=Ncm透過新增選項,將 x 單位向量設定為比預設 1cm 更長的值tikzpicture
  3. 將所有 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}

相關內容