我正在尝试将底部指标集上的标签移至每行的末尾。我需要更改的指标是 flume 下方注释 %metrics 下的第二组。但是,我只能将其移至行上方并略微向右,而不是行尾。我不确定哪种标签样式能满足我的需要。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{tikz-dimline}
\usetikzlibrary{circuits.ee.IEC}
\usetikzlibrary{decorations.pathmorphing}
\title{Beji and Battjes 1993 Experiment}
\date{September 2021}
%this was used to create ground symbol
\newcommand\Ground{%
\mathbin{\text{\begin{tikzpicture}[circuit ee IEC,yscale=0.6,xscale=0.5]
\draw (0,2ex) to (0,0) node[ground,rotate=-90,xshift=.65ex] {};
\end{tikzpicture}}}%
}
\begin{document}
\maketitle
\section{Introduction}
Figure \ref{flume} is a schematic diagram for the Beji experiments
\begin{figure}[h!]
\begin{center}
\begin{tikzpicture}[x=0.15in,y=2.67in]
%bottom of flume
\draw[black, very thick] ( 0.00, 0.00) -- ( 6.00, 0.00) -- (12.00, 0.30) -- (14.00, 0.30) -- (17.00, 0.00) -- (18.95, 0.00) -- (37.70, 0.75);
%beach
\draw[black, very thick] (18.95, 0.00) -- (37.70, 0.0) -- (37.70, 0.75) -- cycle;
%some additional lines
\draw[black, very thick] (12.00, 0.0) -- (12.00, 0.30);
\draw[black, very thick] (14.00, 0.0) -- (14.00, 0.30);
\draw[black, very thick] ( 6.00, 0.00) -- (17.00, 0.00);
\draw[black, thick, double] ( 0.00, 0.00) -- (0.00, 0.4);
\draw[black, very thick, decorate, decoration={coil,aspect=0,amplitude=4.0, segment length=12}] (0.0,0.4) -- (2.0,0.4);
\draw[black, very thick] (2.0,0.4) -- (28.95,0.4);
%location of gauges
\filldraw[black] (6.0,0.6) circle (2pt) node[anchor=south] {1};
\draw[black, dashed] (6.0,0.6) -- (6.0,0.4);
\filldraw[black] (10.8,0.6) circle (2pt) node[anchor=south] {2};
\draw[black, dashed] (10.8,0.6) -- (10.8,0.4);
\filldraw[black] (12.8,0.6) circle (2pt) node[anchor=south] {3};
\draw[black, dashed] (12.8,0.6) -- (12.8,0.4);
\filldraw[black] (13.8,0.6) circle (2pt) node[anchor=south] {4};
\draw[black, dashed] (13.8,0.6) -- (13.8,0.4);
\filldraw[black] (14.8,0.6) circle (2pt) node[anchor=south] {5};
\draw[black, dashed] (14.8,0.6) -- (14.8,0.4);
\filldraw[black] (16.0,0.6) circle (2pt) node[anchor=south] {6};
\draw[black, dashed] (16.0,0.6) -- (16.0,0.4);
\filldraw[black] (17.6,0.6) circle (2pt) node[anchor=south] {7};
\draw[black, dashed] (17.6,0.6) -- (17.6,0.4);
%metrics above gauges
\dimline[label style={above}, extension start length=0, extension end length=0]{(6,0.7)}{(10.8,0.7)}{4.8}
\dimline[label style={above}, extension start length=0, extension end length=0]{(10.8,0.7)}{(12.8,0.7)}{2}
\dimline[label style={above}, extension start length=0, extension end length=0]{(12.8,0.7)}{(13.8,0.7)}{1}
\dimline[label style={above}, extension start length=0, extension end length=0]{(13.8,0.7)}{(14.8,0.7)}{1}
\dimline[label style={above}, extension start length=0, extension end length=0]{(14.8,0.7)}{(16,0.7)}{1.2}
\dimline[label style={above}, extension start length=0, extension end length=0]{(16,0.7)}{(17.6,0.7)}{1.6}
%metrics below flume
\dimline[label style={above}, extension start length=0, extension end length=0]{(0,-0.1)}{(6,-0.1)}{6}
\dimline[label style={above}, extension start length=0, extension end length=0]{(6,-0.1)}{(12,-0.1)}{6}
\dimline[label style={above}, extension start length=0, extension end length=0]{(12,-0.1)}{(14,-0.1)}{2}
\dimline[label style={above}, extension start length=0, extension end length=0]{(14,-0.1)}{(17,-0.1)}{3}
\dimline[label style={above}, extension start length=0, extension end length=0]{(17,-0.1)}{(18.95,-0.1)}{1.95}
\dimline[label style={above}, extension start length=0, extension end length=0]{(18.95,-0.1)}{(37.7,-0.1)}{18.75}
\dimline[label style={above right}, extension start length=0, extension end length=0]{(0,-0.2)}{(6,-0.2)}{6}
\dimline[label style={above right}, extension start length=0, extension end length=0]{(6,-0.2)}{(12,-0.2)}{12}
\dimline[label style={above right}, extension start length=0, extension end length=0]{(12,-0.2)}{(14,-0.2)}{14}
\dimline[label style={above right}, extension start length=0, extension end length=0]{(14,-0.2)}{(17,-0.2)}{17}
\dimline[label style={above right}, extension start length=0, extension end length=0]{(17,-0.2)}{(18.95,-0.2)}{18.95}
\dimline[label style={above right}, extension start length=0, extension end length=0]{(18.95,-0.2)}{(37.7,-0.2)}{37.7}
%metrics on side of flume
\dimline[label style={sloped=false}, extension start length=0, extension end length=0]{(-1,0)}{(-1,0.4)}{0.4}
\dimline[label style={sloped=false}, extension start length=0, extension end length=0]{(39,0)}{(39,0.75)}{0.75}
%measurements throughout diagram
\node (n1) at (11,0.15) {0.3};
\node (n2) at (9,0.2) {1:20};
\node (n3) at (16,0.2) {1:10};
\node (n4) at (26,0.2) {1:25};
\node (n5) at (35,0.175) {Beach};
\node (n6) at (-1,0.45) {Wave-board};
\node (n7) at (26,0.45) {Still water level};
\node (n8) at (22,0.43) {$\nabla$};
\node (n9) at (3,0.45) {$\longrightarrow$};
\node (n10) at (22,0.40) {$\Ground{}$};
\end{tikzpicture}
\caption{Definition sketch of wave flume and gauges.
\label{flume}}
\end{center}
\end{figure}
\end{document}
答案1
更改以下代码
调整pos
每个选择
按选择调整字体——
%metrics below flume
\dimline[label style={pos=0.9}, extension start length=0, extension end length=0, ]{(0,-0.1)}{(6,-0.1)}{\small 6}
\dimline[label style={pos=0.9}, extension start length=0, extension end length=0]{(6,-0.1)}{(12,-0.1)}{\small 6}
\dimline[label style={pos=0.9}, extension start length=0, extension end length=0]{(12,-0.1)}{(14,-0.1)}{\small 2}
\dimline[label style={pos=0.9}, extension start length=0, extension end length=0]{(14,-0.1)}{(17,-0.1)}{\small 3}
\dimline[label style={pos=0.5}, extension start length=0, extension end length=0]{(17,-0.1)}{(18.95,-0.1)}{\small 1.95}
\dimline[label style={pos=0.9}, extension start length=0, extension end length=0]{(18.95,-0.1)}{(37.7,-0.1)}{\small 18.75}