Skip to content

Edit a categorical attribute

Rename a categorical attribute, change its type, sort or hide its categories, and pick their colors.

Last reviewed: November 2020

A categorical attribute is one whose values Tuva treats as names of groups (categories), such as a species or a state (see attribute). The values are usually words, but numbers such as ZIP codes can be categories too. You change its name, type, category order, which categories show and their colors in the Attribute Settings Card. Basic and Premium teachers can both do this.

The examples below use a dataset with Name, Species and Height attributes, with Species on the X axis.

  1. Open your dataset in Tuva Tools. In the case card, click the pencil at the right end of the attribute’s row.

    The case card with Name, Species and Height, and the pencil on the Species row highlighted

  2. The Attribute Settings Card opens in place of the case card. It has Name and Description boxes, a Type menu, two Sort buttons, and under Filter Categories a checkbox and a colored dot for each category, with the number of cases in it.

    The Attribute Settings Card for Species, with Name, Description, Type, Sort and Filter Categories listing Birch (1), Maple (2) and Oak (2)

Click the X at the top right of the card to go back to the case card.

Type a new name in the Name box. When you close the card, the case card and the graph’s axis label show the new name. Use the Description box for a longer note about the attribute.

The Name box highlighted with "Tree species" typed in it

Click the Type menu and choose a type. A categorical attribute shows Categorical. The menu also lists Categorical: Numerical Intervals, Numerical and numerical formats such as fractions, extracted numbers, dates, times and days of the week.

The Type menu open, listing Categorical, Categorical: Numerical Intervals, Numerical, Numerical: Fraction and Numerical: Extracted Number

Categorical: Numerical Intervals turns a numerical attribute into categories, one for each range of values (bins). Open the numerical attribute’s pencil, choose Categorical: Numerical Intervals under Type, then set Start (where the first range begins) and Width (how wide each range is). With Start 5 and Width 5, the Height values here fall into 5 to 9, 15 to 19, 20 to 24 and 30 to 34. Each range includes both of its numbers, so 5 to 9 holds 5 through 9, and a 10 would go in 10 to 14. A range with no cases, such as 10 to 14 here, is left out. Change Width to 10 and they regroup into 5 to 14, 15 to 24 and 25 to 34. Each range gets a checkbox and a color like any other category.

The Attribute Settings Card for Height with Type set to Categorical: Numerical Intervals, Start 5, Width 5, and the ranges on the X axis

Under Sort, click the left button to list the categories from A to Z, or the right button for Z to A. The categories on the axis and in the list change order.

The Sort buttons with Z to A pressed, and the axis showing Oak, Maple, Birch

Under Filter Categories, uncheck a category to take its cases off the graph. A filter icon at the top right of the graph shows a minus sign and the number of hidden cases (here, -2 means two cases are hidden). Check the box again to bring them back. Clear unchecks every category, and Select all checks them all again.

Oak unchecked under Filter Categories, the graph showing only Maple and Birch, and -2 at the top right

Each category has its own color. To see those colors on the graph’s points, put the attribute on Color By first. The Attribute Settings Card sits where the case card was, so you switch between the two.

  1. Click the X at the top right of the Attribute Settings Card to go back to the case card.
  2. Drag the attribute from the case card to the Color By area on the right of the graph. The points take the category colors, and a key appears on the right.
  3. Click the attribute’s pencil in the case card to open the Attribute Settings Card again.
  4. Under Filter Categories, click the colored dot to the left of the category’s name.
  5. Click a color in the picker, or pick one from the color area or type a hex code. The dot, the points and the key all change to the new color.

The color picker open next to Maple, with 12 color swatches, a color area and a hex box

Tuva keeps these changes only if you save a plot. If you close or reload the page first, the attribute goes back to how it was. Saving a plot does not change the dataset you started from.

  1. Click Save Plot at the bottom of the screen.
  2. Type a Plot Title and click Save as New.

The saved plot keeps the new name, the category order and the colors when you open it again.

Was this page helpful?