Skip to content

[Bug]: Numbers in words not italic #29253

@Sanas-m

Description

@Sanas-m

Bug summary

Y labels in plots cannot be displayed in italic if the label contains numbers. While the letters will be italic, the numbers will stay in normal font.

Code for reproduction

mpl.rcParams['font.family'] = 'Arial'

bars = sns.barplot(
    x='Sample Name',
    y='delta',
    data=renamed,
    palette=custom_palette,
    alpha=1,
    edgecolor='grey',
    errorbar='se',
    errcolor='black',
    capsize=0.05,
    errwidth=1
)


sns.stripplot(
    x='Sample Name',
    y='delta',
    data=renamed,
    palette=custom_palette,
    edgecolor='white',
    linewidth=1,
    alpha=1,
    size=8,
    legend=False,
    dodge=False,
    jitter=0.17
)

bars.spines['top'].set_visible(False)
bars.spines['right'].set_visible(False)
plt.xticks(rotation=45, ha='right')
plt.ylabel("${CYP11B2}$ mRNA (%)")
plt.xlabel("")
plt.suptitle("")

plt.show()

Actual outcome

figure

Expected outcome

image

Additional information

No response

Operating system

Mac OS Apple M1 Ventura 13.4.1

Matplotlib Version

3.9.2

Matplotlib Backend

module://matplotlib_inline.backend_inline

Python version

3.11.3

Jupyter version

6.5.4

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions