Questions tagged [squarify]

A Python implementation of the squarify treemap layout algorithm. Use together with the relevant python tag.

A treemapping Python library built on .

References:

16 questions
7
votes
1 answer

Squarify - Auto resize label in treemap

I'm implementing a simple treemap in Python using Squarify. I'm plotting the artist name with it's percentage of streams in the considered song chart, the bigger/darker the square, the higher is the value. My code is the following: dataGoals =…
Mattia Surricchio
  • 1,362
  • 2
  • 21
  • 49
6
votes
1 answer

How to add % information on a treemap?

I am plotting a treemap and was wondering how to also plot the relative percentage of a tree class, i.e. Group A =100 Groun B =30 Groun C =50 Groun D =20 Then, in the plot, it should add: '50%' for Group A '15%' for Group B etc. next to its 'Group…
LaLaTi
  • 1,455
  • 3
  • 18
  • 31
3
votes
1 answer

Set font and wrap-text in Squarify

In Matplotlib, I can plot a wrapped-text inside a box by ax.text(x_coord, y_coord, string, bbox = dict(boxstyle='round'), wrap = True, fontproperties = FontProperties_object) I can also set the font type through…
user9885031
1
vote
1 answer

How do you make the font size of Squarify label proportionate to the size of the square?

I'm trying to make a treemap with squarify with some squares much bigger than the others. title counts labels A 100 A - 100 B 30 B - 30 C 25 C - 25 D 2 D - 2 E 2 E - 2 F 2 F - 2 G 2 G - 2 fig, ax = plt.subplots(1,…
1
vote
1 answer

How to add a % symbol on a Squarify treemap

I'm trying to plot a treemap with Squarify. But i don't realize how could i add a "%" to a float value. ListaCryptos = ['BTC', 'ETH'] tamaños2 = [61,755, 32,992] sq.plot(sizes=np.around(tamaños2, decimals=2), label=ListaCryptos, …
1
vote
1 answer

Show multiple columns values on labels with squarify.plot

I have a dataframe that I'd like to plot a tree map with squarify. I'd like to show the country_name and counts on the chart by editing the labels parameter but it seems only taking one value. Example data import squarify import pandas as pd from…
Osca
  • 1,588
  • 2
  • 20
  • 41
1
vote
1 answer

Treemap - Change Fonts

So I have the following code that generates a tree map in Matplotlib. Wondering if it's possible to have the first line emboldened and a larger font size . So: Emboldened and larger: 0: Smaller and no emboldening: 480 import matplotlib.pyplot…
dipl0
  • 1,017
  • 2
  • 13
  • 36
1
vote
1 answer

Squarify treemap — How to add legend for rectangles that are too small?

My treemap has a rectangle that's too small to fit its label, so I need to move the labels out of the treemap into a legend. I'm using norm_x because I'm trying to simulate a thermometer-style plot. Here's a look at the code and the awkward…
semblable
  • 773
  • 1
  • 8
  • 26
1
vote
2 answers

How to add a subplot to each rectangle in a Tree Map?

I created this tree map using Matplotlib and Squarify: Now I would like to add a line plot on each rectangle in the tree map. Is that possible?
drkyeh
  • 15
  • 1
  • 6
1
vote
1 answer

How to get coordinates of shape in matplotlib treemap?

I have working treemap, and I need to get coordinates of each shape of this treemap to, for example put them in GeoJSON after that. Is there any function to help me with that, or I'll be getting all the coordinates from svg version of this treemap?
0
votes
1 answer

Moving labels on a treemap Matplotlib squarify

I have a treemap that has small enough sections that the labels overlap. Is there any way to move the labels for sections under size=4 (or something around that) to either outside of the plot with an arrow pointing to it, or into a small legend only…
Cole MG
  • 317
  • 2
  • 13
0
votes
1 answer

Squarify — How to adjust treemap rectangle shapes

I can't find a way in Squarify's documentation to edit the shapes of the rectangles inside the treeplot. I want to show one of the rectangles as a square subset of one of the other rectangles. This is what I have currently: import squarify from…
semblable
  • 773
  • 1
  • 8
  • 26
0
votes
0 answers

AttributeError: module 'squarify' has no attribute 'plot'

A piece of code to create a treemap which worked before does not work any longer. I am using Spyder IDE which I installed together with Anaconda. import matplotlib.pyplot as plt import squarify squarify.plot( sizes=[13,22,35,5], …
Stücke
  • 868
  • 3
  • 14
  • 41
0
votes
1 answer

Matplotlib Hover Text

I created this tree map using Matplotlib and Squarify. Is there a way to display information about each axes when the mouse hovers over the axis?
0
votes
1 answer

module squarify on Juypter notebook error

I'm trying to create a treemap chart on juypter notebooks but somehow it isn't able to find the module. I've already installed it in bash with 'pip install squarify' as well as using python by 'import squarify' there isn't any issues but when I try…
Skydance
  • 23
  • 6
1
2