Unanswered
Hi Everyone. For Some Reason, I Could Not Display My Matplotlib Plots (With Subplots) In Trains, While They Can Be Displayed Locally. Here Is An Example Plotting Function Which Could Not Show On Trains. It Would Be Really Helpful If Someone Could Check Th
EagerStork23 However, the issue is only in the presentation of the graph (occurs when all subplots have the same label), so you can use the following workaround for solving it:
` import matplotlib.pyplot as plt
def plot_subplots():
fig = plt.figure()
ax1 = fig.add_subplot(2, 2, 1)
ax2 = fig.add_subplot(2, 2, 2)
ax3 = fig.add_subplot(2, 2, 3)
ax4 = fig.add_subplot(2, 2, 4)
x = range(10)
y = range(10)
ax1.plot(x, y)[0].set_label("label1")
ax2.plot(x, y)[0].set_label("label2")
ax3.plot(x, y)[0].set_label("label3")
ax4.plot(x, y)[0].set_label("label4")
fig.show() `
180 Views
0
Answers
4 years ago
one year ago