def legend_size_medium_test(): test_data = pd.DataFrame({ 'Sample': ['Loooooong label 1', 'Loooooong label 2', 'Loooooong label 3'], 'A': [1, 3, 5], 'B': [2, 4, 1], 'C': [3, 8, 4], }) plot.stacked_bar_chart(data=test_data, x='Sample', y=['A', 'B', 'C'], legend_size='medium')
def legend_title_test(): test_data = pd.DataFrame({ 'Sample': ['Loooooong label 1', 'Loooooong label 2', 'Loooooong label 3'], 'A': [1, 3, 5], 'B': [2, 4, 1], 'C': [3, 8, 4], }) plot.stacked_bar_chart(data=test_data, x='Sample', y=['A', 'B', 'C'], legend_title='Mutation type')
def stacked_bar_chart_hide_xticklabels_test(): test_data = pd.DataFrame({ 'Sample': ['Loooooong label 1', 'Loooooong label 2', 'Loooooong label 3'], 'A': [1, 3, 5], 'B': [2, 4, 1], 'C': [3, 8, 4], }) plot.stacked_bar_chart(data=test_data, x='Sample', y=['A', 'B', 'C'], xticklabels=False)
def stacked_bar_chart_single_y_test(): test_data = pd.DataFrame({ 'Sample': ['S1', 'S2', 'S3'], 'A': [1, 3, 5], 'B': [2, 4, 1], 'C': [3, 8, 4], }) plot.stacked_bar_chart(data=test_data, x='Sample', y=['A'])
def stacked_bar_chart_sort_ascending_test(): test_data = pd.DataFrame({ 'Sample': ['S1', 'S2', 'S3'], 'A': [1, 3, 5], 'B': [2, 4, 1], 'C': [3, 8, 4], }) plot.stacked_bar_chart(data=test_data, x='Sample', y=['A', 'B', 'C'], sort=True, reverse=False)
def stacked_bar_chart_basic_test(): test_data = pd.DataFrame({ 'Sample': ['S1', 'S2', 'S3'], 'A': [5, 2, 8], 'B': [2, 1, 5], 'C': [1, 4, 2], }) plot.stacked_bar_chart(data=test_data, x='Sample', y=['A', 'B', 'C'])
def stacked_bar_chart_group_test(): test_data = pd.DataFrame({ 'Sample': ['S1', 'S2', 'S3', 'S4', 'S5'], 'A': [1, 3, 5, 1, 5], 'B': [2, 4, 1, 2, 5], 'C': [3, 8, 4, 6, 3], 'Group': ['G1', 'G2', 'G1', 'G1', 'G2'], }) plot.stacked_bar_chart(data=test_data, x='Sample', y=['A', 'B', 'C'], group='Group')