ReliefPlot[array]
generates a relief plot of an array of height values.
ReliefPlot
ReliefPlot[array]
generates a relief plot of an array of height values.
Details and Options
- ReliefPlot[array] arranges successive rows of array up the page, and successive columns across.
- ReliefPlot has the same options as Graphics, with the following additions and changes: [List of all options]
-
AspectRatio Automatic ratio of height to width Axes False whether to draw axes BoxRatios Automatic effective 3D bounding box ratios ClippingStyle None how to draw clipped parts of the surface ColorFunction Automatic how to determine the color of surfaces ColorFunctionScaling True whether to scale arguments to ColorFunction DataRange Automatic the range of
and
values to assume for data DataReversed False whether to reverse the order of rows Frame True whether to draw a frame around the plot FrameTicks None what ticks to include on the frame LightingAngle Automatic effective angle of the simulated light source MaxPlotPoints Automatic the maximum number of points to include Mesh False whether to draw a mesh MeshStyle Automatic the style for mesh lines Method Automatic the method to use PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLegends None legends for surfaces PlotRange {Full,Full,All} the range of
values or other values to include PlotRangeClipping True whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotTheme $PlotTheme overall theme for the plot - In ReliefPlot[array], array must be a rectangular array, with each element a single real number representing a
value. - There will be holes in the surface corresponding to array elements that do not represent explicit height values.
- ReliefPlot[array] by default takes the
and
coordinate values for each data point to be successive integers starting at 1. Other coordinates can be specified using DataRange. - Possible settings for Method include "DiffuseReflection" and "AspectBasedShading".
- With some settings for PerformanceGoal, other specific option settings may be overridden.
-
AlignmentPoint Center the default point in the graphic to align with AspectRatio Automatic ratio of height to width Axes False whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic BoxRatios Automatic effective 3D bounding box ratios ClippingStyle None how to draw clipped parts of the surface ColorFunction Automatic how to determine the color of surfaces ColorFunctionScaling True whether to scale arguments to ColorFunction ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool DataRange Automatic the range of
and
values to assume for data DataReversed False whether to reverse the order of rows Epilog {} primitives rendered after the main plot FormatType TraditionalForm the default format type for text Frame True whether to draw a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks None what ticks to include on the frame FrameTicksStyle {} style specifications for frame ticks GridLines None grid lines to draw GridLinesStyle {} style specifications for grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic LabelStyle {} style specifications for labels LightingAngle Automatic effective angle of the simulated light source MaxPlotPoints Automatic the maximum number of points to include Mesh False whether to draw a mesh MeshStyle Automatic the style for mesh lines Method Automatic the method to use PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLabel None an overall label for the plot PlotLegends None legends for surfaces PlotRange {Full,Full,All} the range of
values or other values to include PlotRangeClipping True whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotTheme $PlotTheme overall theme for the plot PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RotateLabel True whether to rotate y labels on the frame Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks
List of all options
Examples
open all close allBasic Examples (3)
Use elevation data to display shaded terrain:
ReliefPlot[Import["http://exampledata.wolfram.com/hailey.dem.gz", "Data"], ColorFunction -> "GreenBrownTerrain"]Display density data with shading:
ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .03}, {j, -4, 4, .03}], ColorFunction -> "SunsetColors"]ReliefPlot[Import["http://exampledata.wolfram.com/hailey.dem.gz", "Data"], ColorFunction -> "LightTerrain", PlotLegends -> Automatic]Scope (14)
Data (6)
By default, the
and
data ranges are taken to be integer values:
ReliefPlot[Table[i + Sin[j ^ 2 + 3i], {i, -4, 4, .05}, {j, -4, 4, .05}], FrameTicks -> True]Provide explicit
and
data ranges by using DataRange:
ReliefPlot[Table[i + Sin[j ^ 2 + 3i], {i, -4, 4, .05}, {j, -4, 4, .05}], DataRange -> {{-4, 4}, {-4, 4}}, FrameTicks -> True]Reverse the
data range by using DataReversed:
ReliefPlot[Table[i + Sin[j ^ 2 + 3i], {i, -4, 4, .05}, {j, -4, 4, .05}], DataRange -> {{-4, 4}, {-4, 4}}, FrameTicks -> True, DataReversed -> True]Use MaxPlotPoints to limit the number of points used:
Table[ReliefPlot[Table[i + Sin[j ^ 2 + 3i], {i, -4, 4, .05}, {j, -4, 4, .05}], MaxPlotPoints -> mp, FrameTicks -> True], {mp, {Infinity, 25, 10}}]PlotRangeAutomatic can be used to drop the outlying area:
ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], PlotRange -> Automatic]{ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], PlotRange -> All],
ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], PlotRange -> {-1, 1}]}Presentation (8)
ReliefPlot[Table[i + Sin[j ^ 2 + 3i], {i, -4, 4, .05}, {j, -4, 4, .05}], FrameLabel -> {j, i}, PlotLabel -> i + Sin[j ^ 3 + 3i]]ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None]ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> (Hue[#, .7, .9]&)]ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "StarryNightColors"]Specify the direction where the simulated lighting is placed:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None, LightingAngle -> Pi / 4]Table[ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None, BoxRatios -> {1, 1, b}], {b, {Automatic, .1, 1}}]Use the "AspectBasedShading" method:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], Method -> "AspectBasedShading", ColorFunction -> None]ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "AvocadoColors", Mesh -> 8, FrameTicks -> True]ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "AvocadoColors", PlotLegends -> Automatic]Use a theme with bold colors and simple ticks:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], PlotTheme -> "Web"]Options (105)
AspectRatio (4)
By default, the ratio of the height to width for the plot is determined automatically:
ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}]]Make the height the same as the width with AspectRatio1:
ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], AspectRatio -> 1]Use numerical values to specify the height-to-width ratio:
ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], AspectRatio -> 1 / 2]AspectRatioFull adjusts the height and width to tightly fit inside other constructs:
plot = ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], AspectRatio -> Full];{Framed[Pane[plot, {50, 100}]], Framed[Pane[plot, {100, 100}]], Framed[Pane[plot, {100, 50}]]}Axes (3)
By default, ReliefPlot uses a frame instead of axes:
ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}]]ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> True]Turn each axis on individually:
{ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> {True, False}], ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> {False, True}]}AxesLabel (3)
No axes labels are drawn by default:
ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> True]ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> True, AxesLabel -> y]ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> True, AxesLabel -> {x, y}]AxesOrigin (2)
The position of the axes is determined automatically:
ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> True]Specify an explicit origin for the axes:
ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> True, AxesOrigin -> {170, 170}]AxesStyle (4)
Change the style for the axes:
ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> True, AxesStyle -> StandardGreen]Specify the style of each axis:
ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> True, AxesStyle -> {{Thick, Red}, {Thick, Blue}}]Use different styles for the ticks and the axes:
ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> True, AxesStyle -> Green, TicksStyle -> Blue]Use different styles for the labels and the axes:
ReliefPlot[Table[i + Sin[i^3 + j^3], {i, -5, 5, .03}, {j, -5, 5, .03}], Frame -> False, Axes -> True, AxesStyle -> Green, LabelStyle -> Blue]BoxRatios (3)
Automatically choose appropriate box ratios:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None, BoxRatios -> Automatic]Make overall shading closely match 3D plots with the box ratios {1,1,5}:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None, BoxRatios -> {1, 1, .5}]Increasing the
ratio produces more contrast in shading:
Table[ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .08}, {j, -4, 4, .08}], ColorFunction -> None, BoxRatios -> {1, 1, b}], {b, {.05, .2, 1}}]ClippingStyle (4)
Clipped regions are not shown by default:
ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .03}, {j, -3, 3, .03}], PlotRange -> Automatic]Color clipped regions like the rest of the plot:
ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .03}, {j, -3, 3, .03}], ClippingStyle -> Automatic, PlotRange -> Automatic]Use pink to fill the clipped regions:
ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .03}, {j, -3, 3, .03}], ClippingStyle -> Pink, PlotRange -> Automatic]Use gray where the surface is clipped at the top and purple where it is clipped at the bottom:
ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .03}, {j, -3, 3, .03}], ClippingStyle -> {Purple, Gray}, PlotRange -> Automatic]ColorFunction (6)
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None]ReliefPlot[Table[y + Sin[x ^ 2 + y ^ 2], {x, -4, 4, 0.05}, {y, -4, 4, 0.05}], ColorFunction -> Hue]Specify gray-level intensity by scaled
coordinate:
ReliefPlot[Table[x + Sin[3x + y ^ 2], {x, -4, 4, 0.05}, {y, -4, 4, 0.05}], ColorFunction -> GrayLevel]Named color gradients color in the
direction:
ReliefPlot[Table[x + Sin[3x + y ^ 2], {x, -4, 4, 0.05}, {y, -4, 4, 0.05}], ColorFunction -> "SunsetColors"]Use brightness to correspond to the height or density of a function:
ReliefPlot[Table[x + Sin[3x + y ^ 2], {x, -4, 4, 0.05}, {y, -4, 4, 0.05}], ColorFunction -> (Hue[2 / 5, 3 / 4, #]&)]Use the blend between two colors to indicate the height or density of a function:
ReliefPlot[Table[x + Sin[3x + y ^ 2], {x, -4, 4, 0.05}, {y, -4, 4, 0.05}], ColorFunction -> (Blend[{Magenta, Cyan}, #]&)]ColorFunctionScaling (1)
Scaled color functions may not be suitable for real-world elevation data:
data = Import["http://exampledata.wolfram.com/e100n40.tar.gz", {"GTOPO30", "Data"}];ReliefPlot[data, ColorFunction -> "GreenBrownTerrain", BoxRatios -> {1, 1, .05}]Instead, use a nonscaled color function for accurate representation of the elevation:
ReliefPlot[data, ColorFunction -> "HypsometricTints", ColorFunctionScaling -> False, BoxRatios -> {1, 1, .05}]DataRange (2)
Arrays are displayed against the number of elements in each direction:
ReliefPlot[Table[i + Sin[j ^ 2 + 3i], {i, -4, 4, .05}, {j, -4, 4, .05}], FrameTicks -> True]Rescale to the sampling space:
ReliefPlot[Table[i + Sin[j ^ 2 + 3i], {i, -4, 4, .05}, {j, -4, 4, .05}], DataRange -> {{-4, 4}, {-4, 4}}, FrameTicks -> True]DataReversed (1)
Frame (4)
ReliefPlot uses a frame by default:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}]]Use FrameFalse to turn off the frame:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False]Draw a frame on the left and right edges:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> {{True, True}, {False, False}}]Draw a frame on the left and bottom edges:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> {{True, False}, {True, False}}]FrameLabel (3)
Place a label along the bottom frame of a plot:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameLabel -> {"label"}]Frame labels are placed on the bottom and left frame edges by default:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameLabel -> {"Bottom", "Left"}]Place labels on each of the edges in the frame:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameLabel -> {{"left", "right"}, {"bottom", "top"}}]FrameStyle (2)
Specify the style of the frame:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.1}, {j, -2, 2, 0.1}], FrameTicks -> True, FrameStyle -> Directive[StandardGray, Thick]]Specify the style for each frame edge:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.1}, {j, -2, 2, 0.1}], FrameTicks -> True, FrameStyle -> {{Directive[Green, Thick], Directive[Red]}, {Directive[Gray, Thick], Directive[Blue]}}]FrameTicks (9)
Frame ticks are not placed automatically by default:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}]]ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> True]Use frame ticks on the bottom edge:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> {{None, None}, {Automatic, None}}]By default, the top and right edges have tick marks but no tick labels:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> Automatic]Use All to include tick labels on all edges:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> All]Place tick marks at specific positions:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> {{{0, 20, 32}, {0, 20, 32}}, {{0, 20, 40}, {0, 20, 40}}}]Draw frame tick marks at the specified positions with specific labels:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> {{{{0, a}, {20, b}, {32, c}}, Automatic}, {{{0, a}, {20, b}, {40, d}}, Automatic}}]Specify the lengths for tick marks as a fraction of the graphics size:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> {{{{40, a, .2}, {20, b, .2}, {32, c, .2}}, Automatic}, {{{10, a, .2}, {40, b, .5}, {70, d, .2}}, Automatic}}]Use different sizes in the positive and negative directions for each tick mark:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> {{{{40, a, {.2, .2}}, {32, b, {.2, .15}}, {20, c, {.2, .1}}}, Automatic}, {Automatic, Automatic}}]Specify a style for each frame tick:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> {{{{40, a, {.2, .15}, Directive[Thick, Blue]}, {32, b, {.2, .1}, Directive[Thick, Darker@Green, Dashed]}, {20, c, {.2, 0.05}, Directive[Thick, Red]}}, Automatic}, {Automatic, Automatic}}]Construct a function that places frame ticks at the midpoint and extremes of the frame edge:
minMeanMax[min_, max_] := {{min, min}, {(max + min) / 2, (max + min) / 2}, {max, max}}ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> {{minMeanMax, None}, {minMeanMax, None}}, PlotRangePadding -> None]FrameTicksStyle (3)
By default, the frame ticks and frame tick labels use the same styles as the frame:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> True, FrameStyle -> Directive[Red]]Specify an overall style for the ticks, including the labels:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> True, FrameTicksStyle -> Directive[Red, Thick]]Use different styles for the different frame edges:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], FrameTicks -> True, FrameTicksStyle -> {{Directive[Green, Thick], Blue}, {Red, Darker@Green}}]ImageSize (7)
Use named sizes, such as Tiny, Small, Medium and Large:
{ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ImageSize -> Tiny], ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ImageSize -> Small]}Specify the width of the plot:
{ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ImageSize -> 150], ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], AspectRatio -> 1.5, ImageSize -> 150]}Specify the height of the plot:
{ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ImageSize -> {Automatic, 150}], ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], AspectRatio -> 2, ImageSize -> {Automatic, 150}]}Allow the width and height to be up to a certain size:
{ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ImageSize -> UpTo[200]], ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], AspectRatio -> 2, ImageSize -> UpTo[200]]}Specify the width and height for a graphic, padding with space if necessary:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ImageSize -> {200, 250}, Background -> LightBlue]Setting AspectRatioFull will fill the available space:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], AspectRatio -> Full, ImageSize -> {200, 250}, Background -> LightBlue]Use maximum sizes for the width and height:
{ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ImageSize -> {UpTo[150], UpTo[100]}], ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], AspectRatio -> 2, ImageSize -> {UpTo[150], UpTo[100]}]}Use ImageSizeFull to fill the available space in an object:
Framed[Pane[ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ImageSize -> Full, Background -> LightBlue], {200, 200}]]Specify the image size as a fraction of the available space:
Framed[Pane[ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], AspectRatio -> Full, ImageSize -> {Scaled[0.5], Scaled[0.5]}, Background -> LightBlue], {200, 200}]]LightingAngle (4)
By default, the simulated lighting is placed at
, or the top-left corner, with altitude
:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None]Place the light source at 180°, or the left side of the map:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], LightingAngle -> 180°, ColorFunction -> None]Place the light source at 0°, or the right side of the map, with
altitude:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None, LightingAngle -> {0, Pi / 12}]ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], LightingAngle -> None]MaxPlotPoints (2)
ReliefPlot normally uses all the points in the dataset:
ReliefPlot[Table[i + Sin[j ^ 2 + 3i], {i, -4, 4, .05}, {j, -4, 4, .05}], FrameTicks -> True]Limit the number of points used in each direction:
ReliefPlot[Table[i + Sin[j ^ 2 + 3i], {i, -4, 4, .05}, {j, -4, 4, .05}], MaxPlotPoints -> 30, FrameTicks -> True]Mesh (5)
ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "AvocadoColors"]Show the final sampling meshes:
Table[ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "AvocadoColors", Mesh -> All, MaxPlotPoints -> m], {m, {Infinity, 25, 10}}]Provide 8 meshes in each direction:
ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "AvocadoColors", Mesh -> 8, FrameTicks -> True]Mesh lines at specific positions:
ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "AvocadoColors", Mesh -> {{50, 110}, {50, 110}}, FrameTicks -> True]Specify the style of each mesh line:
ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "AvocadoColors", Mesh -> {{{80, Thick}}, {{80, Red}}}, FrameTicks -> True]MeshStyle (3)
Mesh lines are partially transparent by default:
ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "AvocadoColors", Mesh -> 8]Use red dashed lines for meshes:
ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "AvocadoColors", Mesh -> {{50, 110}, {50, 110}}, MeshStyle -> Directive[Red, Dashed], FrameTicks -> True]Individually styled mesh lines can be used together with MeshStyle, and have higher priority:
ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "AvocadoColors", Mesh -> {{{80, Thick}}, {{80, Directive[Blue, Dashed]}}}, MeshStyle -> Orange, FrameTicks -> True]Method (2)
Normally, the "DiffuseReflection" method is used for shading:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], Method -> "DiffuseReflection", ColorFunction -> None]Use the "AspectBasedShading" method:
ReliefPlot[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], Method -> "AspectBasedShading", ColorFunction -> None]PerformanceGoal (2)
Generate a higher-quality plot:
Timing[ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], PerformanceGoal -> "Quality"]]Emphasize performance, possibly at the cost of quality:
Timing[ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], PerformanceGoal -> "Speed"]]PlotLegends (6)
Use an automatic legend to show the heights:
ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], PlotLegends -> Automatic]ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}]]PlotLegends automatically picks up ColorFunction and ColorFunctionScaling values:
ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "AvocadoColors", PlotLegends -> Automatic]Use BarLegend to change legend appearance:
ReliefPlot[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "SunsetColors", PlotLegends -> BarLegend[Automatic, LegendLabel -> "z-value"]]Add a legend to a plot using an unscaled color function:
data = Import["http://exampledata.wolfram.com/e100n40.tar.gz", {"GTOPO30", "Data"}];ReliefPlot[data, ColorFunction -> "HypsometricTints", ColorFunctionScaling -> False, BoxRatios -> {1, 1, .05}, PlotLegends -> BarLegend[Automatic, LegendLabel -> "height(m)"]]Use Placed to change legend placement:
ReliefPlot[Table[j + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "SunsetColors", PlotLegends -> Placed[Automatic, Below]]PlotRange (5)
Normally, ReliefPlot uses all points to compute the range:
ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], PlotRange -> All]Automatically compute the
range and clip extreme portions of it:
ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], PlotRange -> Automatic, FrameTicks -> True]Use an explicit
range and
range to focus on areas of interest:
ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], PlotRange -> {{100, 200}, {200, 300}}, FrameTicks -> True]PlotRange interacts with DataRange:
ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], DataRange -> {{-3, 3}, {-3, 3}}, PlotRange -> {{-1, 1}, {1, 3}}, FrameTicks -> True]Specify the
range to emphasize features:
ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], PlotRange -> {-.1, .5}, FrameTicks -> True]PlotRangeClipping (1)
Clip the plot at PlotRange:
Table[ReliefPlot[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], PlotRange -> {{100, 200}, {200, 300}}, PlotRangeClipping -> c, FrameTicks -> True], {c, {False, True}}]PlotTheme (1)
Use a theme with no frame or axes:
ReliefPlot[Table[x + Sin[3x + y ^ 2], {x, -4, 4, 0.05}, {y, -4, 4, 0.05}], PlotTheme -> "Minimal"]ReliefPlot[Table[x + Sin[3x + y ^ 2], {x, -4, 4, 0.05}, {y, -4, 4, 0.05}], PlotTheme -> "Minimal", ColorFunction -> "GreenPinkTones"]Ticks (9)
Ticks are placed automatically in each plot:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -Pi, Pi, 0.05}, {j, -Pi, Pi, 0.05}], Frame -> False, Axes -> True]Use TicksNone to draw axes without any tick marks:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -Pi, Pi, 0.05}, {j, -Pi, Pi, 0.05}], Frame -> False, Axes -> True, Ticks -> None]Use ticks on the
axis, but not the
axis:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -Pi, Pi, 0.05}, {j, -Pi, Pi, 0.05}], Frame -> False, Axes -> True, Ticks -> {Automatic, None}]Place tick marks at specific positions:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False, Axes -> True, Ticks -> {{10, 20, 40}, {10, 20, 35}}]Draw tick marks at the specified positions with the specified labels:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False, Axes -> True, Ticks -> {{{5, "a"}, {35, "b"}, {40, "c"} }, {{35, "b"}, {45, "d"}}}]Use specific ticks on one axis and automatic ticks on the other:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False, Axes -> True, Ticks -> {{{5, "a"}, {35, "b"}, {50, "c"} }, Automatic}]Specify the lengths for ticks as a fraction of the graphics size:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False, Axes -> True, Ticks -> {{{5, "a", .33}, {35, "b", .55}, {70, "c", .16} }, Automatic}]Use different sizes in the positive and negative directions for each tick:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False, Axes -> True, Ticks -> {{{5, "a", {.33, .15}}, {35, "b", {.55, .1}}, {70, "c", .16} }, Automatic}]Specify a style for each tick:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False, Axes -> True, Ticks -> {{{20, "a", .12, Directive[Thick, Green]}, {60, "c", .24, Directive[Thick, Yellow]} }, {{20, "a", .05, Directive[Thick, Dashed, Red]}, {40, "b", .16, Directive[Thick, Blue, Dashed]}}}]Construct a function that places ticks at the midpoint and extremes of the axis:
minMeanMax[min_, max_] := {{min, min}, {(max + min) / 2, (max + min) / 2}, {max, max}}ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False, Axes -> True, Ticks -> {minMeanMax, minMeanMax}, PlotRangePadding -> None]TicksStyle (4)
By default, the ticks and tick labels use the same styles as the axis:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False, Axes -> True, AxesStyle -> Red]Specify an overall tick style, including the tick labels:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False, Axes -> True, TicksStyle -> Red]Specify tick styles for each of the axes:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False, Axes -> True, TicksStyle -> {Directive[Green, Thick], Directive[Blue]}]Use a different style for the tick labels and tick marks:
ReliefPlot[Table[Sin[j ^ 2 + i], {i, -2, 2, 0.05}, {j, -2, 2, 0.05}], Frame -> False, Axes -> True, TicksStyle -> Directive[Red, Thick], LabelStyle -> Blue]Properties & Relations (3)
Some Import functions use ReliefPlot to display elevation maps with shaded relief:
Import[ "http://exampledata.wolfram.com/sdtsdem.tar.gz" ]Use GeoDensityPlot to color a map:
GeoDensityPlot[IconizedObject[«locs»] -> IconizedObject[«vals»]]Use ArrayPlot3D for 3D arrays of data:
ArrayPlot3D[RandomInteger[5, {3, 4, 5}]]Possible Issues (1)
Define two consecutive datasets:
data1 = Table[Sin[10i j]Exp[-j], {i, -1, 1, .01}, {j, 0, 1, .005}];
data2 = Table[Sin[10i j]Exp[-j], {i, -1, 1, .01}, {j, 1, 2, .005}];Due to
-value scaling, two results may not be consistent:
Row[{ReliefPlot[data1], ReliefPlot[data2]}]By specifying the same plot range, two results become consistent with each other:
Row[{ReliefPlot[data1, PlotRange -> {-1, 1}], ReliefPlot[data2, PlotRange -> {-1, 1}]}]Neat Examples (2)
A sum of quotients of norms seen in relief:
Table[ReliefPlot[Table[Evaluate[Sum[Product[Norm[{x, y} - RandomReal[{-3, 3}, {2}]], {i, j}] / Product[Norm[{x, y} - RandomReal[{-3, 3}, {2}]], {i, j}], {j, 1, 10}]], {x, -5, 5, .05}, {y, -5, 5, .05}], PlotRange -> Automatic, ColorFunction -> "Rainbow", ClippingStyle -> Darker[Red]], {3}]Sample a sum of 5 sine waves in random directions:
Table[ReliefPlot[Table[Evaluate[Sum[Sin[RandomReal[4, 2].{x, y}], {5}]], {x, 0, 10, .05}, {y, 0, 10, .05}], ColorFunction -> ColorData["DarkRainbow"]], {3}]Related Guides
History
Introduced in 2007 (6.0) | Updated in 2012 (9.0) ▪ 2014 (10.0)
Text
Wolfram Research (2007), ReliefPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/ReliefPlot.html (updated 2014).
CMS
Wolfram Language. 2007. "ReliefPlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/ReliefPlot.html.
APA
Wolfram Language. (2007). ReliefPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ReliefPlot.html
BibTeX
@misc{reference.wolfram_2026_reliefplot, author="Wolfram Research", title="{ReliefPlot}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/ReliefPlot.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_reliefplot, organization={Wolfram Research}, title={ReliefPlot}, year={2014}, url={https://reference.wolfram.com/language/ref/ReliefPlot.html}, note=[Accessed: 12-June-2026]}