I am plotting the following image in matplotlib. My problem is that, the image looks good like this, however, I would like to make the background darker, as when I print this image, the grayscale part does not appear in the print. Could someone tell me API to make this change?
I use simple API to plot the 3D curve -
ax.plot(X1, Y1, Z1, '^', c='r')
ax.plot(X2, Y2, Z2, 'o', c='b')
What I also tried is this -
fig = plt.figure(figsize=(10,10))
ax = fig.gca(projection='3d', axisbg='gray')
This changes the color to dark gray, but it is also changing the colour outside the image -
I achieved it by using following code -
ax = fig.add_subplot(111, projection='3d')
plt.gca().patch.set_facecolor('white')
ax.w_xaxis.set_pane_color((0.8, 0.8, 0.8, 1.0))
ax.w_yaxis.set_pane_color((0.8, 0.8, 0.8, 1.0))
ax.w_zaxis.set_pane_color((0.8, 0.8, 0.8, 1.0))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With