3

I am trying to add a list of exponential symbols for a legend entry that is not displaying as I expected in the print layout. For context, I have a list of earthquakes with magnitudes and I want to plot those event locations with a circle symbol who's size grows exponentially with it's magnitude, giving extra emphasis to large earthquakes. I am using version QGIS 3.16 for my example below.

In the symbology tab of the layer properties, I initially used the graduated symbol style which worked, but I was only ever able to get the scaling to be linear, so lower magnitude events obscured the larger events. I found this page on the stack exchange (Changing symbol size using the "Size assistant" in QGIS?) that showed and example of how to create the desired effect with the single symbol (instead of graduate) method, so I followed the example there and edit the size using the size assistant.

Symbology Assistant Menu

I could then manually control where the exponential size of the symbols increased and by what factor. This window shows how I scaled the symbols based on their Magnitude attribute.

symbol_size_expression

The trouble I am having is that when I try and display this symbol in the legend of the print layout, only a single entry for the Magnitude is shown. This makes sense as I switched from a "graduated" symbology to a single symbol style.

Legend_Display

Layout_Legend_Items

Is there a way for me to show a similar scale shown in the Symbology assistant in the print layout legend? Is there a way to create this exponential growth symbology in the Graduated Symbol class instead? When I examined options with using a graduated symbol, I couldn't find a mode available to scale the symbols on an exponential scale.

graduate_symbology

The page I highlighted at the beginning even has a comment about a legend issue, but no link or follow up comment was ever provided.

2
  • Have you tried using categorised symbols?
    – Erik
    Aug 29 at 12:58
  • I'm not sure I follow. I hadn't explored that as an option. Do you have an example of how that might work? I am looking at that option and see that I can select the value to categorize on (magnitude) but then I get a long list of magnitudes ranging from lowest to highest. it also seems to only be a color based symbology, but I might be missing something obvious.
    – Schmidt
    Aug 29 at 13:07

1 Answer 1

1

A solution to get your legend clean and have full control.

Symbol size shown in the legend

Start from your point with exponential size as you have done. Then only one symbol shown in the legend.

In your QGIS project change single symbol to rule-based symbology. You will have only one symbol that has the size dependent on your attribute. Copy paste it to duplicate it. It will be a fake symbol never shown on your map.

Then edit the symbol to make the size not dependent on your attribute and set a rule to be never shown on the map (false). Choose the size and label to be shown (by hand you should choose the good size and value).

enter image description here

Duplicate this process to create a new symbol step and another and another to get your legend great.

1
  • Thanks Corentin, but I feel like this is a little more "manual" than I was hoping for. Not that that is bad, but for professional plots, I would hope for a more "precise" legend, rather than having to eyeball the size of the symbols for each mag interval (1, 2, ... 7+). In my mind, seems I could get a similar result just duplicating a single point as its own feature and scaling each one individually, but there is still guesswork on correctly sizing each ring that correlates to a specific magnitude...
    – Schmidt
    Aug 29 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.