'Put several upset plot in one figure in python

I want to put two upset plot in one figure with this code

from upsetplot import from_contents
from upsetplot import UpSet
import matplotlib.pyplot as plt

PN_enhan=['cat','dog','pig','peach']
PC_enhan=['cat','dog','peach']
PG_enhan=['cat','dog','pig']

fig, [ax1, ax2] = plt.subplots(nrows=1, ncols=2)

animals = from_contents({'KN':PN_enhan ,'KC': PC_enhan , 'KG': PG_enhan})
ax1.UpSet(animals,show_percentages=True).plot()#, subset_size='count'

PN_ff=['1','2','4']
PC_ff=['1','2','3','5']
PG_ff=['1','4','2','8']

animals = from_contents({'KN':PN_ff ,'KC': PC_ff , 'KG': PG_ff})
ax2.UpSet(animals,show_percentages=True).plot()#, subset_size='count'


plt.show()

but I receive this error

AttributeError: 'AxesSubplot' object has no attribute 'UpSet'

Can any one help me?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source