Skip to content

Boxplots have duplicate xtick labels when enabling x axis sharing #628

@anirudhkrishnan2718

Description

@anirudhkrishnan2718

When sharex in the following code is set to 2 or above, there are duplicated xticklabels. This issue also shows up with xrotation = 0 because the ticklabels appear bold (double rendering).

import numpy as np
import ultraplot as uplt
data = [np.random.random(size=j * 50) for j in range(1, 11)]

f, axs = uplt.subplots(
    nrows=2,
    ncols=2,
    xrotation=45,
    figwidth="6in",
    figheight="4in",
    xminorlocator="null",
    grid=False,
    sharey = False, sharex = 2,
    xlabel = 'Set Index', ylabel = 'Value',
    suptitle = 'Boxplot of random numbers between 0 and 1 with increasing set size'
)
for idx, ax in enumerate(axs, 1):
    ax.format(title=f"Panel Number {idx}")
    ax.boxplot(data, showfliers=False, lw = 0.5)

I don't know how to look at the internals of ultraplot, but I can attach the two figures for different values of sharex here.

Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions