简体   繁体   English

Jupyter 实验室中的子图

[英]subplots in Jupyter lab

I am using Jupyter lab to to work with images and plots.我正在使用 Jupyter 实验室来处理图像和绘图。 First I create a subplot where i want an image and a graph displayed next to each other.首先,我创建了一个子图,我想要一个图像和一个图形并排显示。 The problem is that is graph plot is much larger than the image and I would like them to be the same size.问题是图形比图像大得多,我希望它们的大小相同。 At least I would like the height of the image and the plot to be the same size.至少我希望图像的高度和绘图的大小相同。

import matplotlib.pyplot as plt
fig, (image1, plot1) = plt.subplots(figsize=(fig_height, fig_width), nrows=1, ncols=2, gridspec_kw={'width_ratios': [1, 1]})
plt.ylim(3888,0)
image1.imshow(original_image)
plot1.plot(x_vals, y_vals_left, x_vals, y_vals_right);
plot1.set_aspect(1)

那做的工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM