mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-12 20:42:57 +00:00
Replace os with pathlib where paths are used (#1984)
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
# Matplotlib: Create a simple plot example.
|
||||
# Refs: https://matplotlib.org/stable/gallery/lines_bars_and_markers/simple_plot.html
|
||||
|
||||
import os
|
||||
|
||||
# Optional test with [Matplotlib Jupyter Integration](https://github.com/matplotlib/ipympl)
|
||||
# %matplotlib widget
|
||||
import matplotlib.pyplot as plt
|
||||
@@ -21,7 +19,8 @@ ax.set(
|
||||
title="About as simple as it gets, folks",
|
||||
)
|
||||
ax.grid()
|
||||
|
||||
# Note that the test can be run headless by checking if an image is produced
|
||||
file_path = os.path.join("/tmp", "test.png")
|
||||
file_path = "/tmp/test.png"
|
||||
fig.savefig(file_path)
|
||||
print(f"File {file_path} saved")
|
||||
|
@@ -1,6 +1,4 @@
|
||||
# Matplotlib: Test tex fonts
|
||||
import os
|
||||
|
||||
import matplotlib
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
@@ -22,6 +20,6 @@ y = [1, 2]
|
||||
ax.plot(x, y, label="a label")
|
||||
ax.legend(fontsize=15)
|
||||
|
||||
file_path = os.path.join("/tmp", "test_fonts.png")
|
||||
file_path = "/tmp/test_fonts.png"
|
||||
fig.savefig(file_path)
|
||||
print(f"File {file_path} saved")
|
||||
|
Reference in New Issue
Block a user