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

Gadfly - subplot_grid is not readjusting the x axis width for free_x_axis = true, if xlabels are different in subplots #1585

Open
rkmalaiya opened this issue May 26, 2022 · 0 comments

Comments

@rkmalaiya
Copy link

Hi,

Sorry for reposting the issue, but I couldn't get to a solution here, hence reposting the issue here in github.

This issue is related to using subplot_grid in Gadfly. The issue is, given the xlabels in the two subplots are different due to my data points, even when I do free_x_axis = true, the plot retains the locations of the xlabels filled with empty space. Please help me understand how may I fix this?

Fake Data

df_plot = vcat(
DataFrame(model = repeat([“one”,“two”, “three”],inner=242),
type = repeat([“type1”],outer=726),
data=rand(726))
,
DataFrame(model = repeat([ “four”, “five”, “six”],inner=242),
type = repeat([“type2”],outer=726),
data=rand(726)))

image

Some more information about the data

image

Plot
Here I am not using free_x_axis = true just to show how the plot looks

Gadfly.plot(df_plot,
x=:model,
y=:data,
xgroup = :type,
Geom.subplot_grid(Geom.boxplot),
)

image

Now, if I use free_x_axis = true, the empty xlabels goes away, but the empty space still remains. Hence, the plot doesn’t look pretty

image

Thanks for all the help!

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

1 participant