Commit ba8352b8 authored by Blaise Li's avatar Blaise Li
Browse files

Testing usage of tex formatting.

parent 96bef359
......@@ -15,7 +15,20 @@ import pandas as pd
from scipy.stats.stats import pearsonr, linregress
# To compute geometric mean
from scipy.stats.mstats import gmean
import matplotlib as mpl
import matplotlib.pyplot as plt
# https://stackoverflow.com/a/42768093/1878788
from matplotlib.backends.backend_pgf import FigureCanvasPgf
mpl.backend_bases.register_backend('pdf', FigureCanvasPgf)
TEX_PARAMS = {
"text.usetex": True, # use LaTeX to write all text
"pgf.rcfonts": False, # Ignore Matplotlibrc
"pgf.texsystem": "lualatex", # hoping to avoid memory issues
"pgf.preamble": [
r'\usepackage{color}' # xcolor for colours
]
}
mpl.rcParams.update(TEX_PARAMS)
import seaborn as sns
from rpy2.robjects import r, pandas2ri, Formula, StrVector
as_df = r("as.data.frame")
......@@ -476,6 +489,7 @@ def plot_scatter(data,
y_range=None,
axes_style=None):
fig, ax = plt.subplots()
# ax.set_adjustable('box')
# First plot the data in grey
data.plot.scatter(
x=x_column, y=y_column,
......
Supports Markdown
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