File:Humidex plot (20-50°C).svg

Summary

Description
English: Alternate humidex plot based on File:Humidex plot.svg with an extended temperature range of 20 to 50°C
Date
Source Own work
Author Morn
Other versions
SVG development
InfoField
Source code
InfoField

Python code

Source code
#!/usr/bin/env python

# Plot Humidex graph with Matplotlib

from pylab import *

figure(figsize = (10, 9))
tt = range(20, 51)

def humidex(t, r):
    "Calculate Humidex value for T (°C) and RH (%)"

    # https://en.wikipedia.org/wiki/Dew_point
    b = 17.67
    c = 243.5
    gamma = log(r / 100) + (b * t) / (c + t)
    t_dew = c * gamma / (b - gamma)

    # https://en.wikipedia.org/wiki/Humidex
    hh = 5417.753 * (1 / 273.16 - 1 / (273.15 + t_dew))
    h = t + .5555 * (6.11 * exp(hh) - 10)
    return round(h)

for r in range(100, 0, -10):
    plot(tt, [humidex(t, r) for t in tt], label = "RH = %u%%" % r,
        lw = 1.5, ls = "dashed", marker = "o")

legend()
fill_between(tt, 19.5, 29.5, color = "#0f0", alpha = .3)
fill_between(tt, 29.5, 39.5, color = "#ff0", alpha = .3)
fill_between(tt, 39.5, 45.5, color = "#f80", alpha = .3)
fill_between(tt, 45.5, 200,  color = "#f00", alpha = .3)

xticks(range(100))
yticks(range(150))
axis([20, 50, 20, 60])
xlabel("T [°C]")
ylabel("Humidex")
title("Humidex based on temperature and relative humidity")
grid()
savefig("humidex_plot_20-50.svg")

show()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Category:CC-Zero#Humidex%20plot%20(20-50°C).svg
Category:Self-published work Category:Humidex
Category:CC-Zero Category:Humidex Category:Self-published work Category:Valid SVG created with Matplotlib code