增加数轴上的数字之间的距离

增加数轴上的数字之间的距离

梅威瑟:

\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通过在选项中添加(其中N是某个大于 1 的数字)来沿 x 方向缩放图表tikzpicture
  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}

相关内容