我有一张图表,其中的轴是错误的!y 轴是分开的。我认为“轴 x 线”和“轴 y 线”是错误的,但我无法修复它
\begin{tikzpicture}
\begin{semilogxaxis}[
axis x line=middle,axis y line=middle, xmin=460.46, xmax=4604600,ymin=0,ymax=1.15,xlabel style=
{above right},ylabel style={above right},ylabel = {$Ganancia [Veces]$}, xlabel={$Frecuencia
[Hz]$},ytick = {1,0.9,...,0.1}, xtick={460.46,4604.6,46046,460460,4604600},xticklabels=
{$460.46$,$4604.6$,$46046$,$460460$,$4604600
$},grid=both]%grid=both toda la cuad.
\addplot [blue,domain=1:4604600,samples=1000] {(1/(2*pi*x*0.000001))/((sqrt((3.456)^2+
(1/(2*pi*x*0.000001))^2))};
\end{semilogxaxis}
\end{tikzpicture}
谢谢!
答案1
像这样?
编辑: 现在好些了吗?
在纠正函数表达式中的错误(遗漏了一个)
)并删除轴标签样式(如所定义,x标签重叠图)后,生成上图的 MWE 代码为:
\documentclass[margin=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}
\begin{tikzpicture}
\begin{semilogxaxis}[
axis lines=left,
xmin=460.46, xmax=4604600,
ymin=0,ymax=1.15,
ylabel={\textit{Ganancia} [\textit{Veces}]},
xlabel={\textit{Frecuencia} [Hz]},
ylabel style={at={(-0.1,1)}, anchor=south east},
xlabel style={at={(1,-0.1)}, anchor=north east},
ytick = {1,0.9,...,0.1},
xtick={460.46,4604.6,46046,460460,4604600},
xticklabels={$460.46$,$4604.6$,$46046$,$460460$,$4604600$},
grid=both]%grid=both toda la cuad.
%
\addplot [blue,domain=1:4604600,samples=100]
{1/(2*pi*x*0.000001)/(sqrt((3.456)^2+(1/(2*pi*x*0.000001))^2))};
\end{semilogxaxis}
\end{tikzpicture}
\end{document}