I am using the point cluster symbology in QGIS and have defined the size of each point based on the cluster size using @cluster_size in the size assistant.
It looks great on my map, but I cannot figure out how to add the size symbology for the variable to my legend in the map composer to create a map for a presentation/publication.
Best Answer
It's not possible to directly display data-defined symbol sizes in a legend. Here's a workaround.
Duplicate the point layer (Layer panel > right click on layer name > Duplicate layer).
Change symbology of the duplicate layer to "graduated" and for method choose "size."
The style settings for the duplicate layer look like this:
Turn off the duplicate layer so you don't see it on the map.
Use the duplicate layer in the print composer legend. The legend looks like this:
You can use the controls under legend items to