如何增加 x 和 y 轴的粗细?

如何增加 x 和 y 轴的粗细?

如何增加 x 轴和 y 轴的粗细?

\definecolor{bfffqq}{rgb}{0.7490196078431373,1.,0.}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.22123893805309733cm,y=0.23255813953488372cm]
\begin{axis}[
x=0.22123893805309733cm,y=0.23255813953488372cm,
axis lines=middle,
xmin=-14.566370614359172,
xmax=9.283185307179586,
ymin=-12.0,
ymax=9.5,
xtick={0},
ytick={0},]
\clip(-12.666370614359172,-12.) rectangle (6.483185307179586,9.5);
\draw[line width=0.pt,color=bfffqq,fill=bfffqq,fill opacity=1.0, smooth,samples=50,domain=-12.566370614359172:-9.42477796076938] plot(\x,{(\x)*sin(((\x))*180/pi)}) -- (-9.42477796076938,0.) -- (-12.566370614359172,0.) -- cycle;
\draw[line width=0.pt,color=bfffqq,fill=bfffqq,fill opacity=1.0, smooth,samples=50,domain=-9.42477796076938:-6.283185307179586] plot(\x,{(\x)*sin(((\x))*180/pi)}) -- (-6.283185307179586,0.) -- (-9.42477796076938,0.) -- cycle;
\draw[line width=0.pt,color=bfffqq,fill=bfffqq,fill opacity=1.0, smooth,samples=50,domain=-6.283185307179586:-3.141592653589793] plot(\x,{(\x)*sin(((\x))*180/pi)}) -- (-3.141592653589793,0.) -- (-6.283185307179586,0.) -- cycle;
\draw[line width=0.pt,color=bfffqq,fill=bfffqq,fill opacity=1.0, smooth,samples=50,domain=-3.141592653589793:0.0] plot(\x,{(\x)*sin(((\x))*180/pi)}) -- (0.,0.) -- (-3.141592653589793,0.) -- cycle;
\draw[line width=0.pt,color=bfffqq,fill=bfffqq,fill opacity=1.0, smooth,samples=50,domain=0.0:3.141592653589793] plot(\x,{(\x)*sin(((\x))*180/pi)}) -- (3.141592653589793,0.) -- (0.,0.) -- cycle;
\draw[line width=0.pt,color=bfffqq,fill=bfffqq,fill opacity=1.0, smooth,samples=50,domain=3.141592653589793:6.283185307179586] plot(\x,{(\x)*sin(((\x))*180/pi)}) -- (6.283185307179586,0.) -- (3.141592653589793,0.) -- cycle;
\draw[line width=1.2pt,smooth,samples=100,domain=-12.566370614359172:6.283185307179586] plot(\x,{(\x)*sin(((\x))*180/pi)});
\end{axis}
\end{tikzpicture}

答案1

我不知道 GeoGebra 为何生成该代码(从未使用过);它使用了奇怪的函数和非常奇怪的结构。一般来说,我认为使用pgfplots或类似的东西是为了拥有一个文档,其中的图表是结构化的,并且可以在文档本身中更改;导入带有奇怪数字的东西根本没有用 --- 在这种情况下,最好生成 PDF 并includegraphics使用它。

无论如何,你可以从这个开始:

\documentclass[10pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\begin{document}
\begin{tikzpicture}[]
        \begin{axis}[
            xmin=-4*pi, xmax=2*pi,
            domain=-4*pi:2*pi,
            samples=301,
            axis x line = center,
            axis y line = center,
            enlarge x limits,
            enlarge y limits,
            xlabel = {$x$},
            ylabel = {$y$},
            clip mode = individual,
            ]
            \addplot[thick, blue] {x*sin(deg(x))};
        \end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

添加axis line style = {ultra thick},即可获得:

在此处输入图片描述

填充并添加节点:

\documentclass[10pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usepgfplotslibrary{fillbetween}
\begin{document}
\begin{tikzpicture}[]
        \begin{axis}[
            xmin=-4*pi, xmax=2*pi,
            domain=-4*pi:2*pi,
            samples=301,
            axis x line = center,
            axis y line = center,
            enlarge x limits,
            enlarge y limits,
            xlabel = {$x$},
            ylabel = {$y$},
            axis line style = {ultra thick},
            clip mode = individual,
            ]
            \path[name path=axis] (axis cs:0,0) -- (axis cs:1,0);% invisible path
            \addplot[thick, blue, name path=f] {x*sin(deg(x))};
            \addplot[green] fill between[of=f and axis];
            \node at (-2.5*pi, 1) {$\mathbf{\pi}$};
        \end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容