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
96de6c71
Commit
96de6c71
authored
Mar 06, 2018
by
Blaise Li
Browse files
Fixing tex issues in boxplots.
parent
ba8352b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
libhts/libhts.py
View file @
96de6c71
from
functools
import
reduce
from
re
import
sub
import
warnings
...
...
@@ -346,6 +347,10 @@ def plot_counts_distribution(data, xlabel):
def
plot_boxplots
(
data
,
ylabel
):
fig
=
plt
.
figure
(
figsize
=
(
6
,
12
))
axis
=
fig
.
add_subplot
(
111
)
usetex
=
mpl
.
rcParams
.
get
(
"text.usetex"
,
False
)
if
usetex
:
ylabel
=
sub
(
"_"
,
r
"\_"
,
ylabel
)
data
.
columns
=
[
sub
(
"_"
,
"\_"
,
colname
)
for
colname
in
data
.
columns
]
data
.
plot
.
box
(
ax
=
axis
)
axis
.
set_ylabel
(
ylabel
)
for
label
in
axis
.
get_xticklabels
():
...
...
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