Edit labels of a legend when varying symbology by attribute

884
2
Jump to solution
02-09-2021 03:35 AM
Labels (1)
RachelCook
New Contributor

I'm varying the symbology by two attributes: Changing the shape for one variable (species) and colour for another (survey method). Usually I can edit what is on the legend by clicking the points in the layer in the contents pane and renaming them, but I can't do that for this layer. I can rename the top and bottom sections  of the layer in the contents but it doesn't change what's on the legend and I can't edit the middle section at all.

The reason it doesn't already have text labels is because I made a new field with a number assigned to each survey method, because I couldn't choose a text field when I was varying the symbology by attribute.

In short, I want each individual colour to have its own text label.  Is there a way I can do this?

 

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Notable Contributor

The "Vary Symbology by Attribute" options seem intended for numeric values as opposed to categorical, and as you've found, it's not great for symbolizing two categorical fields.

The only way to do it "right" is to add both attributes to the Primary Symbology tab, then adjust the symbols for each. This, of course, leads to the problems of 1. that much clicking is tedious and to be avoided, 2. if you don't have every unique combination present in your data, values are left out and have to be manually added, and 3. the layout legend looks utterly awful.

Lacking the ability to add sub-renderers for symbol groups in a single layer, *cough* QGIS *cough*, there isn't a nice way to accomplish this. I suspect you could author a custom symbology dictionary, but I don't personally have experience with that, so I can't speak to it.

Perhaps the easiest workaround, though woefully hacky and inelegant:

  1. Make a copy of your layer, that way you don't inadvertently lose your intended symbology.
  2. Symbolize your copy layer by the color field, in your case the Survey Method, using unique values.
  3. Set the symbol colors to match what you have defined in your "real" layer.
  4. Create a legend in your layout.
    1. To make the next step cleaner, turn off the legend's title and layer headings
  5. Convert the legend to graphics.
    jcarlson_0-1612881826820.png
  6. Go back and change the copy layer symbology to the shape field, Species, again using unique values.
  7. Match the shapes to the "real" layer.
  8. Again, create a legend and convert to a graphic.
  9. Drop your copy layer!
  10. Rearrange the graphics items as you see fit.

jcarlson_1-1612882132455.png

It's not great, but it works, and as long as you don't make any changes to the symbology, you won't have to do it more than once.

- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Notable Contributor

The "Vary Symbology by Attribute" options seem intended for numeric values as opposed to categorical, and as you've found, it's not great for symbolizing two categorical fields.

The only way to do it "right" is to add both attributes to the Primary Symbology tab, then adjust the symbols for each. This, of course, leads to the problems of 1. that much clicking is tedious and to be avoided, 2. if you don't have every unique combination present in your data, values are left out and have to be manually added, and 3. the layout legend looks utterly awful.

Lacking the ability to add sub-renderers for symbol groups in a single layer, *cough* QGIS *cough*, there isn't a nice way to accomplish this. I suspect you could author a custom symbology dictionary, but I don't personally have experience with that, so I can't speak to it.

Perhaps the easiest workaround, though woefully hacky and inelegant:

  1. Make a copy of your layer, that way you don't inadvertently lose your intended symbology.
  2. Symbolize your copy layer by the color field, in your case the Survey Method, using unique values.
  3. Set the symbol colors to match what you have defined in your "real" layer.
  4. Create a legend in your layout.
    1. To make the next step cleaner, turn off the legend's title and layer headings
  5. Convert the legend to graphics.
    jcarlson_0-1612881826820.png
  6. Go back and change the copy layer symbology to the shape field, Species, again using unique values.
  7. Match the shapes to the "real" layer.
  8. Again, create a legend and convert to a graphic.
  9. Drop your copy layer!
  10. Rearrange the graphics items as you see fit.

jcarlson_1-1612882132455.png

It's not great, but it works, and as long as you don't make any changes to the symbology, you won't have to do it more than once.

- Josh Carlson
Kendall County GIS
RachelCook
New Contributor

Thank you!