plt.figure(figsize=(12, 8), dpi=80) plt.plot(range(1,Nmax2+2), df_temp[-Nmax2-1:]['adj_close'], 'bx-') plt.plot(Nmax2+1, df_temp[-1:]['adj_close'], 'ys-') legend_list = ['adj_close', 'actual_value'] color_list = ['r', 'g', 'k', 'y', 'm', 'c', '0.75'] marker_list = ['x', 'x', 'x', 'x', 'x', 'x', 'x'] regr = LinearRegression(fit_intercept=True)
时间: 2023-08-20 10:24:35 浏览: 41
这段代码是在使用Python中的matplotlib库进行数据可视化,并且使用LinearRegression进行线性回归分析。具体来说,它画出了一个折线图,其中横轴是1到Nmax2+2之间的数字,纵轴是df_temp[-Nmax2-1:]中的adj_close数据。同时,在该图中使用了红色的x标记来表示adj_close,使用黄色的正方形标记来表示实际值。此外,还使用了LinearRegression对数据进行线性拟合。
相关问题
plt.figure(figsize=(10,2))
As an AI language model, I do not have the capability to create figures or graphics. However, I can tell you that the code `plt.figure(figsize=(10,2))` is used in Python to create a new figure with a specific size of 10 inches in width and 2 inches in height. This function is commonly used with the `matplotlib` library for data visualization.
plt.figure(figsize = (8 ,5))
这是一个用于设置 Matplotlib 图形的大小的代码。通过 `plt.figure(figsize=(width, height))` 可以设置图形的尺寸大小,其中 `width` 和 `height` 分别表示图形的宽度和高度,单位为英寸。在这个例子中,图形的宽度为 8 英寸,高度为 5 英寸。通常在绘制图形之前使用该代码来设置图形的大小,以便在保存图像时能够得到所需的尺寸。