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

fmt_nanoplot includes excluded rows when scaling plot #283

Open
rasmi opened this issue Apr 12, 2024 · 0 comments
Open

fmt_nanoplot includes excluded rows when scaling plot #283

rasmi opened this issue Apr 12, 2024 · 0 comments

Comments

@rasmi
Copy link

rasmi commented Apr 12, 2024

I am using fmt_nanoplot to create a table with a histogram on the margins. To do this, I want to exclude the last row, which is a Total row. When I exclude the row using the rows= parameter, the scale of the plot appears as if it still factors in the row that was not plotted. I would expect that the plot scales only with the values included in the plot.

Reproducible example

(adapted from docs)
Screenshot 2024-04-12 14 20 51

import polars as pl
single_vals_df = pl.DataFrame(
    {
        "i": list(range(1, 6)),
        "lines_small": [12.44, 6.34, 5.2, -8.2, 10],
        "lines_large": [12.44, 6.34, 5.2, -8.2, 100]
    }
)
(
    GT(single_vals_df, rowname_col="i")
    .fmt_nanoplot(columns="lines_small", rows=[0,1,2,3], plot_type="line")
    .fmt_nanoplot(columns="lines_large", rows=[0,1,2,3], plot_type="line")
)

Development environment

  • Operating System: Colab notebook
  • great_tables: 479eb73 (v0.5.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants