-
Notifications
You must be signed in to change notification settings - Fork 9
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
Known Issue: Table headers don't work as expected with 6 (or fewer) rows of data #52
Comments
I've encountered the same exact issue today, so I've been investigating it a bit to find a temporary workaround, but without success so far. However, here are some elements if it can help someone else investigating the problem too: After generating a forestplot (filling the "annote" and "annoteheaders" parameters, and setting the "table" parameter to True), I stored it in a
So the column labels are not really deleted from the plot, they are just invisible for some reason. I've ruled out things like incorrect font color (e.g. white on white) or incorrect font size (e.g. very small font sizes). I've also been trying to tweak parameters like My hypotheses so far is that either the labels are hidden behind another matplotlib element that takes precedence over them, or they are plotted in a position outside the plot (even though Hopefully this might be helpful to fix the issue. |
I just found a quick and (very dirty) workaround, not sure if it will work in all scenarios, but here it is: Once you stored the forest plot if a
You may have to try different values for As for a longer-term fix, it looks like the issue is with the labels being cropped by a too short upper limit on the y axis, when the dataframe has too few rows. I have absolutely no idea where this problem occurs in the codebase, but I'll try to investigate it further if I have some time on my hands one of these days (not sure it will happen though :( ). |
@LSYS Ah, I just saw the abandoned status on this bug. If in some hypothetical future I submit a pull request to fix the issue, will you accept it? (I don't want to spend too much time on it for nothing!) |
Continuing some testing on my local machine, in Line 537 in 04b8858
negative_padding always to 0.5, that is replacing
by solves the issue in the example given in https://github.com/LSYS/forestplot/blob/main/docs/assets/issue52-table-does-not-work-6rows-or-fewer.ipynb So that's surely negative_padding the culprit here. Fixing the issue would require to check possible side-effects of keeping |
@jeanbaptisteb give me some time to look at this. But absolutely, if you submit a PR to fix it with tests passing (plus other example figures all looking as expected), it should be accepted. |
See issue48-table-does-not-work-6rows-or-fewer.ipynb.
The text was updated successfully, but these errors were encountered: