所以我得到了这此处的图表旨在说明在 desmos 中制作的可测函数的分层表示。我想将其带入 Ti钾Z,但我似乎不知道该怎么做。绘制函数很容易,我甚至已经通过以下代码描述了它的黎曼积分:
\documentclass{standalone}
\usepackage{amsfonts,amssymb,amsthm}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{colormaps}
\pgfplotsset{compat = newest}
\usepackage{tkz-euclide}
\usepackage{xcolor}
\begin{document}
\begin{tikzpicture}
\begin{axis}[ylabel=$\R$, xlabel= $X$, xlabel near ticks,xmin=-10,xmax=10,ymax=3,ymin=0, xticklabels=\empty,extra y ticks={2.75,2.5,2,2.25,1.75,1.5,1.25,0.75,0.5,0.25}]
\addplot[domain=-10:10,samples=500, name path=f, thick, color=blue] {exp(-x^2/10)*abs(sin(deg(x^2))+x+1)};
\draw[black] (5.21,1.5) node {$f$};
\addplot[domain=-10:10,samples=500, color=magenta,fill=magenta,fill opacity=.5]{ifthenelse(and(exp(-x^2/10)*abs(sin(deg(x^2))+x+1)<1.5,1.25<exp(-x^2/10)*abs(sin(deg(x^2))+x+1)),1.25,0)};
\addplot[domain=-10:10,samples=500, color=magenta,fill=magenta,fill opacity=.5]{ifthenelse(and(exp(-x^2/10)*abs(sin(deg(x^2))+x+1)<1.25,1<exp(-x^2/10)*abs(sin(deg(x^2))+x+1)),1,0)};
\addplot[domain=-10:10,samples=500, color=magenta,fill=magenta, fill opacity=.5]{ifthenelse(and(exp(-x^2/10)*abs(sin(deg(x^2))+x+1)<1.75,1.5<exp(-x^2/10)*abs(sin(deg(x^2))+x+1)),1.5,0)};
\addplot[domain=-10:10,samples=500, color=magenta,fill=magenta,fill opacity=.5]{ifthenelse(and(exp(-x^2/10)*abs(sin(deg(x^2))+x+1)<2,1.75<exp(-x^2/10)*abs(sin(deg(x^2))+x+1)),1.75,0)};
\addplot[domain=-10:10,samples=500, color=magenta,fill=magenta,fill opacity=.5]{ifthenelse(and(exp(-x^2/10)*abs(sin(deg(x^2))+x+1)<2.25,2<exp(-x^2/10)*abs(sin(deg(x^2))+x+1)),2,0)};
\addplot[domain=-10:10,samples=500, color=magenta,fill=magenta,fill opacity=.5]{ifthenelse(and(exp(-x^2/10)*abs(sin(deg(x^2))+x+1)<2.5,2.25<exp(-x^2/10)*abs(sin(deg(x^2))+x+1)),2.25,0)};
\addplot[domain=-10:10,samples=500, color=magenta,fill=magenta,fill opacity=.5]{ifthenelse(and(exp(-x^2/10)*abs(sin(deg(x^2))+x+1)<.75,.5<exp(-x^2/10)*abs(sin(deg(x^2))+x+1)),.5,0)};
\addplot[domain=-10:10,samples=500, color=magenta,fill=magenta,fill opacity=.5]{ifthenelse(and(exp(-x^2/10)*abs(sin(deg(x^2))+x+1)<.5,.25<exp(-x^2/10)*abs(sin(deg(x^2))+x+1)),.25,0)};
\addplot[domain=-10:10,samples=500, color=magenta,fill=magenta,fill opacity=.5]{ifthenelse(and(exp(-x^2/10)*abs(sin(deg(x^2))+x+1)<1,.75<exp(-x^2/10)*abs(sin(deg(x^2))+x+1)),.75,0)};
\addplot[domain=-10:10,samples=500, color=magenta,fill=magenta,fill opacity=.5]{ifthenelse(and(exp(-x^2/10)*abs(sin(deg(x^2))+x+1)<3,2.75<exp(-x^2/10)*abs(sin(deg(x^2))+x+1)),2.75,0)};
\addplot[domain=-10:10,samples=500, color=magenta,fill=magenta,fill opacity=.5]{ifthenelse(and(exp(-x^2/10)*abs(sin(deg(x^2))+x+1)<2.75,2.5<exp(-x^2/10)*abs(sin(deg(x^2))+x+1)),2.5,0)};
%%%%%%%%%%%%%%%%%%%LINHAS TRAÇEJADAS EM ORDEM CRESCENTE%%%%%%%%%%%%%%%%%%%%%%%
\addplot[domain=-10:10,samples=500, dashed,opacity=.75] {.25};
\addplot[domain=-10:10,samples=500, dashed,opacity=.75] {.5};
\addplot[domain=-10:10,samples=500, dashed,opacity=.75] {.75};
\addplot[domain=-10:10,samples=500, dashed,opacity=.75] {1};
\addplot[domain=-10:10,samples=500, dashed,opacity=.75] {1.25};
\addplot[domain=-10:10,samples=500, dashed,opacity=.75] {1.5};
\addplot[domain=-10:10,samples=500, dashed,opacity=.75] {1.75};
\addplot[domain=-10:10,samples=500, dashed,opacity=.75] {2};
\addplot[domain=-10:10,samples=500, dashed,opacity=.75] {2.25};
\addplot[domain=-10:10,samples=500, dashed,opacity=.75] {2.5};
\addplot[domain=-10:10,samples=500, dashed,opacity=.75] {2.75};
\end{axis}
\end{tikzpicture}
\end{document}
得出以下结论:
代码或图表没有任何问题,我只是想描绘出 desmos 图表所示的水平层,这在我的 Ti 中仅由虚线表示钾Z 图。