If you want to quote a value and a plus/minus uncertainty range in HTML, using the <sup>
and <sub>
tags leaves the values offset, e.g.:
2.3<sup>+1.2</sup><sub>-0.5</sub>
gives:
import numpy as np | |
from matplotlib import pyplot as plt | |
from matplotlib.patches import Rectangle | |
fig, ax = plt.subplots() | |
def draw_2x2_grid(ax, xy, bwidth=0.25, bheight=0.25, numbers=[]): | |
for i in range(2): |
In answer to this StackOverflow question, here is a method (based heavily on this answer) to create a violin plot with a gradient colour fill based on the density of the samples (i.e., width of the violin):
from matplotlib import pyplot as plt
from matplotlib.path import Path
from matplotlib.patches import PathPatch
import matplotlib as mpl