[Python] Seaborn swarmplot

Discussão em 'Python' iniciado por Stack, Março 11, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to plot a seaborn swarplot and it looks like this: [​IMG]

    But I want the first and last vertical lines removed (but without gaps in horisontal lines) Here is snippet from my full code:


    # setting theme
    sns.set_theme(style="ticks", palette=pallete)

    # creating figure and axes
    fig, ax = plt.subplots(figsize=(10, 6)) # Increase figure size for better spacing

    # background color
    fig.patch.set_facecolor(bg_color)

    # categorical scatterplot
    sns.swarmplot(data=data, x=x, y=y, hue=hue, ax=ax,size=marker_size,dodge=False,orient='h')

    # axes (chart) background color
    ax.set_facecolor(chart_bg_color)

    # grid
    ax.grid(True, color=grid_color, alpha=grid_alpha, linestyle=grid_line)


    Is there any parameter that swarmplot uses that ignores that 1st and last lines that make the grid asymmetric?

    Continue reading...

Compartilhe esta Página