Improve "Polar bar plot" tool #64430
Open
+51
−21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
1. Rename "Polar plot" as "Polar bar plot'
This PR is in part a follow-up to the discussion of the "Polar plot" processing algorithm in the QGIS Documentation (qgis/QGIS-Documentation#10577). As per the suggestion by @DelazJ , this PR renames "Polar plot" as "Polar bar plot." This is intended to specify the particular kind of Plotly polar chart generated by the processing tool.
2. Improve the "Polar bar plot" tool
The current tool (i) generates a bar for each individual observation and (ii) labels each bar by degree (the bar's position around the plot's origin). For example, here is a plot generated from the capital costs of government projects in Canada:
This PR aims to harmonize the "Polar bar plot" tool with the "Box plot" and "Bar plot" tools by grouping and summing up those values by a designated category. Here is an example of a plot generated with the updated tool, with the capital costs grouped and labeled by Canadian province:
Note that the "category" field (
NAME_FIELD) was removed in #64238, because the field did not serve any purpose at that time. This PR restores theNAME_FIELDparameter, and uses that parameter to group theVALUE_FIELDvalues.The short description and help text have also been revised to reflect these updates.
3. Make it possible to add a title
This PR follows the example in the Bar plot tool to add a
TITLEparameter that users can use to title their plots. (See the same example above.)4. Remove unnecessary import
The code included a test for a
numpyimport, butnumpywas then left unused in the code. This PR removes thenumpyimport.