The figure is not fully displayed. When I was conducting the Visualize Label Distribution experiment(Visualize Label Distribution - Flower Datasets 0.5.0), I found that the final result’s graph was not fully displayed. Why?
Here is my code and the result of running it on pycharm.
from flwr_datasets import FederatedDataset
from flwr_datasets.partitioner import DirichletPartitioner
from flwr_datasets.visualization import plot_label_distributions
fds = FederatedDataset(
dataset='cifar10',
cache_dir='./Datasets',
partitioners={
'train': DirichletPartitioner(
num_partitions=10,
partition_by='label',
alpha=0.3,
seed=42,
min_partition_size=0,
),
},
)
partitioner = fds.partitioners['train']
fig, ax, df = plot_label_distributions(
partitioner,
label_name='label',
plot_type='bar',
size_unit='absolute',
partition_id_axis='x',
legend=True,
title="Per Partition Label Distribution",
verbose_labels=True,
)
fig.show()
fig.savefig('label_distribution.png')