Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
Jupyter Docker Stacks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Jupyter Docker Stacks
Commits
f527551a
Commit
f527551a
authored
Sep 25, 2020
by
Mark Dean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add cm-super
parent
612aa571
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
2 deletions
+49
-2
scipy-notebook/Dockerfile
scipy-notebook/Dockerfile
+2
-2
scipy-notebook/test/data/matplotlib_fonts_1.py
scipy-notebook/test/data/matplotlib_fonts_1.py
+20
-0
scipy-notebook/test/test_matplotlib.py
scipy-notebook/test/test_matplotlib.py
+27
-0
No files found.
scipy-notebook/Dockerfile
View file @
f527551a
...
...
@@ -7,9 +7,9 @@ LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
USER
root
# ffmpeg for matplotlib anim & dvipng for latex labels
# ffmpeg for matplotlib anim & dvipng
+cm-super
for latex labels
RUN
apt-get update
&&
\
apt-get
install
-y
--no-install-recommends
ffmpeg dvipng
&&
\
apt-get
install
-y
--no-install-recommends
ffmpeg dvipng
cm-super
&&
\
rm
-rf
/var/lib/apt/lists/
*
USER
$NB_UID
...
...
scipy-notebook/test/data/matplotlib_fonts_1.py
0 → 100644
View file @
f527551a
# Matplotlit: Test tex fonts
import
matplotlib
import
matplotlib.pyplot
as
plt
import
os
matplotlib
.
rcParams
[
'pgf.texsystem'
]
=
'pdflatex'
matplotlib
.
rcParams
.
update
({
'font.family'
:
'serif'
,
'font.size'
:
18
,
'axes.labelsize'
:
20
,
'axes.titlesize'
:
24
,
'figure.titlesize'
:
28
})
matplotlib
.
rcParams
[
'text.usetex'
]
=
True
fig
,
ax
=
plt
.
subplots
(
1
,
1
)
x
=
[
1
,
2
]
y
=
[
1
,
2
]
ax
.
plot
(
x
,
y
,
label
=
'a label'
)
ax
.
legend
(
fontsize
=
15
)
file_path
=
os
.
path
.
join
(
"/tmp"
,
"test_fonts.png"
)
fig
.
savefig
(
file_path
)
print
(
f
"File {file_path} saved"
)
scipy-notebook/test/test_matplotlib.py
View file @
f527551a
...
...
@@ -33,3 +33,30 @@ def test_matplotlib(container):
cmd
=
running_container
.
exec_run
(
command
)
assert
cmd
.
exit_code
==
0
,
f
"Command {command} failed"
LOGGER
.
debug
(
cmd
.
output
.
decode
(
"utf-8"
))
def
test_matplotlib_fonts
(
container
):
"""Test matplotlib latex fonts, which depend on the cm-super package"""
host_data_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
"data"
)
cont_data_dir
=
"/home/jovyan/data"
test_file
=
"matplotlib_fonts_1.py"
output_dir
=
"/tmp"
LOGGER
.
info
(
f
"Test cm-super latex labels in matplotlib ..."
)
command
=
"sleep infinity"
running_container
=
container
.
run
(
volumes
=
{
host_data_dir
:
{
"bind"
:
cont_data_dir
,
"mode"
:
"ro"
}},
tty
=
True
,
command
=
[
"start.sh"
,
"bash"
,
"-c"
,
command
],
)
command
=
f
"python {cont_data_dir}/{test_file}"
cmd
=
running_container
.
exec_run
(
command
)
assert
cmd
.
exit_code
==
0
,
f
"Command {command} failed"
LOGGER
.
debug
(
cmd
.
output
.
decode
(
"utf-8"
))
# Checking if the file is generated
# https://stackoverflow.com/a/15895594/4413446
expected_file
=
f
"{output_dir}/test_fonts.png"
command
=
f
"test -s {expected_file}"
cmd
=
running_container
.
exec_run
(
command
)
assert
cmd
.
exit_code
==
0
,
f
"Command {command} failed"
LOGGER
.
debug
(
cmd
.
output
.
decode
(
"utf-8"
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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