python窗口代码大小_python-Matplotlib窗口大小,标题等

本文介绍了一位新手在使用Python和matplotlib创建图形时遇到的问题,即无法在Tkinter GUI中改变matplotlib图形窗口的大小。通过提供一个包含bar图的代码示例,作者展示了如何创建图形,但寻求帮助以解决窗口尺寸调整的问题。尝试使用`figure(figsize=(8, 6))`并未成功,因为这只会创建新的窗口而不是改变已有窗口的尺寸。" 124085158,11660155,MySQL备份与恢复策略详解,"['数据库管理', 'MySQL', '数据安全', '备份策略', '恢复操作']
摘要由CSDN通过智能技术生成

我是python和matplotlib的新手.我有一个项目,我需要在Tkinter GUI中使用matplotlib创建图形.我找到并使用了以下代码:

import numpy as np

import matplotlib.pyplot as plt

N = 5

menMeans = (20, 35, 30, 35, 27)

menStd = (2, 3, 4, 1, 2)

ind = np.arange(N) # the x locations for the groups

width = 0.35 # the width of the bars

fig, ax = plt.subplots()

rects1 = ax.bar(ind, menMeans, width, color='r', yerr=menStd)

womenMeans = (25, 32, 34, 20, 25)

womenStd = (3, 5, 2, 3, 3)

rects2 = ax.bar(ind+width, womenMeans, width, color='y', yerr=womenStd)

ax.set_ylabel('Scores')

ax.set_title('Scores by group and gender')

ax.set_xticks(ind+width)

ax.set_xticklabels( ('G1', 'G2', 'G3', 'G4', 'G5') )

ax.legend( (rects1[0], re

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值