本文介绍了如何使用macOS在matplotlib python上最大化自己的身材?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

fig, ax = plt.subplots(figsize=(16,8),dpi=100,subplot_kwn {'projection':nccrs.PlateCarree()})
ax.set_global()
plt.subplots_adjust(left=0.04, bottom=0.02, right=0.96, top=0.96)  

# set a figure window's title
fig2 = plt.gcf()
fig2.canvas.set_window_title('Metheoros 1.0')
 mng = plt.get_current_fig_manager()
 mng.Maximize(True)

我尝试过这个,但是在Mac上不起作用

I Tried this, but didn't work on mac

推荐答案

# -*- coding: UTF-8 -*-    
'''
Created on 4 de set de 2016

@author: VladimirCostadeAlencar
'''

from numpy import arange, sin, pi
import matplotlib
matplotlib.use('WXAgg')

from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.figure import Figure

import wx

class CanvasPanel(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
        self.figure = Figure()
        self.axes = self.figure.add_subplot(111)
        self.canvas = FigureCanvas(self, 0, self.figure)
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
        self.SetSizer(self.sizer)
        self.Fit()


    def draw(self):
        from ler_csv import ler_csv
        from plotar_csv04 import plotar_pontos
        nomearq = 'gps01.csv'  
        print 'Reading points...'
        coords = ler_csv(nomearq)
        figure, ax = plotar_pontos(self, coords)
        print 'Plotting on Wx...'
        self.canvas = FigureCanvas(self, 0, figure)


if __name__ == "__main__":
    app = wx.PySimpleApp()
    fr = wx.Frame(None, title='Metheoros v1.0 - 2016')
    panel = CanvasPanel(fr)
    panel.draw()
    fr.Maximize(True)
    fr.Show()
    app.MainLoop()

这篇关于如何使用macOS在matplotlib python上最大化自己的身材?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 14:36