Star-Plot

Sat 17 May 2025

import numpy as np
import matplotlib.pyplot as plt


x = np.random.rand(10)
y = np.random.rand(10)
z = np.sqrt(x**2 + y**2)

plt.subplot(111)
plt.scatter(x, y, s=500, c=z, marker=">")

plt.show()


Score: 0

Category: barchart

Read More

Treemap-1

Sat 17 May 2025
# http://scipy-cookbook.readthedocs.io/items/Matplotlib_TreeMap.html
# http://hcil.cs.umd.edu/trs/91-03/91-03.html
import pylab
from matplotlib.patches import Rectangle
from functools import reduce

class Treemap:
    def __init__(self, tree, iter_method, size_method, color_method):
        """create a tree map from tree, using itermethod(node) to walk tree,
        size_method(node …

Category: barchart

Read More

Treemap-2

Sat 17 May 2025
import pylab
from matplotlib.patches import Rectangle
from functools import reduce

class Treemap:
    def __init__(self, tree, iter_method, size_method, color_method):
        """create a tree map from tree, using itermethod(node) to walk tree,
        size_method(node) to get object size and color_method(node) to get its
        color"""

        self.ax = pylab.subplot(111 …

Category: barchart

Read More

Treemap-Squarify-1

Sat 17 May 2025

#!pip install squarify
import squarify

# these values define the coordinate system for the returned rectangles
# the values will range from x to x + width and y to y + height
x = 0.
y = 0.
width = 700.
height = 433.

values = [500, 433, 78, 25, 25, 7]

# values must be sorted descending (and …

Category: barchart

Read More

Two-Bars-2343

Sat 17 May 2025

import numpy as np
import matplotlib.pyplot as plt

N = 5
menMeans = (20, 35, 30, 35, 27)
menStd = (2, 3, 4, 1, 2)

ind = np.arange(N)  # the x locations for the groups
width = 0.35       # the width of the bars

fig, ax = plt.subplots()
rects1 = ax.bar(ind, menMeans …

Category: barchart

Read More

Two-Bars-Mob

Sat 17 May 2025


import numpy as np
import matplotlib.pyplot as plt


menMeans = (154, 138, 161, 181, 151, 162, 156, 188, 145, 153, 124, 144);
N = len(menMeans);


print(type(menMeans));

ind = np.arange(N)  # the x locations for the groups
width = 0.35       # the width of the bars

fig, ax = plt.subplots …

Category: barchart

Read More

Values-On-Top

Sat 17 May 2025


import numpy as np
import matplotlib.pyplot as plt


data = [[  66386,  174296,   75131,  577908,   32015],
        [  58230,  381139,   78045,   99308,  160454],
        [  89135,   80552,  152558,  497981,  603535],
        [  78415,   81858,  150656,  193263,   69638],
        [ 139361,  331509,  343164,  781380,   52269]]

columns = ('Freeze', 'Wind', 'Flood', 'Quake', 'Hail')
rows = ['%d year' % x for x in (100, 50 …

Category: barchart

Read More
Page 2 of 2

« Prev