Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Blaise LI
libhts
Commits
ba8352b8
Commit
ba8352b8
authored
Mar 05, 2018
by
Blaise Li
Browse files
Testing usage of tex formatting.
parent
96bef359
Changes
1
Hide whitespace changes
Inline
Side-by-side
libhts/libhts.py
View file @
ba8352b8
...
...
@@ -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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment