-
-
Notifications
You must be signed in to change notification settings - Fork 111
Document the size and layout options #1545
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
doc/ref/plot_options/size.ipynb:12
- [nitpick] Consider standardizing the capitalization for consistency; the notebook header uses 'Size and Layout Options' while this directive uses 'Size And Layout Options'.
.. plotting-options-table:: Size And Layout Options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few quick questions on the options:
- Should fontsize and fontscale be in the same option group?
- Should aspect and data_aspect be in this size and layout group?
doc/ref/plot_options/size.ipynb
Outdated
"source": [ | ||
"## `frame_width / frame_height`\n", | ||
"\n", | ||
"The `frame_width` and `frame_height` options determine the width and height of the data area within the plot. They define the size of the plot’s core region (excluding axes, legends, and margins), allowing precise control over how the data is displayed." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool, I had never really thought about this (or forgot!). Like in HoloViews docs, it could be nice to show two plots with frame_height/width set, one without a legend or colorbar and one with, to see the inner plots have the same dimension.
doc/ref/plot_options/size.ipynb
Outdated
"import hvplot.xarray # noqa\n", | ||
"import hvsampledata\n", | ||
"\n", | ||
"df = hvsampledata.air_temperature(\"xarray\")\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pick just one timestamp to avoid the non-interactive widgets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
doc/ref/plot_options/size.ipynb
Outdated
"import hvplot.xarray # noqa\n", | ||
"import hvsampledata\n", | ||
"\n", | ||
"df = hvsampledata.air_temperature(\"xarray\")\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pick just one timestamp to avoid the non-interactive widgets.
doc/ref/plot_options/size.ipynb
Outdated
"import hvplot.xarray # noqa\n", | ||
"import hvsampledata\n", | ||
"\n", | ||
"df = hvsampledata.air_temperature(\"xarray\")\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pick just one timestamp to avoid the non-interactive widgets.
doc/ref/plot_options/size.ipynb
Outdated
"source": [ | ||
"## `padding`\n", | ||
"\n", | ||
"The `padding` option expands the plot’s automatically computed axis limits by a given fraction. When hvPlot determines the x and y ranges based on your data, it finds the minimum and maximum values needed to display all points. With padding applied, these ranges are extended by the specified fraction so that data points near the edges have more space. The padding value can be given as a single number for uniform padding, a tuple to specify different padding for the x- and y-axes, or even a nested tuple to set distinct padding for the upper and lower bounds of each axis." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's a good idea to set tiles=True
in this example (the axes are distributed differently). Might be best to use a simpler dummy and more geometric dataset in this case.
Something like this maybe:
import pandas as pd
df = pd.DataFrame({'x': [0, 1, 0, -1], 'y': [-1, 0, 1, 0]})
df.hvplot.scatter(x='x', y='y', padding=(0.5, 0.1))
doc/ref/plot_options/size.ipynb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the file be named size_and_layout
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems unnecessarily long IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about size_layout
? More descriptive URL helps with SEO I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Yeah, I think so. I'll move
Hmm, I think so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR documents the new Size and Layout options for plots and updates internal option categorizations accordingly.
- Introduces the new options “aspect” and “data_aspect” with detailed documentation.
- Reassigns the “fontscale” option from the Size and Layout section to the Axis Options.
- Updates the documentation index and adds a new notebook detailing these changes.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
hvplot/converter.py | Updates docstrings and internal option lists to reclassify axis and size/layout options. |
doc/ref/plotting_options/size_layout.ipynb | Adds a comprehensive notebook demonstrating the new size and layout options. |
doc/ref/plotting_options/index.md | Links the new size/layout documentation for easier navigation. |
Comments suppressed due to low confidence (1)
hvplot/converter.py:378
- Since 'fontscale' has been reclassified to the Axis Options, ensure the accompanying documentation consistently reflects its new categorization and rationale for the change.
fontscale : number
@@ -511,7 +511,8 @@ class HoloViewsConverter: | |||
] | |||
|
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
fixes #1544
This PR adds the Size and Layout options to the reference docs.