ReImPlot
更多信息和选项
- ReImPlot 在不同的 x 值处计算 f,以创建形式为 {x,Re[f[x]]} 和 {x,Im[f[x]]} 的平滑曲线.
- 在 fi 计算结果为非数字值的任何 x 处留下间断.
- 区域 reg 可为任意一维 RegionQ 对象.
- ReImPlot 将变量 x 视为局部变量,实际上相当于使用 Block.
- ReImPlot 具有属性 HoldAll,只在为 x 分配特定数值后才开始计算 f.
- 某些情况下,在将特定数值赋给 x 之前,通过 Evaluate 以符号方式对 f 进行计算可能更有效.
- 封装同时被应用于 Re[f] 和 Im[f].
- 可对 fi 使用以下封装 w:
-
Annotation[fi,label] 为 fi 提供注释 Button[fi,action] 当点击 fi 曲线时,执行 action Callout[fi,label] 用 callout 标记函数 Callout[fi,label,pos] 把 callout 放在相对位置 pos EventHandler[fi,events] 为 fi 定义通用事件处理器 Highlighted[fi,effect] 用某种效果动态突出显示 fi Highlighted[fi,Placed[effect,pos]] 在位置 pos 处用某种效果静态突出显示 fi Hyperlink[fi,uri] 将函数变为超链接 Labeled[fi,label] 标记函数 Labeled[fi,label,pos] 把标签放在相对位置 pos Legended[fi,label] 在图例中标识函数 PopupWindow[fi,cont] 为函数添加弹出窗口 StatusArea[fi,label] 当鼠标移过时在状态栏中显示 Style[fi,styles] 用指定样式显示函数 Tooltip[fi,label] 为函数添加提示条 Tooltip[fi] 将函数用作提示条 - 可在多个层级上应用封装 w:
-
w[fi] 封装 fi w[{f1,…}] 封装一组 fi w1[w2[…]] 使用嵌套封装 - 在 Callout、Labeled 和 Placed 中可使用以下位置 pos:
-
Automatic 自动放置标签 Above, Below, Before, After 曲线周围的位置 x 在位置 x 处的曲线周围 Scaled[s] 沿曲线的缩放过的位置 s {s,Above},{s,Below},… 沿曲线在位置 s 处的相对位置 {pos,epos} 在曲线的相对位置 pos 处放置的标签中的 epos - ReImPlot 和 Plot 有相同的选项,不同之处和更多选项如下所示: [所有选项的列表]
-
ReImLabels Automatic 怎样标注实部和虚部分量 ReImStyle Automatic 怎样设计实部和虚部分量的样式 PlotStyle Automatic 怎样设置每个函数 fi 的样式 - ClippingStyle 的可能设置有:
-

Automatic 用虚线显示剪掉的部分 
None 略去曲线被剪掉的部分 
style 用 style 显示剪掉的部分 - 在采用缺省设置 Exclusions->Automatic 和 ExclusionsStyle->None 的情况下,ReImPlot 将在检测出的断点和奇点处断开曲线. 设置为 Exclusions->None 时则在断点和奇点处连接曲线.
- Exclusions->{x1,x2,…} 等价于 Exclusions->{x==x1,x==x2,…}.
- PlotLegends 的可能设置包括:
-
None 不包括图例 "Expressions" 为 fi 显示图例 "ReIm" 显示实部和虚部的图例 "ReImExpressions" 分别显示绘图、实部和虚部的图例 Automatic 所有的样式组合在一起显示图例 {lbl1,lbl2,…} 用 lbli 作为 fi 的图例 Placed[leg,pos] 指定 leg 的放置位置 pos {leg1,leg2,…} 包括多个图例 - PlotStyle 缺点每个函数的样式,ReImStyle 确定实部和虚部的样式.
- ReImStyle 可取的设置包括:
-
Automatic 默认样式 {re,im} 用 re 和 im 表示相应的分量 {{re1,im1},{re2,im2},…} 对不同的函数使用不同的样式 - ColorData["DefaultPlotColors"] 给出 PlotStyle 使用的默认颜色序列.
- Highlighted 和 PlotHighlighting 可用的突出显示效果包括:
-

style 突出显示指定的曲线 
"Ball" 突出显示并标注曲线上指定的点 
"Dropline" 突出显示并标注曲线上指定的点,同时绘制到坐标轴的准线 
"XSlice" 突出显示并标注垂直切片上的所有点 
"YSlice" 突出显示并标注水平切片上的所有点 
Placed[effect,pos] 静态突出显示给定位置 pos - 突出显示的位置指定 pos 包括:
-
x, {x} 在 {x,y} 处突出显示,自动选择 y {x,y} 在 {x,y} 处突出显示 {pos1,pos2,…} 多个位置 posi - 开始时,ReImPlot 会在 PlotPoints 指定的多个等间距的抽样点上计算 f. 然后使用自适应算法选择额外的抽样点,对给定区间进行最多 MaxRecursion 次分割.
- 因为只使用了有限数量的抽样点,ReImPlot 有可能会漏掉 f 的一些特征点. 增大 PlotPoints 和 MaxRecursion 的设置就可能捕捉到这些特征点.
- 影响曲线外观的主题包括:
-

"ThinLines" 细线 
"MediumLines" 中等粗细的线 
"ThickLines" 粗线 - 提供给 MeshFunctions 和 RegionFunction 中函数的参数为 x、y. 缺省情况下,为 ColorFunction 中的函数提供的是这些参数经过缩放的版本.
- ScalingFunctions->"scale" 缩放
坐标;ScalingFunctions{"scalex","scaley"} 同时缩放
和
坐标.
所有选项的列表
范例
打开所有单元 关闭所有单元基本范例 (3)
范围 (23)
采样 (9)
ReImPlot[Exp[30I Sin[x]], {x, 0, 10}]ReImPlot[Exp[(1 / 2 + I) t], {t, -2π, 3π}]用 PlotRange 显示感兴趣的区域:
ReImPlot[Exp[(1 / 2 + I) t], {t, -2π, 3π}, PlotRange -> {-70, 70}]ReImPlot[Floor[Sqrt[x]], {x, -100, 100}]用 ExclusionsNone 绘制连续的曲线:
ReImPlot[Floor[Sqrt[x]], {x, -100, 100}, Exclusions -> None]用 PlotPoints 和 MaxRecursion 控制自适应采样:
Grid@Table[ReImPlot[Exp[I x], {x, 0, 15}, PlotPoints -> pp, MaxRecursion -> mr], {mr, {0, 1, 2}}, {pp, {5, 10}}]𝒟 = ImplicitRegion[-4 ≤ x ≤ -1∨1 ≤ x ≤ 4, {x}];ReImPlot[Exp[I x], {x}∈𝒟]用 MeshRegion 指定定义域:
𝒟 = MeshRegion[{{-2}, {-1}, {-1 / 2}, {1 / 2}, {1}, {2}}, Line[{{1, 2}, {3, 4}, {5, 6}}]];ReImPlot[Sin[x^2] - I, {x}∈𝒟]ReImPlot[Exp[-(1 / 2 + I) t], {t, 0, Infinity}, PlotRange -> All]添加标签和图例 (8)
ReImPlot[{ArcCos[x], ArcSin[x]}, {x, -3, 3}, PlotLegends -> {"Expressions", "ReIm"}]ReImPlot[{ArcCos[x], ArcSin[x]}, {x, -3, 3}, PlotLegends -> "ReImExpressions"]ReImPlot[{ArcCos[x], ArcSin[x]}, {x, -3, 3}, PlotLegends -> Automatic]ReImPlot[{ArcCos[x], ArcSin[x]}, {x, -3, 3}, PlotLabels -> Automatic]ReImPlot[{Callout[ArcCos[x]], Tooltip[ArcSin[x], ArcSin[x]], Legended[ArcCos[x] + ArcSin[x], "sum"]}, {x, -3, 3}]ReImPlot[E^I / 2 x, {x, 0, 10}]{ReImPlot[{E^I / 2 x, E^I / 3 x}, {x, 0, 10}, PlotHighlighting -> "Dropline"], ReImPlot[{E^I / 2 x, E^I / 3 x}, {x, 0, 10}, PlotHighlighting -> "XSlice"]}用 Highlighted 强调绘图中某些特定的点:
ReImPlot[Highlighted[E^I / 2 x, Placed["Ball", 5]], {x, 0, 10}]ReImPlot[Highlighted[E^I / 2 x, Placed["Ball", {{3}, {5}}]], {x, 0, 10}]演示 (6)
ReImPlot[{Sqrt[1 - x^2], -Sqrt[x^2 - 1]}, {x, -3, 3}]ReImPlot[{Sqrt[1 - x^2], -Sqrt[x^2 - 1]}, {x, -3, 3}, PlotStyle -> {Red, Blue}]ReImPlot[Sqrt[1 - x^2], {x, -3, 3}, AxesLabel -> {x, I y}, PlotLabel -> Sqrt[1 - x^2], PlotLegends -> "ReIm"]{ReImPlot[{Sqrt[1 - x^2], -Sqrt[x^2 - 1]}, {x, -3, 3}, Filling -> Axis], ReImPlot[{Sqrt[1 - x^2], -Sqrt[x^2 - 1]}, {x, -3, 3}, Filling -> {{2 -> {3}}, {1 -> {4}}}]}ReImPlot[{Sqrt[1 - x^2], -Sqrt[x^2 - 1]}, {x, -3, 3}, PlotTheme -> "Marketing"]用 ScalingFunctions 缩放坐标轴:
ReImPlot[x + I Exp[x], {x, 0, 5}, ScalingFunctions -> "Log"]选项 (65)
ClippingStyle (2)
ColorFunction (4)
{ReImPlot[{Sqrt[1 - x^2], -Sqrt[1 - x^2]}, {x, -3, 3}, ColorFunction -> Function[{x, y}, Hue[y]]],
ReImPlot[{Sqrt[1 - x^2], -Sqrt[1 - x^2]}, {x, -3, 3}, ColorFunction -> Function[{x, y}, Hue[x]]]}ReImPlot[{Sqrt[1 - x^2], -Sqrt[1 - x^2]}, {x, -3, 3}, ColorFunction -> "DarkRainbow"]ColorFunction 比 PlotStyle 的优先级高:
ReImPlot[{Sqrt[1 - x^2], -Sqrt[1 - x^2]}, {x, -3, 3}, ColorFunction -> "DarkRainbow", PlotStyle -> Directive[Red, Thick]]ReImPlot[{Sqrt[1 - x^2], -Sqrt[1 - x^2]}, {x, -3, 3}, ColorFunction -> Function[{x, y}, If[Abs[y] ≤ 1, Red, Green]], ColorFunctionScaling -> False, PlotStyle -> Thick]ColorFunctionScaling (1)
Exclusions (2)
ExclusionStyle (1)
Filling (4)
Table[ReImPlot[Exp[I x], {x, 0, 2Pi}, Filling -> f], {f, {Axis, Top, Bottom, .3}}]ReImPlot[Exp[I x], {x, 0, 2Pi}, Filling -> {1 -> Axis}]ReImPlot[Exp[I x], {x, 0, 2Pi}, Filling -> {1 -> {2}}]ReImPlot[{Exp[I x], Exp[2I x]}, {x, 0, 2Pi}, Filling -> {{1 -> {3}}, {2 -> {4}}}]FillingStyle (3)
Table[ReImPlot[Exp[I x], {x, 0, 2Pi}, Filling -> Axis, FillingStyle -> c], {c, {Red, Green, Blue, Yellow}}]ReImPlot[Exp[I x], {x, 0, 2Pi}, Filling -> Axis, FillingStyle -> {Red, Blue}]用来自 ColorFunction 的可变填充样式:
ReImPlot[Exp[I x], {x, 0, 2Pi}, ColorFunction -> Function[{x, y}, Hue[x]], Filling -> {1 -> {2}}, FillingStyle -> Automatic]MaxRecursion (1)
每一级的 MaxRecursion 自适应地将初始网格细分为更精细的网格:
Table[ReImPlot[Sin[1 / x] + 10 x I, {x, 0.001, .1}, MaxRecursion -> i, Mesh -> All, Ticks -> None], {i, {0, 3, 6}}]Mesh (3)
{ReImPlot[Exp[I x], {x, 0, 2Pi}, Mesh -> Full, MeshStyle -> Red], ReImPlot[Exp[I x], {x, 0, 2Pi}, Mesh -> All, MeshStyle -> Red]}ReImPlot[Exp[I x], {x, 0, 2Pi}, Mesh -> 10, MeshStyle -> Red]ReImPlot[Exp[I x], {x, 0, 2Pi}, Mesh -> {Range[0, 2Pi, Pi / 4]}, MeshStyle -> Red]MeshFunctions (2)
Table[ReImPlot[Exp[I x], {x, 0, 2Pi}, MeshFunctions -> {f}, Mesh -> 15, MeshStyle -> Red], {f, {Function[{x, y, t, r}, x], Function[{x, y, t, r}, y]}}]在
方向(红色)上显示 7 个网格,在
方向(蓝色)显示 15 个网格:
ReImPlot[Exp[I x], {x, 0, 2Pi}, MeshFunctions -> {#1&, #2&}, Mesh -> {7, 15}, MeshStyle -> {Red, Blue}]MeshShading (3)
ReImPlot[Exp[I x], {x, 0, 2Pi}, Mesh -> 7, MeshShading -> {Red, Blue}]对于样式,MeshShading 比 PlotStyle 的优先级高:
ReImPlot[Exp[I x], {x, 0, 2Pi}, Mesh -> 7, MeshShading -> {Red, Blue}, PlotStyle -> Green]通过将 MeshShading 设为 Automatic,对某些线段应用 PlotStyle:
ReImPlot[Exp[I x], {x, 0, 2Pi}, Mesh -> 7, MeshShading -> {Red, Automatic}, PlotStyle -> Green]MeshStyle (2)
PerformanceGoal (2)
PlotHighlighting (8)
当设置为默认的 PlotHighlightingAutomatic 时,绘图有交互式坐标标注:
ReImPlot[E^I / 3 x, {x, 0, 10}]用 PlotHighlightingNone 禁止整个绘图的突出显示:
ReImPlot[E^I / 3 x, {x, 0, 10}, PlotHighlighting -> None]用 Highlighted[…,None] 禁止一条曲线的突出显示:
ReImPlot[{Highlighted[E^I / 2 x, None], E^I / 3 x}, {x, 0, 10}]ReImPlot[E^I / 3 x, {x, 0, 10}, PlotHighlighting -> "Ball"]ReImPlot[Highlighted[E^I / 3 x, Placed["Ball", 5]], {x, 0, 10}, PlotHighlighting -> "Ball"]ReImPlot[E^I / 3 x, {x, 0, 10}, PlotHighlighting -> "Dropline"]ReImPlot[Highlighted[E^I / 3 x, Placed["Dropline", 7]], {x, 0, 10}, PlotHighlighting -> "Dropline"]ReImPlot[E^I / 3 x, {x, 0, 10}, PlotHighlighting -> "XSlice"]ReImPlot[Highlighted[E^I / 3 x, Placed["XSlice", 7]], {x, 0, 10}]ReImPlot[E^I / 3 x, {x, 0, 10}, PlotHighlighting -> "YSlice"]ReImPlot[E^I / 3 x, {x, 0, 10}, PlotHighlighting -> "XNearestPoint"]ReImPlot[E^I / 3 x, {x, 0, 10}, PlotHighlighting -> {"XNearestPoint", <|"Style" -> Red|>}]ReImPlot[E^I / 3 x, {x, 0, 10}, PlotHighlighting -> "XYLabel"]用 Callout 的选项改变标签的外观:
ReImPlot[E^I / 3 x, {x, 0, 10}, PlotHighlighting -> {"XYLabel", <|"Appearance" -> "Corners", "CalloutMarker" -> "Circle"|>}]ReImPlot[E^I / 3 x, {x, 0, 10}, PlotHighlighting -> {{"XNearestPoint", <|"Style" -> Red|>}, {"XYLabel", <|"Appearance" -> "Corners", "CalloutMarker" -> "Circle"|>}}]PlotLabel (1)
PlotLabels (6)
ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLabels -> {"arcsine", "arccosine"}]ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLabels -> Placed[{"arcsine", "arccosine"}, Above]]ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLabels -> {Placed["arcsine", Below], Placed["arccosine", Above]}]PlotLabels"Expressions" 将函数用作标签:
ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLabels -> "Expressions"]ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLabels -> {Callout["arcsine", Above], Callout["arccosine", Below]}]用 None 不添加标签:
ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLabels -> {"arcsine", None}]PlotLegends (7)
ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLegends -> "Expressions"]ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLegends -> "ReIm"]用 "ReImExpressions" 显示两种样式的图例:
ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLegends -> "ReImExpressions"]ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLegends -> Automatic]ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLegends -> {"Expressions", "ReIm"}]ReImPlot[{ArcSin[x], ArcCos[x]}, {x, -3, 3}, PlotLegends -> {{"arcsine", "arccosine"}, "ReIm"}, ReImLabels -> {"real", "imaginary"}]ReImPlot[{ArcSin[x], ArcCos[x], ArcSin[x] + ArcCos[x]}, {x, -3, 3}, PlotLegends -> {{"arcsine", "arccosine"}, "ReIm", {None, None, "sum"}}]PlotPoints (1)
PlotRange (1)
PlotStyle (3)
ReImPlot[{ArcSinh[x], ArcCosh[x]}, {x, -3, 3}, PlotStyle -> {Red, Blue}]ReImPlot[{ArcSinh[x], ArcCosh[x]}, {x, -3, 3}, PlotStyle -> {Red, Directive[Blue, Dashed]}]与 ReImStyle 同时使用:
ReImPlot[{ArcSinh[x], ArcCosh[x]}, {x, -3, 3}, PlotStyle -> {Red, Blue}, ReImStyle -> {Dashing[{}], DotDashed}]PlotTheme (3)
ReImPlot[{ArcSinh[x], ArcCosh[x]}, {x, -3, 3}, PlotTheme -> "Business"]ReImPlot[{ArcSinh[x], ArcCosh[x]}, {x, -3, 3}, PlotTheme -> "Detailed"]ReImPlot[{ArcSinh[x], ArcCosh[x]}, {x, -3, 3}, PlotTheme -> "Detailed", PlotStyle -> {StandardCyan, StandardMagenta}]RegionFunction (1)
ReImLabels (2)
应用 (7)
ft = FourierTransform[Exp[-x]UnitStep[x], x, k];ReImPlot[ft, {k, -5, 5}]sol = NDSolveValue[{y''[x] - I Sin[y[x]] == 0, y[0] == 1, y'[0] == 2}, y[x], {x, 0, 10}];ReImPlot[sol, {x, 0, 10}, PlotRange -> All]ReImPlot[Eigenvalues[{{b - 1, 1}, {-b, -1}}], {b, -2, 6}]ReImPlot[Evaluate[x /. Solve[a + 2x^2 - x^3 == 0, x]], {a, -3, 3}, PlotLegends -> {"Expressions", "ReIm"}]ReImPlot[JacobiZeta[x, 10], {x, -2Pi, 2Pi}, Ticks -> {Range[-2Pi, 2Pi, Pi / 2], Automatic}, PlotLegends -> "AllExpressions"]Grid[Partition[Table[ReImPlot[{x^2, (Gamma[2 + 1]/Gamma[2 - b + 1])x^2 - b}, {x, -5, 5}, PlotRange -> {-10, 10}, PlotLabel -> Derivative[b][y][x]], {b, 1 / 3, 3, 1 / 3}], 3], Dividers -> All]绘制盒子中一个粒子的 Schrödinger 方程的复数解:
Manipulate[
ReImPlot[Sqrt[2] E^-(1/2) I n^2 π^2 t Sin[n π x], {x, 0, 1}, PlotRange -> {-2, 2}, AxesLabel -> {(x/L), Sqrt[L]ψ}],
{{t, 0, (ℏ π^2/2m L^2)t}, 0, (4/n^2π)}, {{n, 3}, 1, 10, 1}]属性和关系 (8)
{Plot[ReIm[ArcSin[x]], {x, -3, 3}],
ReImPlot[ArcSin[x], {x, -3, 3}]}用 AbsArgPlot 在实数上绘制幅值和辐角:
AbsArgPlot[Log[x], {x, -3, 3}]ComplexPlot 用颜色显示函数的幅值和辐角:
ComplexPlot[Log[z], {z, 3}]用 ComplexPlot3D 绘图,用 z 轴显示幅值:
ComplexPlot3D[Log[z], {z, 3}]通过 ComplexListPlot 在复平面上显示复数的位置:
ComplexListPlot[RandomComplex[{-3 - 3I, 3 + 3I}, 100]]ComplexContourPlot 在复数上绘制曲线:
ComplexContourPlot[Abs[Log[z]] == 1, {z, 3}]ComplexRegionPlot 在复数上绘制区域:
ComplexRegionPlot[Abs[Log[z]] < 1, {z, 3}]ComplexStreamPlot 和 ComplexVectorPlot 将复数视为方向:
ComplexStreamPlot[Log[z], {z, 3}]ComplexVectorPlot[Log[z], {z, 3}]可能存在的问题 (1)
ScalingFunctions 同时应用于实部和虚部:
ReImPlot[Exp[t] + I t, {t, -3π, 3π}, ScalingFunctions -> "Log"]文本
Wolfram Research (2019),ReImPlot,Wolfram 语言函数,https://reference.wolfram.com/language/ref/ReImPlot.html (更新于 2023 年).
CMS
Wolfram 语言. 2019. "ReImPlot." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2023. https://reference.wolfram.com/language/ref/ReImPlot.html.
APA
Wolfram 语言. (2019). ReImPlot. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/ReImPlot.html 年
BibTeX
@misc{reference.wolfram_2026_reimplot, author="Wolfram Research", title="{ReImPlot}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/ReImPlot.html}", note=[Accessed: 26-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_reimplot, organization={Wolfram Research}, title={ReImPlot}, year={2023}, url={https://reference.wolfram.com/language/ref/ReImPlot.html}, note=[Accessed: 26-November-2026]}