VScode中使用Python绘图无法显示
win10VScodeA possible solution:1.press "setting"--->2.input "terminal.integrated:inherit env" in the searching box; then check the dialog box3. an example for testingimport numpy as npimport pandas
·
win10
VScode
A possible solution:
1.press "setting"--->
2.input "terminal.integrated:inherit env" in the searching box; then check the dialog box
3. an example for testing
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# 折线
x_1 = [2011,2012,2013,2014,2015,2016,2017]
y_1 = [58000,60200,63000,71000,84000,90500,107000]
y_2 = [52000,54200,51500,58300,56800,59500,62700]
# 条形图
bar_x = ['a','b','c','d']
bar_y = [20, 10, 30, 25]
# 直方图
s = np.random.randn(500)
figure,axes = plt.subplots(nrows=1,ncols=2,figsize=(10,5))
axes[0].plot(x_1,y_1)
axes[1].bar(bar_x,bar_y)
plt.show()
更多推荐
已为社区贡献1条内容
所有评论(0)