-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…1676) - Previously for some reason we were mapping the first subplot chart title to the figure title, which was incorrect. Instead map the Figure title attribute to the figure, and then chart title to the individual subplots - Annoyingly plotly doesn't have a chart title property, so we need to map these titles to `annotations` to get it to work correctly - Fixes #1674 , Fixes #1675 - Tested with the following snippet: ``` from deephaven.plot.figure import Figure from deephaven import read_csv insurance = read_csv("https://media.githubusercontent.com/media/deephaven/examples/main/Insurance/csv/insurance.csv") insurance_by_region = insurance.view(formulas=["region", "expenses"]).avg_by(["region"]) insurance_by_sex = insurance.view(formulas=["sex", "expenses"]).avg_by(["sex"]) insurance_by_children = insurance.view(formulas=["children", "expenses"]).avg_by(["children"]).sort(order_by=["children"]) insurance_by_smoker = insurance.view(["smoker", "expenses"]).avg_by(["smoker"]) insurance_cat_plots = Figure(rows=2, cols=2).\ new_chart(row=0, col=0).\ plot_cat(series_name="Region", t=insurance_by_region, category="region", y="expenses").\ chart_title(title="Average charge ($) by region").\ new_chart(row=0, col=1).\ plot_cat(series_name="Sex", t=insurance_by_sex, category="sex", y="expenses").\ chart_title(title="Average charge ($) by sex").\ new_chart(row=1, col=0).\ plot_cat(series_name="Children", t=insurance_by_children, category="children", y="expenses").\ chart_title(title="Average charge ($) per number of children").\ new_chart(row=1, col=1).\ plot_cat(series_name="Smoker", t=insurance_by_smoker, category="smoker", y="expenses").\ chart_title(title="Average charge ($) smokers vs nonsmokers").\ chart_legend(visible=False).\ figure_title("Figure Title").\ show() ``` ![image](https://github.com/deephaven/web-client-ui/assets/4505624/f9a6f7fc-3110-492a-8d57-1d49616ce387)
- Loading branch information
Showing
4 changed files
with
84 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters