Commit 66a0d457 authored by ulrich_y's avatar ulrich_y
Browse files

Fixed transparency issue in eps

parent 87144c93
......@@ -25,3 +25,17 @@ orderscheme = {
mathcolour = "#00009c"
defcol = ['C%d' % i for i in range(10)]
def alpha_composite(bg, fg, alpha):
import matplotlib.colors
def hex2rgb(h):
h = h.lstrip("#")
return tuple(int(h[i:i+2], 16)/255. for i in (0, 2, 4))
bg = hex2rgb(matplotlib.colors.to_hex(bg))
fg = hex2rgb(matplotlib.colors.to_hex(fg))
return "#%02x%02x%02x" % (
255.*((1-alpha) * bg[0] + alpha * fg[0]),
255.*((1-alpha) * bg[1] + alpha * fg[1]),
255.*((1-alpha) * bg[2] + alpha * fg[2])
)
......@@ -4,6 +4,7 @@ import scipy.stats
import matplotlib.pyplot as plt
import numpy as np
from .errortools import *
from .colours import alpha_composite
def myfit(data, n):
......@@ -169,7 +170,7 @@ def mergefkswithplot(sets, scale=1., showfit=[True,True], xlim=[-7, 0]):
ax2.fill_between(
band[:,0],
band[:,2]/norm-1, band[:,3]/norm-1,
alpha=0.1, color='C0'
color=alpha_composite('white', 'C0', 0.1)
)
ax2.errorbar(
tot0[:,0], tot0[:,1], tot0[:,2],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment