DensityPlot - Density plot appearance and behavior (2024)

Table of Contents
Density Radius — Radius of influence, in meters numeric scalar RadiusMode — Control how Radius is set 'auto' (default) | 'manual' WeightData — Weights assigned to data [] (default) | numeric scalar | numeric vector WeightDataSource — Variable linked to WeightData '' (default) | character vector | string scalar Color and Transparency FaceAlpha — Face transparency 'interp' (default) | scalar in range [0, 1] FaceColor — Face color [0 0 0] (default) | 'interp' | RGB triplet | hexadecimal color code | color name | short name FaceColorMode — Control how FaceColor is set "auto" (default) | "manual" SeriesIndex — Series index positive whole number | "none" Geographic Coordinate Data LatitudeData — Latitude coordinates in degrees numeric vector with elements in range [–90, 90] | [] LatitudeDataSource — Variable linked to LatitudeData '' (default) | character vector | string scalar LongitudeData — Longitude coordinates in degrees numeric vector | [] LongitudeDataSource — Variable linked to LongitudeData '' (default) | character vector | string scalar Legend Interactivity Callbacks Callback Execution Control Parent/Child Parent — Parent GeographicAxes object Identifiers Type — Type of graphics object 'densityplot' (default) Version History R2023b: Opt out of automatic color selection with SeriesIndex="none" R2020a: Control automatic color selection with the SeriesIndex property R2020a: UIContextMenu property is not recommended See Also Functions Topics MATLAB Command Americas Europe Asia Pacific

Density plot appearance and behavior

expand all in page

DensityPlot properties control the appearance and behavior of a DensityPlot object. By changing property values, you can modify certain aspects of the density plot. Use dot notation to query and set properties.

dp = geodensityplot(1:10,1:10);f = dp.FaceColor;dp.FaceColor = "red";

Create a density plot in geographic coordinates by using the geodensityplot function.

Density

expand all

Radius of influence on the density calculation, in meters, specified as a numeric scalar.

Control how the Radius property is set, specified as one of these values:

  • 'auto' — MATLAB® controls the value of the Radius property.

  • 'manual' — You manually control the value of the Radius property. When you set the Radius property, MATLAB sets this property to 'manual'.

Weights assigned to data, specified as an empty array, a numeric scalar, or a numeric vector. If you specify a numeric vector, the length of the vector must match the lengths of LatitudeData and LongitudeData.

The WeightData property typically contains additional data that is related to the location data in LatitudeData and LongitudeData.

Variable linked to WeightData, specified as a character vector or string scalar containing a MATLAB workspace variable name. MATLAB evaluates the variable in the base workspace to generate the WeightData.

By default, there is no linked variable, so the value is an empty character vector, ''. If you link a variable, then MATLAB does not update the WeightData values immediately. To force an update of the data values, use the refreshdata function.

Note

If you change one data source property to a variable that contains data of a different dimension, you might cause the function to generate a warning. The geodensityplot does not render the graph until you have changed all data source properties to appropriate values.

Color and Transparency

expand all

Face transparency, specified as one of these values:

  • 'interp' — Use interpolated transparency based on the density values.

  • Scalar in the range [0, 1] — Use uniform transparency across all the faces. A value of 1 is opaque and a value of 0 is completely transparent. Values between 0 and 1 are semitransparent.

The appearance of the density plot depends on both the FaceAlpha and FaceColor properties. This table shows how different combinations of FaceAlpha and FaceColor affect the appearance of the plot.

Values of FaceColor and FaceAlphaEffectSample Density Plot
  • FaceAlpha is "interp"

  • FaceColor is an RGB triplet, a hexadecimal color code, a color name, or a short name

The density plot uses one color and conveys density by varying the transparency.

DensityPlot - Density plot appearance and behavior (1)

  • FaceAlpha is "interp"

  • FaceColor is "interp"

The density plot conveys density by varying the transparency and the color.

DensityPlot - Density plot appearance and behavior (2)

  • FaceAlpha is a scalar value

  • FaceColor is "interp"

The density plot uses one transparency value and conveys density by varying the color.

DensityPlot - Density plot appearance and behavior (3)

For more information about controlling the transparency of a density plot, see Adjust Transparency of Geographic Density Plots.

Face color, specified as one of these options:

  • 'interp' — Use interpolated coloring based on the density values. MATLAB chooses colors from the colormap of the parent axes. When you choose this option, the appearance of the density plot also depends on the value of the FaceAlpha property. For more information, see the FaceAlpha property.

  • An RGB triplet, a hexadecimal color code, a color name, or a short name — Apply one color to the density plot. When you choose this option, the value of FaceAlpha must be "interp".

RGB triplets and hexadecimal color codes are useful for specifying custom colors.

  • An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

  • A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes "#FF8800", "#ff8800", "#F80", and "#f80" are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
"red""r"[1 0 0]"#FF0000"

DensityPlot - Density plot appearance and behavior (4)

"green""g"[0 1 0]"#00FF00"

DensityPlot - Density plot appearance and behavior (5)

"blue""b"[0 0 1]"#0000FF"

DensityPlot - Density plot appearance and behavior (6)

"cyan" "c"[0 1 1]"#00FFFF"

DensityPlot - Density plot appearance and behavior (7)

"magenta""m"[1 0 1]"#FF00FF"

DensityPlot - Density plot appearance and behavior (8)

"yellow""y"[1 1 0]"#FFFF00"

DensityPlot - Density plot appearance and behavior (9)

"black""k"[0 0 0]"#000000"

DensityPlot - Density plot appearance and behavior (10)

"white""w"[1 1 1]"#FFFFFF"

DensityPlot - Density plot appearance and behavior (11)

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

RGB TripletHexadecimal Color CodeAppearance
[0 0.4470 0.7410]"#0072BD"

DensityPlot - Density plot appearance and behavior (12)

[0.8500 0.3250 0.0980]"#D95319"

DensityPlot - Density plot appearance and behavior (13)

[0.9290 0.6940 0.1250]"#EDB120"

DensityPlot - Density plot appearance and behavior (14)

[0.4940 0.1840 0.5560]"#7E2F8E"

DensityPlot - Density plot appearance and behavior (15)

[0.4660 0.6740 0.1880]"#77AC30"

DensityPlot - Density plot appearance and behavior (16)

[0.3010 0.7450 0.9330]"#4DBEEE"

DensityPlot - Density plot appearance and behavior (17)

[0.6350 0.0780 0.1840]"#A2142F"

DensityPlot - Density plot appearance and behavior (18)

Control how the FaceColor property is set, specified as one of these values:

  • "auto" — MATLAB controls the value of the FaceColor property by using the SeriesIndex property of the DensityPlot object and the ColorOrder property of the axes.

  • "manual" — You set the value of the FaceColor property directly, or indirectly as a function argument when you create the DensityPlot object.

If you change the value of the FaceColor property manually, MATLAB changes the value of the FaceColorMode property to "manual".

Series index, specified as a positive whole number or "none". This property is useful for reassigning the face colors of DensityPlot objects so that they match the colors of other objects.

By default, the value of the SeriesIndex property is a number that corresponds to its order of creation, starting at 1. MATLAB uses the number to calculate an index for assigning the face color when you call plotting functions. The index refers to the rows of the array stored in the ColorOrder property of the axes. Any objects in the axes that have the same SeriesIndex number will have the same color.

A SeriesIndex value of "none" corresponds to a neutral color that does not participate in the indexing scheme.

How Manual Color Assignment Overrides SeriesIndex Behavior

To manually control fill color, set the FaceColor property of the DensityPlot object to a color value, such as a color name or RGB triplet.

When you manually set the fill color of an object, MATLAB disables automatic color selection for that object and allows your color to persist, regardless of the value of the SeriesIndex property. The FaceColorMode property indicates whether the colors have been set manually (by you) or automatically. A value of "manual" indicates manual selection, and a value of "auto" indicates automatic selection.

To enable automatic selection again, set the SeriesIndex property to a positive whole number, and set the FaceColorMode property to "auto".

In some cases, MATLAB sets the SeriesIndex value to 0, which also disables automatic color selection.

Geographic Coordinate Data

expand all

Latitude coordinates in degrees, specified as a numeric vector with elements in the range [–90, 90] or as an empty ([]) array. The vector can contain NaN values. The sizes of LatitudeData and LongitudeData must match.

Data Types: single | double

Variable linked to LatitudeData, specified as a character vector or string scalar containing a MATLAB workspace variable name. MATLAB evaluates the variable in the base workspace to generate the LatitudeData.

By default, there is no linked variable, so the value is an empty character vector, ''. If you link a variable, then MATLAB does not update the LatitudeData values immediately. To force an update of the data values, use the refreshdata function.

Note

If you change one data source property to a variable that contains data of a different dimension, you might cause the function to generate a warning. The geodensityplot does not render the graph until you have changed all data source properties to appropriate values.

Longitude coordinates in degrees, specified as a numeric vector or an empty ([]) array. The vector can contain NaN values. The sizes of LongitudeData and LatitudeData must match.

The span of the longitude values must be less than or equal to 360 degrees.

Data Types: single | double

Variable linked to LongitudeData, specified as a character vector, or string scalar containing a MATLAB workspace variable name. MATLAB evaluates the variable in the base workspace to generate the LongitudeData.

By default, there is no linked variable, so the value is an empty character vector, ''. If you link a variable, then MATLAB does not update the LongitudeData values immediately. To force an update of the data values, use the refreshdata function.

Note

If you change one data source property to a variable that contains data of a different dimension, you might cause the function to generate a warning. The geodensityplot does not render the graph until you have changed all data source properties to appropriate values.

Legend

expand all

Interactivity

expand all

Callbacks

expand all

Callback Execution Control

expand all

Parent/Child

expand all

Parent, specified as a GeographicAxes object.

Identifiers

expand all

This property is read-only.

Type of graphics object, returned as 'densityplot'. Use this property to find all objects of a given type within a plotting hierarchy, for example, searching for the type using findobj.

Version History

Introduced in R2018b

expand all

Control how DensityPlot objects vary in color by setting the SeriesIndex property. This property is useful when you want to match the colors of different objects in the axes.

See Also

Functions

  • geodensityplot

Topics

  • Visualize Density Using Geographic Density Plots
  • Adjust Transparency of Geographic Density Plots

MATLAB Command

You clicked a link that corresponds to this MATLAB command:

 

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

DensityPlot - Density plot appearance and behavior (19)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
  • 日本 (日本語)
  • 한국 (한국어)

Contact your local office

DensityPlot - Density plot appearance and behavior (2024)
Top Articles
Easy and Quick Sugar Cookie Crust - Julie Blanner
Orange Creamsicle Cake • Food Folks and Fun
Star Wars Mongol Heleer
Dlnet Retiree Login
Breaded Mushrooms
Www.craigslist Augusta Ga
Obituary (Binghamton Press & Sun-Bulletin): Tully Area Historical Society
Directions To 401 East Chestnut Street Louisville Kentucky
Https Www E Access Att Com Myworklife
Aktuelle Fahrzeuge von Autohaus Schlögl GmbH & Co. KG in Traunreut
Kinkos Whittier
Ivegore Machete Mutolation
Cooking Fever Wiki
The Banshees Of Inisherin Showtimes Near Regal Thornton Place
Playgirl Magazine Cover Template Free
Mbta Commuter Rail Lowell Line Schedule
Busby, FM - Demu 1-3 - The Demu Trilogy - PDF Free Download
Haunted Mansion Showtimes Near Millstone 14
Lonesome Valley Barber
Watch The Lovely Bones Online Free 123Movies
Dr Ayad Alsaadi
Touchless Car Wash Schaumburg
Mega Personal St Louis
Morse Road Bmv Hours
Crossword Help - Find Missing Letters & Solve Clues
Intel K vs KF vs F CPUs: What's the Difference?
Meijer Deli Trays Brochure
LG UN90 65" 4K Smart UHD TV - 65UN9000AUJ | LG CA
Dubois County Barter Page
Nacogdoches, Texas: Step Back in Time in Texas' Oldest Town
Att U Verse Outage Map
Lowell Car Accident Lawyer Kiley Law Group
Tra.mypatients Folio
Sedano's Supermarkets Expands to Orlando - Sedano's Supermarkets
Consume Oakbrook Terrace Menu
Mohave County Jobs Craigslist
Heelyqutii
Metro Pcs Forest City Iowa
Sept Month Weather
Ukraine-Krieg - Militärexperte: "Momentum bei den Russen"
Petra Gorski Obituary (2024)
844 386 9815
Online-Reservierungen - Booqable Vermietungssoftware
Gon Deer Forum
Embry Riddle Prescott Academic Calendar
What is a lifetime maximum benefit? | healthinsurance.org
Marcel Boom X
Craigslist Anc Ak
Sitka Alaska Craigslist
Parks And Rec Fantasy Football Names
Ff14 Palebloom Kudzu Cloth
Itsleaa
Latest Posts
Article information

Author: Velia Krajcik

Last Updated:

Views: 6238

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Velia Krajcik

Birthday: 1996-07-27

Address: 520 Balistreri Mount, South Armand, OR 60528

Phone: +466880739437

Job: Future Retail Associate

Hobby: Polo, Scouting, Worldbuilding, Cosplaying, Photography, Rowing, Nordic skating

Introduction: My name is Velia Krajcik, I am a handsome, clean, lucky, gleaming, magnificent, proud, glorious person who loves writing and wants to share my knowledge and understanding with you.