Non-transparent confidence intervals in seaborn

Viewed 1577

Context:
The journal I want to submit my paper to only accepts .tiff (doesn't work with LaTeX), .jpg (not suitable for graphs), and .eps (which doesn't work with alpha transparency, unless I rasterize the image, which leads to huge file sizes). Many of my plots use seaborn's regplot, which plots transparent confidence intervals. Is it possible to plot non-transparent CIs without completely re-doing all of my graphs manually (e.g. as dashed lines or a solid color in the background)?

Example:

import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

sns.set_style("ticks")
np.random.seed(0)
n = 50

fig, ax = plt.subplots(figsize=(8,6))

x = np.random.randn(n)
y1 = np.random.randn(n)
y2 = np.random.randn(n)

sns.regplot(x, y1, ax=ax)
sns.regplot(x, y2, ax=ax)

plt.show()

Example of a regplot with transparent overlapping confidence intervals

What would be the easiest / best way to save this as an .eps file without losing information from the overlapping confidence intervals?

1 Answers
Related