![如何制作覆盖图的自由体图?(圆形轴及其轴线上施加的力)](https://linux22.com/image/437743/%E5%A6%82%E4%BD%95%E5%88%B6%E4%BD%9C%E8%A6%86%E7%9B%96%E5%9B%BE%E7%9A%84%E8%87%AA%E7%94%B1%E4%BD%93%E5%9B%BE%EF%BC%9F%EF%BC%88%E5%9C%86%E5%BD%A2%E8%BD%B4%E5%8F%8A%E5%85%B6%E8%BD%B4%E7%BA%BF%E4%B8%8A%E6%96%BD%E5%8A%A0%E7%9A%84%E5%8A%9B%EF%BC%89.png)
到目前为止,我已经能够从 .csv 文件绘制其他图表:
\begin{figure}[H]
\centering
\resizebox{0.45\textwidth}{!}{
\begin{center}
\begin{tikzpicture}[x=1cm,y=1cm]
\begin{axis}[scaled ticks=false, tick label style={/pgf/number format/fixed} ,
axis lines=middle,
grid=major, % Display a grid
grid style={dashed,gray!30},
x label style={at={(axis description cs:1.13,0.55)},anchor=north},
y label style={at={(axis description cs:0,1)},anchor=south},
ylabel=M,
xlabel=L,
]
\addplot [color= black] table[y=M,x=X,col sep=comma]{momento2.csv};
\addplot [color= green,dash dot] table[y=YMAX,x=XMAX,col sep=comma]{Graficas/momento2.csv};
\end{axis}
\end{tikzpicture}
\end{center}}
\caption{Momento vs Distancia}
\label{momentovsdistancia}
\end{figure}
答案1
我猜你正在寻找类似的东西,但我不确定。另外,我们没有你的数据文件 (momento2.csv),所以我画的是近似函数。
你可以用 Ti 来绘画钾在 axis 环境中使用 Z,但您需要在此环境中引用坐标。为此,您需要使用axis cs:
如下选项
\draw[blue] (axis cs: \L,0) ellipse (0.025 and 0.08);
也更好地代替使用\pgfplotsinkoveforeach
,\foreach
但其余的是普通的 Ti钾Z。
\documentclass[border=2mm]{standalone}
\usepackage {pgfplots}
\usepackage {siunitx} % SI units
\pgfplotsset {compat=1.17}
\usetikzlibrary{babel} % sometimes tikz and babel don't get along
% (a veces hay conflictos con tikz y spanish babel,
% en particular con las flechas ->)
\begin{document}
\begin{tikzpicture}
\begin{axis}[scaled ticks=false, tick label style={/pgf/number format/fixed},
axis lines=middle,
grid=major, % Display a grid
grid style={dashed,gray!30},
x label style={at={(axis description cs:1.13,0.55)},anchor=north},
y label style={at={(axis description cs:0,1)},anchor=south},
ylabel=M,
xlabel=L,
clip=false, % <-- we want to draw 'outside' the axes
]
% I don't have the data so I'm drawing approximate functions
\def\L{0.27504}
\def\Y{0.43}
\pgfmathsetmacro\a{-4*\Y/(\L*\L)}
\pgfmathsetmacro\b{-\a*\L}
\addplot [domain=0:\L] {\a*x^2+\b*x)}; % momento2.csv
\addplot [color=green,dash dot] coordinates {(0,\Y) (\L,\Y)}; % Graficas/momento2.csv
% free body diagram
\draw[blue,dashed] (axis cs: 0,0.08) arc (90:-90:0.025 and 0.08);
\draw[blue] (axis cs: \L,0.08) --++ (-\L,0) arc (90:270:0.025 and 0.08) --++ (\L,0);
\draw[blue] (axis cs: \L,0) ellipse (0.025 and 0.08);
\draw[thick,green,-latex] (axis cs: 0 ,0.08) --++ (0,0.2) node [black,right] {$R_a$};
\draw[thick,green,-latex] (axis cs: \L,0.08) --++ (0,0.2) node [black,right] {$R_b$};
\draw[blue,<->] (axis cs: 0, 0.15) --++ (\L,0);
\draw[orange] (axis cs: 0,-0.13) --++ (\L,0);
\pgfplotsinvokeforeach{0,...,10}
{%
\draw[orange,-latex] (#1*\L/10,-0.08) --++ (0,-0.05);
}
\node[draw] at (0.5*\L,-0.16) {\SI{46.9670}{N/m}};
\node[draw] at (0.5*\L, 0.18) {\SI{0.27504}{m}};
\node at (0.5*\L, 0.22) {$L$};
\end{axis}
\end{tikzpicture}
\end{document}