Animal Crossing Villager Species and Personality
source link: https://datacrayon.com/posts/plotapi/showcase/animal-crossing-with-plotapi-chord/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Preamble¶
from plotapi import Chord import json Chord.set_license("your username", "your license key")
Introduction¶
In this notebook we're going to use Plotapi Chord to visualise the co-occurrences between the species and personality of Aniaml Crossing villagers. We"ll use Python, but Plotapi can be used from any programming language.
In a chord diagram (or radial network), entities are arranged radially as segments with their relationships visualised by ribbons that connect them. The size of the segments illustrates the numerical proportions, whilst the size of the arc illustrates the significance of the relationships. Chord diagrams are useful when trying to convey relationships between different entities, and they can be beautiful and eye-catching.
Dataset¶
We're going to use data from Animal Crossing New Horizons data, which is available in this repository. Let"s get loading the data.
with open("ac_species_personality.json", "r") as f: data = json.load(f)
Visualisation¶
Let's use Plotapi Chord for this visualisation, you can see more examples in the Gallery.
We're going to adjust some layout and template parameters, and flip the intro animation on too.
Because we're using a data-table, we can also click on any part of the diagram to "lock" the selection.
Chord( data["matrix"], data["names"], colors=data["colors"], details=data["details"], details_thumbs=data["details_thumbs"], noun="villagers!", thumbs_width=50, curved_labels=True, popup_width=600, bipartite=True, bipartite_idx=data["bipartite_idx"], bipartite_size=0.4, padding=0.0, width=800, data_table_column_width=100, font_size_large="16px", data_table=data["data_table"] ).show()
Plotapi - Chord Diagram
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK