Graphics[primitives,options]
表示一个二维图形.


Graphics
Graphics[primitives,options]
表示一个二维图形.
更多信息和选项








- Graphics 以 StandardForm 形式显示一个图形. 在 InputForm 中,它显示为一个具体的指令列表.
- 可以使用下列图形基元: »
-
AASTriangle[α,β,a] 角边角三角形 Arrow[{{x1,y1},…}] 箭头 ASATriangle[α,c,β] 角边角三角形 BezierCurve[{pt1,pt2,…}] Bézier 曲线 BSplineCurve[{pt1,pt2,…}] B 样条曲线 Circle[{x,y},r] 圆 Circumsphere[{pt1,…}] 由三个点指定的外接圆 ConicHullRegion[…] 线性椎体 Disk[{x,y},r] 填充圆盘 FilledCurve[{seg1,seg2,…}] 填充曲线 GraphicsComplex[pts,prims] 图形对象的复合体 GraphicsGroup[{g1,g2,…}] 可作为群组选择的对象 HalfLine[{pt1,pt2}] 半无限长的直线,或称射线 HalfPlane[{pt1,pt2},v] 半无限平面 Image[…] 图像对象 InfiniteLine[{pt1,pt2}] 无限长直线 Inset[obj,…] 插入对象 JoinedCurve[{seg1,seg2,…}] 连接的曲线段 Line[{pt1,…}] 线段 Locator[{x,y}] 动态定位器 Parallelogram[pt,{v1,v2}] 平行四边形 Point[{x,y}] 点 Polygon[{pt1,…}] 多边形 Raster[array] 灰色或颜色方块的数组 Rectangle[{xmin,ymin},{xmax,ymax}] 矩形 SASTriangle[a,γ,b] 边角边三角形 Simplex[{pt1,…}] 单纯形 SSSTriangle[a,b,c] 边边边三角形 Text[expr,{x,y}] 文本 Triangle[{pt1,…}] 三角形 - 可以使用下列图形指令: »
-
AbsoluteDashing[{w1,…}] 指定绝对虚线 AbsolutePointSize[d] 指定绝对点的尺寸 AbsoluteThickness[w] 指定绝对线宽 Arrowheads[specs] 指定箭头 CapForm[type] 线帽指定 CMYKColor[c,m,y,k] 指定颜色 Dashing[{w1,…}] 指定虚线 Directive[g1,g2,…] 复合图形指令 EdgeForm[g] 指定绘制边 FaceForm[g] 指定绘制面 GrayLevel[i] 灰度指定 Hue[h] 色调指定 JoinForm[type] 线连接指定 Opacity[a] 透明度指定 PointSize[d] 点尺寸指定 RGBColor[r,g,b] 颜色指定 Texture[obj] 纹理指定 Thickness[w] 线宽指定 - 可以在任意层使用下面的封装:
-
Annotation[obj,label] 给出一个注解 Button[obj,action] 将 obj 作为一个按钮 Dynamic[obj] 动态更新当前值 EventHandler[obj,…] 一个事件处理器 Hyperlink[obj,URI] 将 obj 制作一个超链接 Mouseover[obj,over] 指定一个鼠标移动形式 PopupWindow[obj,cont] 弹出窗口 StatusArea[obj,label] 在状态栏区域指定一个标签 Style[obj,opts] 指定一个样式 Tooltip[obj,label] 添加一个工具提示 - 可以给出下列选项:
-
AlignmentPoint Center 在图形内对齐的缺省点 AspectRatio Automatic 高与宽的比 Axes False 是否绘制轴 AxesLabel None 坐标轴标签 AxesOrigin Automatic 坐标轴原点 AxesStyle {} 坐标轴样式指定 Background None 绘图的背景色 BaselinePosition Automatic 如何与环绕文本基线对齐 BaseStyle {} 图形的基本样式指定 ContentSelectable Automatic 是否允许进行内容选择 CoordinatesToolOptions Automatic 坐标工具的详细行为 Epilog {} 主图形之后执行的图形指令 FormatType TraditionalForm 文本的缺省样式类型 Frame False 是否在图形周围放置边框 FrameLabel None 边框标签 FrameStyle {} 边框的样式指定 FrameTicks Automatic 边框刻度 FrameTicksStyle {} 边框刻度的样式指定 GridLines None 绘制的网格线 GridLinesStyle {} 网格线的样式指定 ImageMargins 0. 图形周围的边幅 ImagePadding All 为标签等额外填充内容 ImageSize Automatic 图形的绝对尺寸 LabelStyle {} 标签的样式指定 Method Automatic 使用图形方式的细节 PlotLabel None 图形的一个整体标签 PlotRange All 图形值的范围 PlotRangeClipping False 是否在图形范围剪切 PlotRangePadding Automatic 填充图形值范围的程度 PlotRegion Automatic 填充的最后显示区域 PreserveImageOptions Automatic 当显示相同图形的新版本时,是否保存图形选项 Prolog {} 主图形之前执行的图形指令 RotateLabel True 是否在边框上旋转 y 标签 Ticks Automatic 坐标轴标记 TicksStyle {} 坐标轴标记的样式指定 - 可以给出图形的嵌套列表. 诸如 GrayLevel 的指定实际上只保持到直至包含它们的列表末尾.. »
- Style[obj,opts] 可用于将选项或指令 opts 应用到 obj. »
- 可以给出下列 Method 选项:
-
"AxesInFront" True 是否在图元上方绘制坐标轴 "FrameInFront" True 是否在图元上方绘制图形边框 "GridLinesInFront" False 是否在图元上方绘制网格线 "TransparentPolygonMesh" False 是否对毗邻多边形仔细绘制,以避免对边的双重渲染 - BaseStyle 的设置可以作为当前样式表中 "Graphics" 给出的默认样式的补充. AxesStyle、 LabelStyle 等设置可以作为 "GraphicsAxes"、"GraphicsLabel" 等给出的默认样式的补充.
- Graphics[] 以默认图形尺寸给出一个空图.
范例
打开所有单元 关闭所有单元基本范例 (2)
范围 (13)
元素 (4)
指令 (5)
指令可以应用到 Style 生成的单个对象:
选项 (71)
AlignmentPoint (1)
在 Inset 内指定坐标与封闭图形的中心对齐:
AspectRatio (1)
对 AspectRatio 用数值值:
BaselinePosition (3)
FormatType (3)
ImageMargins (3)
Method (4)
PlotLabel (2)
PlotRangePadding (3)
PlotRegion (3)
属性和关系 (5)
参见
Plot ListPlot ListLinePlot ParametricPlot DensityPlot ArrayPlot RegionPlot ContourPlot Show Canvas Graphics3D Image GeometricScene Sound
前端令牌: Import
Function Repository: InteractiveGraphics
技术笔记
-
▪
- 图形结构
相关指南
-
▪
- 符号图形语言 ▪
- 平面几何 ▪
- 多边形 ▪
- WDF(Wolfram 数据框架)
历史
1988年引入 (1.0) | 在以下年份被更新:1996 (3.0) ▪ 2007 (6.0) ▪ 2008 (7.0) ▪ 2010 (8.0) ▪ 2014 (10.0) ▪ 2022 (13.1)
文本
Wolfram Research (1988),Graphics,Wolfram 语言函数,https://reference.wolfram.com/language/ref/Graphics.html (更新于 2022 年).
CMS
Wolfram 语言. 1988. "Graphics." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2022. https://reference.wolfram.com/language/ref/Graphics.html.
APA
Wolfram 语言. (1988). Graphics. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/Graphics.html 年
BibTeX
@misc{reference.wolfram_2025_graphics, author="Wolfram Research", title="{Graphics}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/Graphics.html}", note=[Accessed: 17-September-2025]}
BibLaTeX
@online{reference.wolfram_2025_graphics, organization={Wolfram Research}, title={Graphics}, year={2022}, url={https://reference.wolfram.com/language/ref/Graphics.html}, note=[Accessed: 17-September-2025]}