Movatterモバイル変換


[0]ホーム

URL:


WOLFRAM

Wolfram Language & System Documentation Center
DensityPlot

DensityPlot[f,{x,xmin,xmax},{y,ymin,ymax}]

makes a density plot off as a function ofx andy.

DensityPlot[f,{x,y}reg]

takes the variables{x,y} to be in the geometric regionreg.

Details and Options
Details and OptionsDetails and Options
Examples  
Basic Examples  
Scope  
Sampling  
Presentation  
Options  
AspectRatio  
Axes  
AxesLabel  
Show MoreShow More
AxesOrigin  
AxesStyle  
BoundaryStyle  
ClippingStyle  
ColorFunction  
ColorFunctionScaling  
EvaluationMonitor  
Exclusions  
ExclusionsStyle  
ImageSize  
MaxRecursion  
Mesh  
MeshFunctions  
MeshStyle  
PerformanceGoal  
PlotLayout  
PlotLegends  
PlotPoints  
PlotRange  
PlotTheme  
RegionFunction  
ScalingFunctions  
WorkingPrecision  
Applications  
Properties & Relations  
Possible Issues  
Neat Examples  
See Also
Tech Notes
Related Guides
History
Cite this Page

DensityPlot

DensityPlot[f,{x,xmin,xmax},{y,ymin,ymax}]

makes a density plot off as a function ofx andy.

DensityPlot[f,{x,y}reg]

takes the variables{x,y} to be in the geometric regionreg.

Details and Options

Examples

open allclose all

Basic Examples  (4)

Plot a function:

Use a different color scheme and legend:

Create a contouring overlay mesh:

Use a multi-panel layout to show multiple functions at the same time:

Scope  (19)

Sampling  (11)

More points are sampled where the function changes quickly:

The plot range is selected automatically:

Areas where the function becomes nonreal are excluded:

The region is split when there are discontinuities in the function:

UsePlotPoints andMaxRecursion to control adaptive sampling:

UsePlotRange to focus in on areas of interest:

UseExclusions to remove curves or split the resulting surface:

UseRegionFunction to restrict the surface to a region given by inequalities:

The domain may be specified by a region:

The domain may be specified by aMeshRegion:

Plot over an infinite domain:

Presentation  (8)

Add labels:

Color the surface by height:

Add a legend:

Provide an interactiveTooltip for a surface:

Style the overlay mesh:

Create a contouring overlay mesh:

Use a theme with simple ticks in a high-contrast color scheme:

Show multiple functions as densities in separate panels:

Use a column instead of a row:

Options  (89)

AspectRatio  (4)

By default,DensityPlot uses the same width and height:

Use a numerical value to specify the height to width ratio:

AspectRatioAutomatic determines the ratio from the plot ranges:

AspectRatioFull adjusts the height and width to tightly fit inside other constructs:

Axes  (4)

By default,DensityPlot uses a frame instead of axes:

Use axes instead of a frame:

UseAxesOrigin to specify where the axes intersect:

Turn each axis on individually:

AxesLabel  (4)

No axes labels are drawn by default:

Place a label on the axis:

Specify axes labels:

Use labels based on variables specified inDensityPlot:

AxesOrigin  (2)

The position of the axes is determined automatically:

Specify an explicit origin for the axes:

AxesStyle  (4)

Change the style for the axes:

Specify the style of each axis:

Use different styles for the ticks and the axes:

Use different styles for the labels and the axes:

BoundaryStyle  (3)

Use a red boundary around the edges of the surface:

BoundaryStyle applies to regions cut byRegionFunction:

BoundaryStyle does not apply to cuts made byExclusions:

UseExclusionsStyle instead:

ClippingStyle  (4)

Show clipped regions like the rest of the surface:

Leave clipped regions empty:

Use pink to fill the clipped regions:

Use light red where the surface is clipped above and pink below:

ColorFunction  (5)

Color by scaled coordinate:

Specify gray-level intensity by scaled coordinate:

Named color gradients color in the direction:

Use brightness to correspond to height or density of a function:

Use the interpolation between two colors to indicate the height or density of a function:

ColorFunctionScaling  (1)

Get the natural range of values by settingColorFunctionScaling toFalse:

EvaluationMonitor  (2)

Show whereDensityPlot samples a function:

Count how many times is evaluated:

Exclusions  (6)

This uses automatic methods to compute exclusions:

Indicate that no exclusions should be computed:

Give exclusions as an equation:

Give multiple exclusion sets:

Use a condition with the exclusion equation:

Use both automatically computed and explicit exclusions:

ExclusionsStyle  (1)

Use a red boundary to indicate the excluded curves:

ImageSize  (7)

Use named sizes such asTiny,Small,Medium andLarge:

Specify the width of the plot:

Specify the height of the plot:

Allow the width and height to be up to a certain size:

Specify the width and height for a graphic, padding with space if necessary:

SettingAspectRatioFull will fill the available space:

Use maximum sizes for the width and height:

UseImageSizeFull to fill the available space in an object:

Specify the image size as a fraction of the available space:

MaxRecursion  (1)

Refine the function where it changes quickly:

Mesh  (6)

Use no mesh:

Show the initial and final sampling mesh:

Use 5 mesh lines in each direction:

Use 3 mesh lines in the direction and 6 mesh lines in the direction:

Use mesh lines at specific values:

Use different styles for different mesh lines:

MeshFunctions  (3)

Use the value as the mesh function:

Use mesh lines in the and directions:

Use mesh lines corresponding to fixed distances from the origin:

MeshStyle  (2)

Use red mesh lines:

Use red mesh lines in the direction and dashed mesh lines in the direction:

PerformanceGoal  (2)

Generate a higher-quality plot:

Emphasize performance, possibly at the cost of quality:

PlotLayout  (3)

Place each density in a separate panel using shared axes:

Use a row instead of a column:

Use multiple columns or rows:

Prefer full columns or rows:

PlotLegends  (4)

Show a legend for the heights:

PlotLegends automatically matches the color function:

UsePlaced to change legend position:

UseBarLegend to change legend appearance:

PlotPoints  (2)

Use more initial points to get a smoother density:

Use 20 initial points in the direction and 5 in the direction:

PlotRange  (4)

Automatically compute the range:

Use all points to compute the range:

Show the surface over the full, range:

Automatically compute the, range:

Use an explicit range to emphasize features:

PlotTheme  (1)

Use a theme with detailed ticks and a legend:

Change the color function:

RegionFunction  (3)

Plot over an annulus region in and:

Regions do not have to be connected:

Use any logical combination of conditions:

ScalingFunctions  (9)

By default, plots have linear scales in each direction:

Use a log scale in the direction:

Use a linear scale in the direction that shows smaller numbers at the top:

Use a reciprocal scale in the direction:

Use different scales in the and directions:

Reverse the axis without changing the axis:

Use a scale defined by a function and its inverse:

Positions inTicks andGridLines are automatically scaled:

PlotRange is automatically scaled:

WorkingPrecision  (2)

Evaluate functions using machine-precision arithmetic:

Evaluate functions using arbitrary-precision arithmetic:

Applications  (7)

Plot a sum of 5 sine waves in random directions:

This shows the solution to the heat equation in one dimension:

Plot a saddle surface; the mesh curves show where the function is zero:

The 1, 2, 3, and norms, with the iso-norm mesh lines at 1/2, 1, and 3/2:

Show argument variation for sin, cos, tan, and cot over the complex plane:

Show the different complex components for a function:

Transform a function to expose more features:

Properties & Relations  (9)

DensityPlot samples more points where it needs to:

UseContourPlot to get segmented iso curves and contour regions:

UseListDensityPlot for plotting continuous data:

UsePlot3D to get 3D surfaces:

Add aColorFunction to get an overlay density:

ComplexPlot plots the phase of a function using color and shades by the magnitude:

UseArrayPlot orMatrixPlot for discrete data:

UsePlot for univariate functions:

UseParametricPlot for plane parametric curves and regions:

UseContourPlot3D andRegionPlot3D for implicit surfaces and regions:

Possible Issues  (2)

With segmenting or piecewise color functions, the transition color borders may not be sharp:

UseContourPlot for segmenting problems instead:

Color functions or densities that change quickly may show artifacts:

UsePlotPoints to increase the sampling density:

Neat Examples  (2)

Branch cuts for inverse trigonometric functions:

Real and imaginary part overlay mesh:

See Also

ListDensityPlot DensityPlot3D SliceDensityPlot3D ContourPlot ArrayPlot Plot3D StreamPlot VectorPlot StreamDensityPlot VectorDensityPlot ColorFunction RegionPlot ComplexPlot

Tech Notes

Related Guides

History

Introduced in 1988(1.0) |Updated in 2007(6.0)2008(7.0)2012(9.0)2014(10.0)2017(11.1)2021(13.0)

Wolfram Research (1988), DensityPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/DensityPlot.html (updated 2021).

Text

Wolfram Research (1988), DensityPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/DensityPlot.html (updated 2021).

CMS

Wolfram Language. 1988. "DensityPlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/DensityPlot.html.

APA

Wolfram Language. (1988). DensityPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DensityPlot.html

BibTeX

@misc{reference.wolfram_2025_densityplot, author="Wolfram Research", title="{DensityPlot}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/DensityPlot.html}", note=[Accessed: 29-November-2025]}

BibLaTeX

@online{reference.wolfram_2025_densityplot, organization={Wolfram Research}, title={DensityPlot}, year={2021}, url={https://reference.wolfram.com/language/ref/DensityPlot.html}, note=[Accessed: 29-November-2025]}

Top

[8]ページ先頭

©2009-2025 Movatter.jp