Не загружая сюда кучу данных, у меня есть следующий код:< /p>
myPlot = sns.barplot(dfFrequencies, x="Topic", y="Relative Frequency")
myPlot.set_xticklabels(myPlot.get_xticklabels(), rotation=45)
myPlot.set_title("Pew Poll Responses: Which is Most Meaningful?")
И в VSCode это результат
[img]https://i.sstatic .net/zatwJ65n.png[/img]
Итак, мой первый вопрос: как я могу подавить текст в кружке?
Позже в том же блокноте я иметь следующий код:
# Create the requested scatterplot with Mid-Career Year on the x-axis and
# standardized OPS on the y-axis.
# Remember titles and axis labels.
sns.set(rc={"figure.figsize":(10, 6)})
set_style(theme)
myplot = sns.scatterplot(data=dfHofData, x="Midpoint", y="OPS_z")
myPlot.set_title("Standardized OPS by Mid-Career Year")
myPlot.set_xlabel("Mid-Career Year")
myPlot.set_ylabel("Standardized On Base Percentage Plus Slugging (OPS)")
И получается такой сюжет. Опять же, есть текст из последнего набора, но в данном случае ни один из них на самом деле ничего не сделал. Что мне не хватает?

Вызов set_style(theme) — это код, предоставленный инструктором для установки темного режима темы. Для полноты вот это:
theme = 'darkmode'
def set_style(theme='darkmode'):
if theme == 'darkmode':
sns.set_theme(style='ticks', context='notebook', rc={'axes.facecolor':'black', 'figure.facecolor':'black', 'text.color':'white',
'xtick.color':'white', 'ytick.color':'white', 'axes.labelcolor':'white', 'axes.grid':False, 'axes.edgecolor':'white'})
else:
sns.set_theme(style='ticks', context='notebook')
Подробнее здесь: https://stackoverflow.com/questions/790 ... t-labeling
Мобильная версия