I'd like to be able to include a variable in either the title (subtitle) or footnote text on a seaborn pairplot -- I'm selecting for a date range and specifically want to add the dates and a name. I can easily put a static title on the pairplot and it runs as expected.
Here's the code:
subData = rslt_avgData[['averageSpO2', 'averageHR', 'averageRR', 'averagePVi', 'averagePi']]
g=sns.pairplot(subData, hue = 'averageSpO2', palette= 'dark:salmon')
g.fig.suptitle("Average SpO2 compared to average of other variables, selected dates", y=1.05, fontweight='bold')
g.fig.text('Event Name: ', eventName,
'\nStart Date: ', startDate,
"\nEnd Date: ", endDate)
Here's the error:
----> 7 g.fig.text('Event Name: ', eventName,
8 '\nStart Date: ', startDate,
9 "\nEnd Date: ", endDate)
TypeError: text() takes from 4 to 5 positional arguments but 7 were given
If I try just using the fixed text, I get this error:
----> 7 g.fig.text('Event Name: \nStart Date: \nEnd Date: ')
TypeError: text() missing 2 required positional arguments: 'y' and 's'
If I try when specifying location (x,y), and the text (s), like this: g.fig.text(x=0, y=-0.5, s='Event Name: ',eventName,'\nStart Date: \nEnd Date: ') (whether I put the x and y at the beginning or the end...)
I get this error:
g.fig.text(x=0, y=-0.5, s='Event Name: ',eventName,'\nStart Date: \nEnd Date: ')
^
SyntaxError: positional argument follows keyword argument