Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Python matplotlib 3D surface | How to resize viewport?

$
0
0

I want to resize viewport to same width with fig size or change viewport shape from a square to a rectangle.

[python code]

fig = plt.figure(figsize=(10,4))fig.patch.set_facecolor('#151C2C')ax = fig.add_subplot(111, projection='3d')plt.subplots_adjust(left=0, bottom=0, right=1, top=1)x = np.linspace(0, y1.shape[1], y1.shape[1])y = np.linspace(0, y1.shape[0], y1.shape[0])xv, yv = np.meshgrid(x, y)surf = ax.plot_surface(xv, yv, np.log10(y1),cmap='jet')ax.axis('scaled')ax.set_box_aspect([3, 1, 1])

[Screen Capture]

enter image description here

I find subplots_adjust() but i cna't resize viewport width.and set_box_aspect() is just resize plot shape in viewport, not a viewport


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>