Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plots: Add title and axis titles; scatterplot option for logarithmic axes [FEATURE] #59366

Merged
merged 14 commits into from
Nov 29, 2024

Conversation

florianneukirchen
Copy link
Contributor

@florianneukirchen florianneukirchen commented Nov 7, 2024

Description

New features and bugfixes for the plotting algorithms (in "Plots") to get more meaningful plots.

Title and axis titles

Add title and axis titles as optional parameters to the processing algorithms:

  • Vector layer Scatterplot
  • Vector layer Scatterplot3D
  • Barplot
  • Boxplot
    If axis titles are empty, the name of the field is used as axis title. If a single space is entered, the axis title is not shown (and the plot looks like before the changes).

Logarithmic axes in scatterplot

Optionally, in "Vector layer Scatterplot", allow x-axis and/or y-axis to be logarithmic.

Bugfixes

  • Boxplot: "Value field" type must be numeric
  • Vectorlayer Scatterplot3D: Output name "Scatterplot 3D" instead of "Histogram"

Screenshots

Vector layer Scatterplot, new version (with logarithmic axes, title, y-axis title; while x-axis title was not given and the field name is used)

screenshot-1

Vector layer Scatterplot, old version for comparison
screenshot-now

Documentation

For https://docs.qgis.org/3.34/en/docs/user_manual/processing_algs/qgis/plots.html

Section Bar Plot

New Parameters (Label | Name | Type | Description):

  • Title | TITLE | [string] Default: "" | Title of the plot
  • X-axis Title | XAXIS_TITLE | [string] Default: "" | X axis title, if empty, the name of the category field is used. With a single space, the axis title is not shown.
  • Y-axis Title | YAXIS_TITLE | [string] Default: "" | Y axis title, if empty, the name of the value field is used. With a single space, the axis title is not shown.

Section Box Plot

New Parameters (Label | Name | Type | Description):

  • Title | TITLE | [string] Default: "" | Title of the plot
  • X-axis Title | XAXIS_TITLE | [string] Default: "" | X axis title, if empty, the name of the category field is used. With a single space, the axis title is not shown.
  • Y-axis Title | YAXIS_TITLE | [string] Default: "" | Y axis title, if empty, the name of the value field is used. With a single space, the axis title is not shown.

Change to Parameter "Value Field": Type is now: [tablefield: numeric]

Section Vector layer scatterplot

New Parameters (Label | Name | Type | Description):

  • Title | TITLE | [string] Default: "" | Title of the plot
  • X-axis Title | XAXIS_TITLE | [string] Default: "" | X axis title, if empty, the field name of the x attribute is used. With a single space, the axis title is not shown.
  • Y-axis Title | YAXIS_TITLE | [string] Default: "" | Y axis title, if empty, the field name of the y attribute is used. With a single space, the axis title is not shown.
  • Use logarithmic scale for x-axis | XAXIS_LOG | [boolean] Default: False | Optionally use logarithmic x axis
  • Use logarithmic scale for y-axis | YAXIS_LOG | [boolean] Default: False | Optionally use logarithmic y axis

Section Vector layer scatterplot 3D

New Parameters (Label | Name | Type | Description):

  • Title | TITLE | [string] Default: "" | Title of the plot
  • X-axis Title | XAXIS_TITLE | [string] Default: "" | X axis title, if empty, the field name of the x attribute is used.
  • Y-axis Title | YAXIS_TITLE | [string] Default: "" | Y axis title, if empty, the field name of the y attribute is used.
  • Z-axis Title | ZAXIS_TITLE | [string] Default: "" | Z axis title, if empty, the field name of the y attribute is used.

Change to Outputs:
Label of "OUTPUT" is now "Scatterplot 3D", not "Histogram"

Copy link

github-actions bot commented Nov 7, 2024

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 8a75d24)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 8a75d24)

@github-actions github-actions bot added this to the 3.42.0 milestone Nov 7, 2024
@DelazJ DelazJ added Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Nov 7, 2024
@qgis-bot
Copy link
Collaborator

qgis-bot commented Nov 7, 2024

@florianneukirchen

This pull request has been tagged for the changelog.

  • The description will be harvested so please provide a "nearly-ready" text for the final changelog
  • If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
  • If you can, it's better to give credits to your sponsor, see below for different formats.

You can edit the description.

Format available for credits
  • Funded by NAME
  • Funded by URL
  • Funded by NAME URL
  • Sponsored by NAME
  • Sponsored by URL
  • Sponsored by NAME URL

Thank you!

@qgis-bot
Copy link
Collaborator

qgis-bot commented Nov 7, 2024

@florianneukirchen
This pull request has been tagged as requiring documentation.

A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged.

Please update the description (not the comments) with helpful description and screenshot to help the work from documentors.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@florianneukirchen
Copy link
Contributor Author

My latest commit fixed the last issue raised by the code review. Is there anything left that prevents this from being merged?

@nyalldawson nyalldawson merged commit c6da434 into qgis:master Nov 29, 2024
31 checks passed
@qgis-bot
Copy link
Collaborator

@florianneukirchen
A documentation ticket has been opened at qgis/QGIS-Documentation#9428
It is your responsibility to visit this ticket and add as much detail as possible for the documentation team to correctly document this change.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog Items that are queued to appear in the visual changelog - remove after harvesting Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants