benchmarks.wiki / Public workspace

DS-1000 / 558 / import matplotlib.pyplot as plt

Problem

Answer published by the source. Consult the official source to check your work against its answer.

prompt

import matplotlib.pyplot as plt fig, axes = plt.subplots(ncols=2, nrows=2, figsize=(8, 6)) axes = axes.flatten() for ax in axes: ax.set_ylabel(r"ln(xa−xbxa−xc)\ln\left(\frac{x_a-x_b}{x_a-x_c}\right)") ax.set_xlabel(r"ln(xa−xdxa−xe)\ln\left(\frac{x_a-x_d}{x_a-x_e}\right)") plt.show() plt.clf() # Copy the previous plot but adjust the subplot padding to have enough space to display axis labels # SOLUTION START
Plain-text mathematical notation (without MathML)
import matplotlib.pyplot as plt

fig, axes = plt.subplots(ncols=2, nrows=2, figsize=(8, 6))
axes = axes.flatten()

for ax in axes:
    ax.set_ylabel(r"ln((x_(a)−x_(b))/(x_(a)−x_(c)))")
    ax.set_xlabel(r"ln((x_(a)−x_(d))/(x_(a)−x_(e)))")

plt.show()
plt.clf()

# Copy the previous plot but adjust the subplot padding to have enough space to display axis labels
# SOLUTION START
Original LaTeX notation
import matplotlib.pyplot as plt

fig, axes = plt.subplots(ncols=2, nrows=2, figsize=(8, 6))
axes = axes.flatten()

for ax in axes:
    ax.set_ylabel(r"$\ln\left(\frac{x_a-x_b}{x_a-x_c}\right)$")
    ax.set_xlabel(r"$\ln\left(\frac{x_a-x_d}{x_a-x_e}\right)$")

plt.show()
plt.clf()

# Copy the previous plot but adjust the subplot padding to have enough space to display axis labels
# SOLUTION START

library

Matplotlib

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import