NominalScale

NominalScale[{cat1,cat2,,catn}]

represents a set of unordered categories cati.

NominalScale[cat1lab1,,catnlabn|>]

also associates the category cati with the labels labi.

NominalScale[,catilabi,|>]

uses labi to represent cati in plots.

NominalScale[Automatic]

automatically determines the categories.

Details and Options

  • Nominal scales are used to identify things such as products, names and places. Typical examples include:
  • apple,banana,orange, fruit categories
    London,NYC,Miami,Paris, city categories
    sad,happy,angry, emotion categories
  • Use NominalScale with ScalingFunctions to place categorical values along an axis.
  • There is no ordering between the categories; they are either equal or not.
  • The categories cati can be any expression.
  • NominalScale[][prop] gives the specified property of an ordinal scale.
  • Possible properties include:
  • "CategoryList"list of categories {cat1,,catn}
    "LabelAssociation"association of the form <|,catilabi,|>
    "LabelList"list of labels {lab1,,labn}
    "Properties"list of supported properties
  • NominalScale[][prop,arg] or NominalScale[][prop][arg] return the property prop according to the argument arg.
  • Possible properties prop and arguments arg include:
  • "Label"catilabel labi corresponding to cati
    "Labels"{,cati,}list of labels labi corresponding to cati

Examples

open allclose all

Basic Examples  (4)

Simulate the results of flipping a coin 100 times:

Label "Heads" and "Tails" with "H" and "T", respectively:

Automatically determine the CPU state categories in a time series:

Show the prices of apples based on the types and sizes:

Provide labels for coded categories:

Scope  (23)

Example Scales  (11)

Race categories from a survey:

Marital status:

Gender:

Cloud categories:

Computer type:

Operating system:

Continents:

Currencies:

Languages:

Car types:

Sports:

Categories and Labels  (7)

Categories can be any type of expression, such as strings:

Entities:

Colors:

Pictures:

Numeric categories do not use a numeric scale:

Assign labels and an order to numeric values:

Automatically detected categories are shown in the order they appear in the data:

Specify the categories and what order they should appear in:

Categories that are omitted from the scale are treated as missing and are not shown:

By default, the categories are used as labels:

Specify labels to use in place of the categories:

Provide labels for individual categories:

Labels can be any type of expression:

Extracting Properties  (5)

Obtain a list of properties for a nominal scale:

Extract the list of categories:

Sort the categories alphabetically and create a new scale:

Extract the mapping between categories and labels:

Determine the label for a single category:

Determine the labels for a list of categories:

Options  (1)

RotateLabel  (1)

By default, labels are oriented horizontally:

Rotate the tick labels for better reading:

Applications  (11)

Basic Applications  (1)

Use NominalScale in a BubbleChart:

Use it in GroupBy:

Agriculture  (1)

Use ParallelAxisPlot to plot multi-categorical orange wholesale data from the USDA:

Chemistry  (3)

Visualize the electrical type of a class of chemical elements:

Visualize the natural state of the elements:

Plot which blocks the elements are in:

Commerce  (1)

Use ParallelAxisPlot to plot car specifications with NominalScale:

Weather  (1)

Plot types of precipitation for a couple months:

Education  (1)

Show grades for students in a classroom:

Biology  (1)

Plot the DNA sequence for part of a chromosome:

Social Sciences  (1)

Plot the political parties of US presidents over time:

Markov Chain  (1)

Model the process of tossing a coin repeatedly, using a discrete Markov process where the probability of getting heads is 0.6 and getting tails is 0.4:

Simulate 50 coin tosses:

Wolfram Research (2022), NominalScale, Wolfram Language function, https://reference.wolfram.com/language/ref/NominalScale.html.

Text

Wolfram Research (2022), NominalScale, Wolfram Language function, https://reference.wolfram.com/language/ref/NominalScale.html.

CMS

Wolfram Language. 2022. "NominalScale." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NominalScale.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_nominalscale, author="Wolfram Research", title="{NominalScale}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/NominalScale.html}", note=[Accessed: 18-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_nominalscale, organization={Wolfram Research}, title={NominalScale}, year={2022}, url={https://reference.wolfram.com/language/ref/NominalScale.html}, note=[Accessed: 18-November-2024 ]}