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

Boxplot X label rotation #20

Open
5uperpalo opened this issue Jul 4, 2019 · 1 comment
Open

Boxplot X label rotation #20

5uperpalo opened this issue Jul 4, 2019 · 1 comment

Comments

@5uperpalo
Copy link

Is there a way to rotate x labels in grouped/stratified boxplots? I tried 'rot' argument from pandas boxplot, I also tried to assign ax=axs so I can set the labels afterwards, but it's not working for stratified boxplot.
(BTW thank you for this great tool!!!)

this works(no rotation):
pattern_time_ranges.stratify(['event_type']).cols['event_time_range'].boxplot(figsize=(16, 5))

this does not work:
fig, axs = plt.subplots(1, 1, figsize=(16, 5))
pattern_time_ranges.stratify(['event_type']).cols['event_time_range'].boxplot(ax=axs)
Error : NotImplementedError: TransformNode instances can not be copied. Consider using frozen() instead.

this does not work too:
pattern_time_ranges.stratify(['event_type']).cols['event_time_range'].boxplot(figsize=(16, 5), rot=90)

@dvgodoy
Copy link
Owner

dvgodoy commented Jul 25, 2019

Hi @5uperpalo ,

Thanks for reporting this issue. You've found a bug - using ax argument in a stratified plot is not working, neither it accepts rot argument.
There is a workaround, though... you can build the plot as it is and modify it later, like this:

fig, axs = hdf.stratify(['Pclass']).cols['Age'].boxplot()
axs[0].set_xticklabels(axs[0].get_xticklabels(), rotation=90, horizontalalignment='right')

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants