can't show figure inside panel in app wxpython4

hi ,

i have my app when i click button to select netcdf4 my file netcdf have a variable named IR when i show the variable in panel the figure is show in other panel out of panel

how can i fixe this problem cause i need to show my figure in the same panel !?

that my code and that result :

import wx
import numpy as np
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.figure import Figure
import os
import netCDF4
from netCDF4 import Dataset
import matplotlib.pyplot as plt

class Window(wx.Frame):
“”" principal “”"

def __init__(self, **kwargs):
    super().__init__(None, **kwargs)
    RootPanel(self)

class RootPanel(wx.Panel):
“”" Panel for widgets app “”"

def __init__(self, parent):
    super().__init__(parent)

    panel_buttons = wx.Panel(self)
    panel_buttons_sizer = wx.GridSizer(1, 2, 0, 0)

    canvas_panel = CanvasPanel(self)

    select_button = PickButton(
        panel_buttons,
        "netCDF4 files (nc)|*.nc",
        canvas_panel.load_from_file,
        label="Show on this window (nc)",
    )
    toplevel_select_button = TopLevelPickButton(
        panel_buttons,
        "Text files (txt)|*.txt|All files|*.*",
        label="Show on separate window (txt)",
    )
    panel_buttons_sizer.Add(select_button)
    panel_buttons_sizer.Add(toplevel_select_button)
    panel_buttons.SetSizer(panel_buttons_sizer)

    sizer = wx.BoxSizer(wx.VERTICAL)
    sizer.Add(panel_buttons)
    sizer.Add(canvas_panel)
    self.SetSizerAndFit(sizer)

class PickButton(wx.Button):
“”" Bouton choose file “”"

def __init__(self, parent, wildcard, func, **kwargs):
    # func for choosing file
    super().__init__(parent, **kwargs)
    self.wildcard = wildcard
    self.func = func
    self.Bind(wx.EVT_BUTTON, self.pick_file)

def pick_file(self, evt):
    style = style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE
    with wx.FileDialog(
        self, "Pick files", wildcard=self.wildcard, style=style
    ) as fileDialog:
        if fileDialog.ShowModal() != wx.ID_CANCEL:
            chosen_file = fileDialog.GetPath()
            self.func(chosen_file)

class TopLevelPickButton(PickButton):
“”" to choose and open toplevel “”"

def __init__(self, parent, wildcard, **kwargs):
    super().__init__(parent, wildcard, self.create_toplevel, **kwargs)

def create_toplevel(self, file_name):
    """ open toplevel and show  figure """
    self.win = TopLevelCanvas(self.Parent)
    self.win.canvas_panel.load_from_file(file_name)
    self.win.Show()

class CanvasPanel(wx.Panel):
“”" Panel matplotlib “”"

def __init__(self, parent):
    super().__init__(parent)
    self.figure = Figure()
    self.canvas = FigureCanvas(self, -1, self.figure)
    self.Size = self.canvas.Size

def load_from_file(self, file_name):

   
    self.axes = self.figure.add_subplot(111)
    self.axes = self.figure.add_axes([0,0,1,1])
    if file_name.endswith(".nc"):
        self._load_nc(file_name)
    else:
        self._load_txt(file_name)
    self.canvas.draw()

def _load_nc(self, file_name):
    """ open and show  file netCDF4 """
    path='`/home/2019/03/25/Mmul_201903250000.nc`'

    nc = netCDF4.Dataset('/home/2019/03/25/Mmul_201903250000.nc')
    IR=nc.variables['IR_'][:]

#Affichage de la variable

    plt.pcolormesh(IR)
    plt.colorbar()
    plt.show()

   
def _load_txt(self, file_name):
    """ open and show  txt """

class TopLevelCanvas(wx.Frame):
“”" panel for show graph matplotlib “”"

def __init__(self, parent, **kwargs):
    super().__init__(parent, **kwargs)
    self.canvas_panel = CanvasPanel(self)
    self.Size = self.canvas_panel.Size

class App(wx.App):
def OnInit(self):
win = Window(title=“A test dialog”, size=(800, 600))
win.Show()
return True

if name == “main”:
app = App()
app.MainLoop()

``

how can i read file netcdf4 and show it in my app not out app

thank u for help

čt 4. 4. 2019 v 17:08 odesílatel Maj <majdaelyacouby1990@gmail.com> napsal:

hi ,

i have my app when i click button to select netcdf4 my file netcdf have a variable named IR when i show the variable in panel the figure is show in other panel out of panel

how can i fixe this problem cause i need to show my figure in the same panel !?

that my code and that result :

...
Hi,
maybe someone with experience regarding netCDF4 and mtplotlib will
give a more detailed answer, but maybe just some hints, as I can't
follow the code completely and cannot test it due to dependencies,

These imports are meant for embedded figures which seems to be the
desired behaviour

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

...
however the following is used as a standalone tool for quickly
displaying the plots in an implicitly handled matplotlib frame

import matplotlib.pyplot as plt

...

the plotting is then directed to that standolone pyplot frame via plt...:

class CanvasPanel(wx.Panel):

...

    def _load_nc(self, file_name):

...

#Affichage de la variable

        plt.pcolormesh(IR)
        plt.colorbar()
        plt.show()

...

how can i read file netcdf4 and show it in my app not out app

thank u for help

You may check the embedding examples in matplotlib gallery:
https://matplotlib.org/gallery/#embedding-matplotlib-in-graphical-user-interfaces

e.g.
https://matplotlib.org/gallery/user_interfaces/embedding_in_wx2_sgskip.html#sphx-glr-gallery-user-interfaces-embedding-in-wx2-sgskip-py
or others regarding wx

For a quick test, if I replace the above drawing code - lines:
        plt.pcolormesh(IR)
        plt.colorbar()
        plt.show()

with dummy line plots like:

        self.axes.plot(range(8) )
        self.axes.plot(range(0,17, 2) )
        self.figure.canvas.draw()

the lines are plotted to the figure canvas in the frame itself.

hth,
  vbr

Maj wrote:

i have my app when i click button to select netcdf4 my file netcdf have a variable named IR when i show the variable in panel the figure is show in other panel out of panel

how can i fixe this problem cause i need to show my figure in the same panel !?

As Vlastimil said, you need to use the FigureCanvasWxAgg class from matplotlib.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

hi, Vlastimil thanks for answer , but i hve question when u said :

For a quick test, if I replace the above drawing code - lines:

    plt.pcolormesh(IR)

    plt.colorbar()

    plt.show()

with dummy line plots like:

    self.axes.plot(range(8) )

    self.axes.plot(range(0,17, 2) )

    self.figure.canvas.draw()

wht u mean range(8) what is range cause i have IR like variable ? the problem i can plot the variable but outside application

thanks

Le jeu. 4 avr. 2019 à 18:50, Tim Roberts timr@probo.com a écrit :

···

Maj wrote:

i have my app when i click button to select netcdf4 my file netcdf

have a variable named IR when i show the variable in panel the figure

is show in other panel out of panel

how can i fixe this problem cause i need to show my figure in the same

panel !?

As Vlastimil said, you need to use the FigureCanvasWxAgg class from

matplotlib.

https://stackoverflow.com/questions/10737459/embedding-a-matplotlib-figure-inside-a-wxpython-panel

Tim Roberts, timr@probo.com

Providenza & Boekelheide, Inc.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

út 9. 4. 2019 v 8:54 odesílatel Majda El yacouby
<majdaelyacouby1990@gmail.com> napsal:

hi, Vlastimil thanks for answer , but i hve question when u said :

For a quick test, if I replace the above drawing code - lines:
        plt.pcolormesh(IR)
        plt.colorbar()
        plt.show()

with dummy line plots like:

        self.axes.plot(range(8) )
        self.axes.plot(range(0,17, 2) )
        self.figure.canvas.draw()

wht u mean range(8) what is range cause i have IR like variable ? the problem i can plot the variable but outside application
thanks

Maj wrote:
>
> i have my app when i click button to select netcdf4 my file netcdf
> have a variable named IR when i show the variable in panel the figure
> is show in other panel out of panel
>
> how can i fixe this problem cause i need to show my figure in the same
> panel !?

As Vlastimil said, you need to use the FigureCanvasWxAgg class from
matplotlib.

python - Embedding a matplotlib figure inside a WxPython panel - Stack Overflow

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Hi,
both plots are just simple lines to test, whether the plot is
displayed correctly - I don't have access to your input data and the
other libraries to process it - hence the title "dummy line plots"
in your case, the following might work, but I can't test it easily:
         self.axes.pcolormesh(IR)
         self.figure.canvas.draw()

Assuming, IR contains the appropriate data for pccolormesh.

I have only briefly checked that using a part of the demo:
https://matplotlib.org/gallery/images_contours_and_fields/quadmesh_demo.html#sphx-glr-gallery-images-contours-and-fields-quadmesh-demo-py
to insert some demo data for your original plotting code (instead of
the former test code: self.axes.plot(range(8) ):

···

Le jeu. 4 avr. 2019 à 18:50, Tim Roberts <timr@probo.com> a écrit :

===
        n = 12
        x = np.linspace(-1.5, 1.5, n)
        y = np.linspace(-1.5, 1.5, n * 2)
        X, Y = np.meshgrid(x, y)
        Qx = np.cos(Y) - np.cos(X)
        Qz = np.sin(Y) + np.sin(X)
        Z = np.sqrt(X**2 + Y**2) / 5
        Z = (Z - Z.min()) / (Z.max() - Z.min())

        Zm = np.ma.masked_where(np.abs(Qz) < 0.5 * np.max(Qz), Z)

        self.axes.pcolormesh(Qx, Qz, Z, shading='gouraud')
        self.figure.canvas.draw()

===
hth,
  vbr

Majda,

hi, Vlastimil thanks for answer , but i hve question when u said :

For a quick test, if I replace the above drawing code - lines:
plt.pcolormesh(IR)
plt.colorbar()
plt.show()

with dummy line plots like:

    self.axes.plot(range(8) )
    self.axes.plot(range(0,17, 2) )
    self.figure.canvas.draw()

wht u mean range(8) what is range cause i have IR like variable ? the problem i can plot the variable but outside application

thanks

It appears that the trouble you are having is mostly about how to embed matplotib figures in wxPython apps. If so, you might find wxmplot (https://github.com/newville/wxmplot/) helpful, at the very least to read its code and some of its examples. Wxmplot provides a wrapping of matplotlib for wx that includes many added features, like setting up zooming and copying, as well as widgets for customizing the plot or image.

For 2d data, such as used by pcolormesh, you might want to embed a wxmplot.ImagePanel, perhaps replacing or modifying your CanvasPanel to do something like:

self.image_panel = wxmplot.ImagePanel(self)

and then when you have the data array in you IR variable just do

self.image_panel.display(IR)

You also might want to consider using wxmplot.ImageFrame instead of wxmplot.ImagePanel. That will create a new wx.Frame that would then show the image and a few widgets and menus to modify how it is displayed (color table, contrast, smoothing, contours) after the image is shown.

Or, you can read the code for wxmplot.ImageFrame as an example for how that layout is done.

Hope that helps,

–Matt

···

On Tue, Apr 9, 2019 at 1:54 AM Majda El yacouby majdaelyacouby1990@gmail.com wrote:

hi, Vlastimil thanks for answer

ïwill test the code again , that m’y data netcdf exemple :
air.departure.sig995.2012.nc

Le mar. 9 avr. 2019 à 13:39, Matt Newville newville@cars.uchicago.edu a écrit :

···

Majda,

On Tue, Apr 9, 2019 at 1:54 AM Majda El yacouby majdaelyacouby1990@gmail.com wrote:

hi, Vlastimil thanks for answer , but i hve question when u said :

For a quick test, if I replace the above drawing code - lines:
plt.pcolormesh(IR)
plt.colorbar()
plt.show()

with dummy line plots like:

    self.axes.plot(range(8) )
    self.axes.plot(range(0,17, 2) )
    self.figure.canvas.draw()

wht u mean range(8) what is range cause i have IR like variable ? the problem i can plot the variable but outside application

thanks

It appears that the trouble you are having is mostly about how to embed matplotib figures in wxPython apps. If so, you might find wxmplot (https://github.com/newville/wxmplot/) helpful, at the very least to read its code and some of its examples. Wxmplot provides a wrapping of matplotlib for wx that includes many added features, like setting up zooming and copying, as well as widgets for customizing the plot or image.

For 2d data, such as used by pcolormesh, you might want to embed a wxmplot.ImagePanel, perhaps replacing or modifying your CanvasPanel to do something like:

self.image_panel = wxmplot.ImagePanel(self)

and then when you have the data array in you IR variable just do

self.image_panel.display(IR)

You also might want to consider using wxmplot.ImageFrame instead of wxmplot.ImagePanel. That will create a new wx.Frame that would then show the image and a few widgets and menus to modify how it is displayed (color table, contrast, smoothing, contours) after the image is shown.

Or, you can read the code for wxmplot.ImageFrame as an example for how that layout is done.

Hope that helps,

–Matt

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

hi, Vlastimil

ï change the lines :

plt.pcolormesh(IR) plt.colorbar() plt.show()

`with :

self.axes.pcolormesh(IR)
self.figure.canvas.draw()

`

`and is work i have plot inside panel but have question how can i add canvas.size to have small plot ?

`

thanks

Le mar. 16 avr. 2019 à 09:46, Majda El yacouby majdaelyacouby1990@gmail.com a écrit :

···

hi, Vlastimil thanks for answer

ïwill test the code again , that m’y data netcdf exemple :
air.departure.sig995.2012.nc

Le mar. 9 avr. 2019 à 13:39, Matt Newville newville@cars.uchicago.edu a écrit :

Majda,

On Tue, Apr 9, 2019 at 1:54 AM Majda El yacouby majdaelyacouby1990@gmail.com wrote:

hi, Vlastimil thanks for answer , but i hve question when u said :

For a quick test, if I replace the above drawing code - lines:
plt.pcolormesh(IR)
plt.colorbar()
plt.show()

with dummy line plots like:

    self.axes.plot(range(8) )
    self.axes.plot(range(0,17, 2) )
    self.figure.canvas.draw()

wht u mean range(8) what is range cause i have IR like variable ? the problem i can plot the variable but outside application

thanks

It appears that the trouble you are having is mostly about how to embed matplotib figures in wxPython apps. If so, you might find wxmplot (https://github.com/newville/wxmplot/) helpful, at the very least to read its code and some of its examples. Wxmplot provides a wrapping of matplotlib for wx that includes many added features, like setting up zooming and copying, as well as widgets for customizing the plot or image.

For 2d data, such as used by pcolormesh, you might want to embed a wxmplot.ImagePanel, perhaps replacing or modifying your CanvasPanel to do something like:

self.image_panel = wxmplot.ImagePanel(self)

and then when you have the data array in you IR variable just do

self.image_panel.display(IR)

You also might want to consider using wxmplot.ImageFrame instead of wxmplot.ImagePanel. That will create a new wx.Frame that would then show the image and a few widgets and menus to modify how it is displayed (color table, contrast, smoothing, contours) after the image is shown.

Or, you can read the code for wxmplot.ImageFrame as an example for how that layout is done.

Hope that helps,

–Matt

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

út 16. 4. 2019 v 10:52 odesílatel Majda El yacouby majdaelyacouby1990@gmail.com napsal:

hi, Vlastimil

ï change the lines :

plt.pcolormesh(IR) plt.colorbar() plt.show()

`with :

self.axes.pcolormesh(IR)
self.figure.canvas.draw()

`

`and is work i have plot inside panel but have question how can i add canvas.size to have small plot ?

`

thanks

Hi,

I am glad it helped a bit;

for handling the layout, it is generally more flexible to use sizers, which can handle different screen sizes, windows/frames proportions etc.

in your case, you can let the canvas fill the available space of the app

add the sizer to the respective panel:

class CanvasPanel(wx.Panel):

def init(self, parent):

self.sizer = wx.BoxSizer(wx.VERTICAL)

self.sizer.Add(self.canvas, 1, wx.EXPAND)

self.SetSizer(self.sizer)

and modify:

class RootPanel(wx.Panel):

def init(self, parent):

sizer.Add(canvas_panel)

to an expandable item:

sizer.Add(canvas_panel, 1, wx.EXPAND)

If you’d need more precise control for displaying the plots, the dedicated components in matplotlib can be used; check the demo code:

https://matplotlib.org/gallery/user_interfaces/embedding_in_wx2_sgskip.html#sphx-glr-gallery-user-interfaces-embedding-in-wx2-sgskip-py

which handles the figure canvas together with the toolbar controlling the zooming, panning, saving the figure etc, similar to the pyplot interface.

hth,

vbr

hi ,

i 'm add and change what u said like that :

import wx

importer numpy en tant que np

depuis matplotlib.backends.backend_wxagg, importez FigureCanvasWxAgg en tant que FigureCanvas

à partir de matplotlib.figure import Figure

importer matplotlib

importer matplotlib.pyplot en tant que plt

importer

importer netCDF4

from netCDF4 import Dataset

Fenêtre de classe (wx.Frame):

“”" Fenêtre principale de l’application “”"

def __init __ (self, ** kwargs):

super().init(None, **kwargs)

    RootPanel (auto)

classe RootPanel (wx.Panel):

“”" Panel contenant tous les autres widgets de l’application “”"

def init(auto, parent):

super().init(parent)

    panel_buttons = wx.Panel (auto)

    panel_buttons_sizer = wx.GridSizer (1, 2, 0, 0)

    canvas_panel = CanvasPanel (auto)

    select_button = PickButton (

        panel_buttons,

        "fichiers netCDF4 (nc) | * .nc",

        canvas_panel.load_from_file,

        label = "Afficher sur cette fenêtre (nc)",

)

    toplevel_select_button = TopLevelPickButton (

        panel_buttons,

        "Fichiers texte (txt) | * .txt | Tous les fichiers | *. *",

        label = "Afficher sur une fenêtre séparée (txt)",

    )

    panel_buttons_sizer.Add (select_button)

    panel_buttons_sizer.Add (toplevel_select_button)

    panel_buttons.SetSizer (panel_buttons_sizer)

    sizer = wx.BoxSizer (wx.VERTICAL)

    sizer.Add (panel_buttons)

    sizer.Add (canvas_panel, 1, wx.EXPAND)

    self.SetSizer (sizer)

classe PickButton (wx.Button):

“”" Bouton permettant de choisir un fichier “”"

def __init __ (self, parent, wildcard, func, ** kwargs):

func est la méthode à laquelle devra être foruni le fichier sélectionné

super().init(parent, **kwargs)

    self.wildcard = caractère générique

    self.func = func

    self.Bind (wx.EVT_BUTTON, self.pick_file)

def pick_file (self, evt):

    style = style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE

    avec wx.FileDialog (

        auto, "Choisir des fichiers", wildcard = self.wildcard, style = style

    ) en tant que fileDialog:

        si fileDialog.ShowModal ()! = wx.ID_CANCEL:

            Choisi_fichier = fileDialog.GetPath ()

            self.func (selected_file)

Classe TopLevelPickButton (PickButton):

“”" Permet de choisir un fichier et d’ouvrir une toplevel “”"

def __init __ (self, parent, wildcard, ** kwargs):

    super () .__ init __ (parent, caractère générique, self.create_toplevel, ** kwargs)

def create_toplevel (self, nom_fichier):

“”" Ouvre une toplevel et affiche le graphique “”"

    self.win = TopLevelCanvas (self.Parent)

    self.win.canvas_panel.load_from_file (nom_fichier)

self.win.Show()

classe CanvasPanel (wx.Panel):

“”" Panel du graphique matplotlib “”"

def init(auto, parent):

super().init(parent)

    self.figure = Figure ()

	self.sizer = wx.BoxSizer (wx.VERTICAL)

    self.canvas = FigureCanvas (self, -1, self.figure)

    self.Size = self.canvas.Size

	self.sizer.Add (self.canvas, 1, wx.EXPAND)

	self.SetSizer (self.sizer)

def load_from_file (self, nom_fichier):

    "" "

Méthode effectuant l’intermédiaire pour charger le fichier selon

son type

    "" "

    self.axes = self.figure.add_subplot (111)

    si nom_fichier.endswith (". nc"):

        self._load_nc (nom_fichier)

    autre:

        self._load_txt (nom_fichier)

    self.canvas.draw ()

def _load_nc (self, nom_fichier):

“”" Simule le chargement et affichage à partir d’in fichier nc “”"

#plot figure

    chemin = '`/home/2019/03/25/Mmul_201903250000.nc`'

    self.axes.pcolormesh (IR)

    self.figure.canvas.draw ()

classe TopLevelCanvas (wx.Frame):

“”" Fenêtre affichant uniquement un graph matplotlib “”"

def __init __ (self, parent, ** kwargs):

super().init(parent, **kwargs)

    self.canvas_panel = CanvasPanel (auto)

    self.Size = self.canvas_panel.Size

classe App (wx.App):

def OnInit (auto):

    win = Window (titre = "Un dialogue de test", taille = (1000, 800))

    win.Show()

    retourne True

si name == “main”:

app = App ()

app.MainLoop ()

    nc  =  netCDF4 . Jeu de données ( '/ home / 2019/03/25 / Mmul_201903250000.nc' )
    IR = nc . variables [ 'IR_' ] [:]

but that give me error like that :

NameError Traceback (most recent call last)

in OnInit(auto)

134 class App(wx.App):

135 def OnInit(auto):

→ 136 win = Window(title=“A test dialog”, size=(1000, 800))

137 win.Show()

138 return True

in init(self, **kwargs)

15 def init(self, **kwargs):

16 super().init(None, **kwargs)

—> 17 RootPanel(self)

18

19

in init(auto, parent)

24 super().init(parent)

25

—> 26 panel_buttons = wx.Panel(self)

27 panel_buttons_sizer = wx.GridSizer(1, 2, 0, 0)

28

NameError: name ‘self’ is not defined

An exception has occurred, use %tb to see the full traceback.

SystemExit: OnInit returned false, exiting…

C:\Users\majdoulina\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:3275: UserWarning: To exit: use ‘exit’, ‘quit’, or Ctrl-D.

warn(“To exit: use ‘exit’, ‘quit’, or Ctrl-D.”, stacklevel=1)

In [2]:

what i can do cause i need to have plot in small size juste midlle of tha canvas ?

Le mar. 16 avr. 2019 à 14:34, Vlastimil Brom vlastimil.brom@gmail.com a écrit :

···

út 16. 4. 2019 v 10:52 odesílatel Majda El yacouby majdaelyacouby1990@gmail.com napsal:

hi, Vlastimil

ï change the lines :

plt.pcolormesh(IR) plt.colorbar() plt.show()

`with :

self.axes.pcolormesh(IR)
self.figure.canvas.draw()

`

`and is work i have plot inside panel but have question how can i add canvas.size to have small plot ?

`

thanks

Hi,

I am glad it helped a bit;

for handling the layout, it is generally more flexible to use sizers, which can handle different screen sizes, windows/frames proportions etc.

in your case, you can let the canvas fill the available space of the app

add the sizer to the respective panel:

class CanvasPanel(wx.Panel):

def init(self, parent):

self.sizer = wx.BoxSizer(wx.VERTICAL)

self.sizer.Add(self.canvas, 1, wx.EXPAND)

self.SetSizer(self.sizer)

and modify:

class RootPanel(wx.Panel):

def init(self, parent):

sizer.Add(canvas_panel)

to an expandable item:

sizer.Add(canvas_panel, 1, wx.EXPAND)

If you’d need more precise control for displaying the plots, the dedicated components in matplotlib can be used; check the demo code:

https://matplotlib.org/gallery/user_interfaces/embedding_in_wx2_sgskip.html#sphx-glr-gallery-user-interfaces-embedding-in-wx2-sgskip-py

which handles the figure canvas together with the toolbar controlling the zooming, panning, saving the figure etc, similar to the pyplot interface.

hth,

vbr

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

i find solution for change size of plot that good

but i need understand your answer for canvas_plot(auto) what it auto ?

thanks u

Le mar. 16 avr. 2019 à 21:51, Majda El yacouby majdaelyacouby1990@gmail.com a écrit :

···

hi ,

i 'm add and change what u said like that :

import wx

importer numpy en tant que np

depuis matplotlib.backends.backend_wxagg, importez FigureCanvasWxAgg en tant que FigureCanvas

à partir de matplotlib.figure import Figure

importer matplotlib

importer matplotlib.pyplot en tant que plt

importer

importer netCDF4

from netCDF4 import Dataset

Fenêtre de classe (wx.Frame):

“”" Fenêtre principale de l’application “”"

def __init __ (self, ** kwargs):

super().init(None, **kwargs)

    RootPanel (auto)

classe RootPanel (wx.Panel):

“”" Panel contenant tous les autres widgets de l’application “”"

def init(auto, parent):

super().init(parent)

    panel_buttons = wx.Panel (auto)
    panel_buttons_sizer = wx.GridSizer (1, 2, 0, 0)
    canvas_panel = CanvasPanel (auto)
    select_button = PickButton (
        panel_buttons,
        "fichiers netCDF4 (nc) | * .nc",
        canvas_panel.load_from_file,
        label = "Afficher sur cette fenêtre (nc)",

)

    toplevel_select_button = TopLevelPickButton (
        panel_buttons,
        "Fichiers texte (txt) | * .txt | Tous les fichiers | *. *",
        label = "Afficher sur une fenêtre séparée (txt)",
    )
    panel_buttons_sizer.Add (select_button)
    panel_buttons_sizer.Add (toplevel_select_button)
    panel_buttons.SetSizer (panel_buttons_sizer)
    sizer = wx.BoxSizer (wx.VERTICAL)
    sizer.Add (panel_buttons)
    sizer.Add (canvas_panel, 1, wx.EXPAND)
    self.SetSizer (sizer)

classe PickButton (wx.Button):

“”" Bouton permettant de choisir un fichier “”"

def __init __ (self, parent, wildcard, func, ** kwargs):

func est la méthode à laquelle devra être foruni le fichier sélectionné

super().init(parent, **kwargs)

    self.wildcard = caractère générique
    self.func = func
    self.Bind (wx.EVT_BUTTON, self.pick_file)
def pick_file (self, evt):
    style = style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE
    avec wx.FileDialog (
        auto, "Choisir des fichiers", wildcard = self.wildcard, style = style
    ) en tant que fileDialog:
        si fileDialog.ShowModal ()! = wx.ID_CANCEL:
            Choisi_fichier = fileDialog.GetPath ()
            self.func (selected_file)

Classe TopLevelPickButton (PickButton):

“”" Permet de choisir un fichier et d’ouvrir une toplevel “”"

def __init __ (self, parent, wildcard, ** kwargs):
    super () .__ init __ (parent, caractère générique, self.create_toplevel, ** kwargs)
def create_toplevel (self, nom_fichier):

“”" Ouvre une toplevel et affiche le graphique “”"

    self.win = TopLevelCanvas (self.Parent)
    self.win.canvas_panel.load_from_file (nom_fichier)

self.win.Show()

classe CanvasPanel (wx.Panel):

“”" Panel du graphique matplotlib “”"

def init(auto, parent):

super().init(parent)

    self.figure = Figure ()
  self.sizer = wx.BoxSizer (wx.VERTICAL)
    self.canvas = FigureCanvas (self, -1, self.figure)
    self.Size = self.canvas.Size
  self.sizer.Add (self.canvas, 1, wx.EXPAND)
  self.SetSizer (self.sizer)
def load_from_file (self, nom_fichier):
    "" "

Méthode effectuant l’intermédiaire pour charger le fichier selon

son type

    "" "
    self.axes = self.figure.add_subplot (111)
    si nom_fichier.endswith (". nc"):
        self._load_nc (nom_fichier)
    autre:
        self._load_txt (nom_fichier)
    self.canvas.draw ()
def _load_nc (self, nom_fichier):

“”" Simule le chargement et affichage à partir d’in fichier nc “”"

#plot figure

    chemin = '`/home/2019/03/25/Mmul_201903250000.nc`'
    self.axes.pcolormesh (IR)
    self.figure.canvas.draw ()

classe TopLevelCanvas (wx.Frame):

“”" Fenêtre affichant uniquement un graph matplotlib “”"

def __init __ (self, parent, ** kwargs):

super().init(parent, **kwargs)

    self.canvas_panel = CanvasPanel (auto)
    self.Size = self.canvas_panel.Size

classe App (wx.App):

def OnInit (auto):
    win = Window (titre = "Un dialogue de test", taille = (1000, 800))
    win.Show()
    retourne True

si name == “main”:

app = App ()
app.MainLoop ()
    nc  =  netCDF4 . Jeu de données ( '/ home / 2019/03/25 / Mmul_201903250000.nc' )
    IR = nc . variables [ 'IR_' ] [:]

but that give me error like that :

NameError Traceback (most recent call last)

in OnInit(auto)

134 class App(wx.App):

135 def OnInit(auto):

→ 136 win = Window(title=“A test dialog”, size=(1000, 800))

137 win.Show()

138 return True

in init(self, **kwargs)

15 def init(self, **kwargs):

16 super().init(None, **kwargs)

—> 17 RootPanel(self)

18

19

in init(auto, parent)

24 super().init(parent)

25

—> 26 panel_buttons = wx.Panel(self)

27 panel_buttons_sizer = wx.GridSizer(1, 2, 0, 0)

28

NameError: name ‘self’ is not defined

An exception has occurred, use %tb to see the full traceback.

SystemExit: OnInit returned false, exiting…

C:\Users\majdoulina\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:3275: UserWarning: To exit: use ‘exit’, ‘quit’, or Ctrl-D.

warn(“To exit: use ‘exit’, ‘quit’, or Ctrl-D.”, stacklevel=1)

In [2]:

what i can do cause i need to have plot in small size juste midlle of tha canvas ?

Le mar. 16 avr. 2019 à 14:34, Vlastimil Brom vlastimil.brom@gmail.com a écrit :

út 16. 4. 2019 v 10:52 odesílatel Majda El yacouby majdaelyacouby1990@gmail.com napsal:

hi, Vlastimil

ï change the lines :

plt.pcolormesh(IR) plt.colorbar() plt.show()

`with :

self.axes.pcolormesh(IR)
self.figure.canvas.draw()

`

`and is work i have plot inside panel but have question how can i add canvas.size to have small plot ?

`

thanks

Hi,

I am glad it helped a bit;

for handling the layout, it is generally more flexible to use sizers, which can handle different screen sizes, windows/frames proportions etc.

in your case, you can let the canvas fill the available space of the app

add the sizer to the respective panel:

class CanvasPanel(wx.Panel):

def init(self, parent):

self.sizer = wx.BoxSizer(wx.VERTICAL)

self.sizer.Add(self.canvas, 1, wx.EXPAND)

self.SetSizer(self.sizer)

and modify:

class RootPanel(wx.Panel):

def init(self, parent):

sizer.Add(canvas_panel)

to an expandable item:

sizer.Add(canvas_panel, 1, wx.EXPAND)

If you’d need more precise control for displaying the plots, the dedicated components in matplotlib can be used; check the demo code:

https://matplotlib.org/gallery/user_interfaces/embedding_in_wx2_sgskip.html#sphx-glr-gallery-user-interfaces-embedding-in-wx2-sgskip-py

which handles the figure canvas together with the toolbar controlling the zooming, panning, saving the figure etc, similar to the pyplot interface.

hth,

vbr

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi,
I'm glad, you could solve the immediate problems with the layout;
however, it seems, something rather strange happened to the code given
in the previous post - i looks like an automatic translation into
French, even including some reserved words in python etc.
It is not likely, that this code could be run with the (usual) python
interpreter; but if something similar happend (to some lesser extent)
to the code you are trying to run, the mismatch between the original
"self" and the translated "auto" might explain some problems.
hth,
   vbr

···

we 16. 4. 2019 v 23:17 Majda El yacouby <majdaelyacouby1990@gmail.com>:

i find solution for change size of plot that good

but i need understand your answer for canvas_plot(auto) what it auto ?

thanks u

Le mar. 16 avr. 2019 à 21:51, Majda El yacouby <majdaelyacouby1990@gmail.com> a écrit :

hi ,
i 'm add and change what u said like that :

import wx
importer numpy en tant que np
depuis matplotlib.backends.backend_wxagg, importez FigureCanvasWxAgg en tant que FigureCanvas
à partir de matplotlib.figure import Figure
importer matplotlib
importer matplotlib.pyplot en tant que plt
importer
importer netCDF4
from netCDF4 import Dataset

Fenêtre de classe (wx.Frame):
    """ Fenêtre principale de l'application """

    def __init __ (self, ** kwargs):
        super().__init__(None, **kwargs)
        RootPanel (auto)

classe RootPanel (wx.Panel):
    """ Panel contenant tous les autres widgets de l'application """

    def __init__(auto, parent):
        super().__init__(parent)

        panel_buttons = wx.Panel (auto)
        panel_buttons_sizer = wx.GridSizer (1, 2, 0, 0)

        canvas_panel = CanvasPanel (auto)

        select_button = PickButton (
            panel_buttons,
            "fichiers netCDF4 (nc) | * .nc",
            canvas_panel.load_from_file,
            label = "Afficher sur cette fenêtre (nc)",
        )
        toplevel_select_button = TopLevelPickButton (
            panel_buttons,
            "Fichiers texte (txt) | * .txt | Tous les fichiers | *. *",
            label = "Afficher sur une fenêtre séparée (txt)",
        )
        panel_buttons_sizer.Add (select_button)
        panel_buttons_sizer.Add (toplevel_select_button)
        panel_buttons.SetSizer (panel_buttons_sizer)

        sizer = wx.BoxSizer (wx.VERTICAL)
        sizer.Add (panel_buttons)
        sizer.Add (canvas_panel, 1, wx.EXPAND)
        self.SetSizer (sizer)

classe PickButton (wx.Button):
    """ Bouton permettant de choisir un fichier """

    def __init __ (self, parent, wildcard, func, ** kwargs):
        # func est la méthode à laquelle devra être foruni le fichier sélectionné
        super().__init__(parent, **kwargs)
        self.wildcard = caractère générique
        self.func = func
        self.Bind (wx.EVT_BUTTON, self.pick_file)

    def pick_file (self, evt):
        style = style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE
        avec wx.FileDialog (
            auto, "Choisir des fichiers", wildcard = self.wildcard, style = style
        ) en tant que fileDialog:
            si fileDialog.ShowModal ()! = wx.ID_CANCEL:
                Choisi_fichier = fileDialog.GetPath ()
                self.func (selected_file)

Classe TopLevelPickButton (PickButton):
    """ Permet de choisir un fichier et d'ouvrir une toplevel """

    def __init __ (self, parent, wildcard, ** kwargs):
        super () .__ init __ (parent, caractère générique, self.create_toplevel, ** kwargs)

    def create_toplevel (self, nom_fichier):
        """ Ouvre une toplevel et affiche le graphique """
        self.win = TopLevelCanvas (self.Parent)
        self.win.canvas_panel.load_from_file (nom_fichier)
        self.win.Show()

classe CanvasPanel (wx.Panel):
    """ Panel du graphique matplotlib """

    def __init__(auto, parent):
        super().__init__(parent)
        self.figure = Figure ()
self.sizer = wx.BoxSizer (wx.VERTICAL)
        self.canvas = FigureCanvas (self, -1, self.figure)
        self.Size = self.canvas.Size
self.sizer.Add (self.canvas, 1, wx.EXPAND)
self.SetSizer (self.sizer)

    def load_from_file (self, nom_fichier):
        "" "
        Méthode effectuant l'intermédiaire pour charger le fichier selon
        son type
        "" "
        self.axes = self.figure.add_subplot (111)
        si nom_fichier.endswith (". nc"):
            self._load_nc (nom_fichier)
        autre:
            self._load_txt (nom_fichier)
        self.canvas.draw ()

    def _load_nc (self, nom_fichier):
        """ Simule le chargement et affichage à partir d'in fichier nc """

   #plot figure
        chemin = '/home/2019/03/25/Mmul_201903250000.nc'

        nc = netCDF4 . Jeu de données ( '/ home / 2019/03/25 / Mmul_201903250000.nc' )
        IR = nc . variables [ 'IR_' ] [:]

        self.axes.pcolormesh (IR)
        self.figure.canvas.draw ()

classe TopLevelCanvas (wx.Frame):
    """ Fenêtre affichant uniquement un graph matplotlib """

    def __init __ (self, parent, ** kwargs):
        super().__init__(parent, **kwargs)
        self.canvas_panel = CanvasPanel (auto)
        self.Size = self.canvas_panel.Size

classe App (wx.App):
    def OnInit (auto):
        win = Window (titre = "Un dialogue de test", taille = (1000, 800))
        win.Show()
        retourne True

si __name__ == "__main__":
    app = App ()
    app.MainLoop ()

but that give me error like that :

NameError Traceback (most recent call last)
<ipython-input-1-bf838a412484> in OnInit(auto)
    134 class App(wx.App):
    135 def OnInit(auto):
--> 136 win = Window(title="A test dialog", size=(1000, 800))
    137 win.Show()
    138 return True

<ipython-input-1-bf838a412484> in __init__(self, **kwargs)
     15 def __init__(self, **kwargs):
     16 super().__init__(None, **kwargs)
---> 17 RootPanel(self)
     18
     19

<ipython-input-1-bf838a412484> in __init__(auto, parent)
     24 super().__init__(parent)
     25
---> 26 panel_buttons = wx.Panel(self)
     27 panel_buttons_sizer = wx.GridSizer(1, 2, 0, 0)
     28

NameError: name 'self' is not defined
An exception has occurred, use %tb to see the full traceback.

SystemExit: OnInit returned false, exiting...

C:\Users\majdoulina\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:3275: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
  warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)

In [2]:

what i can do cause i need to have plot in small size juste midlle of tha canvas ?

Le mar. 16 avr. 2019 à 14:34, Vlastimil Brom <vlastimil.brom@gmail.com> a écrit :

út 16. 4. 2019 v 10:52 odesílatel Majda El yacouby <majdaelyacouby1990@gmail.com> napsal:

hi, Vlastimil

ï change the lines :

        plt.pcolormesh(IR)
        plt.colorbar()
        plt.show()
with :

self.axes.pcolormesh(IR)
self.figure.canvas.draw()

and is work i have plot inside panel but have question how can i add canvas.size to have small plot ?

thanks

Hi,
I am glad it helped a bit;
for handling the layout, it is generally more flexible to use sizers, which can handle different screen sizes, windows/frames proportions etc.

in your case, you can let the canvas fill the available space of the app
add the sizer to the respective panel:
class CanvasPanel(wx.Panel):
...
    def __init__(self, parent):
...
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(self.canvas, 1, wx.EXPAND)
        self.SetSizer(self.sizer)

and modify:

class RootPanel(wx.Panel):
...
    def __init__(self, parent):
...
        sizer.Add(canvas_panel)

to an expandable item:
        sizer.Add(canvas_panel, 1, wx.EXPAND)

If you'd need more precise control for displaying the plots, the dedicated components in matplotlib can be used; check the demo code:
Embedding in wx #2 — Matplotlib 3.9.2 documentation

which handles the figure canvas together with the toolbar controlling the zooming, panning, saving the figure etc, similar to the pyplot interface.

hth,
  vbr

--

hi

Vlastimil Brom ,

the problem is solve with your help ,

yes my code is in frensh some line is in frensh so sorry for that ,

is not easy to work with data like netcdf4 in wxython

Majda

Le mar. 16 avr. 2019 à 23:33, Vlastimil Brom vlastimil.brom@gmail.com a écrit :

···

we 16. 4. 2019 v 23:17 Majda El yacouby majdaelyacouby1990@gmail.com:

i find solution for change size of plot that good

but i need understand your answer for canvas_plot(auto) what it auto ?

thanks u

Le mar. 16 avr. 2019 à 21:51, Majda El yacouby majdaelyacouby1990@gmail.com a écrit :

hi ,

i 'm add and change what u said like that :

import wx

importer numpy en tant que np

depuis matplotlib.backends.backend_wxagg, importez FigureCanvasWxAgg en tant que FigureCanvas

à partir de matplotlib.figure import Figure

importer matplotlib

importer matplotlib.pyplot en tant que plt

importer

importer netCDF4

from netCDF4 import Dataset

Fenêtre de classe (wx.Frame):

""" Fenêtre principale de l'application """
def __init __ (self, ** kwargs):
    super().__init__(None, **kwargs)
    RootPanel (auto)

classe RootPanel (wx.Panel):

""" Panel contenant tous les autres widgets de l'application """
def __init__(auto, parent):
    super().__init__(parent)
    panel_buttons = wx.Panel (auto)
    panel_buttons_sizer = wx.GridSizer (1, 2, 0, 0)
    canvas_panel = CanvasPanel (auto)
    select_button = PickButton (
        panel_buttons,
        "fichiers netCDF4 (nc) | * .nc",
        canvas_panel.load_from_file,
        label = "Afficher sur cette fenêtre (nc)",
    )
    toplevel_select_button = TopLevelPickButton (
        panel_buttons,
        "Fichiers texte (txt) | * .txt | Tous les fichiers | *. *",
        label = "Afficher sur une fenêtre séparée (txt)",
    )
    panel_buttons_sizer.Add (select_button)
    panel_buttons_sizer.Add (toplevel_select_button)
    panel_buttons.SetSizer (panel_buttons_sizer)
    sizer = wx.BoxSizer (wx.VERTICAL)
    sizer.Add (panel_buttons)
    sizer.Add (canvas_panel, 1, wx.EXPAND)
    self.SetSizer (sizer)

classe PickButton (wx.Button):

""" Bouton permettant de choisir un fichier """
def __init __ (self, parent, wildcard, func, ** kwargs):
    # func est la méthode à laquelle devra être foruni le fichier sélectionné
    super().__init__(parent, **kwargs)
    self.wildcard = caractère générique
    self.func = func
    self.Bind (wx.EVT_BUTTON, self.pick_file)
def pick_file (self, evt):
    style = style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE
    avec wx.FileDialog (
        auto, "Choisir des fichiers", wildcard = self.wildcard, style = style
    ) en tant que fileDialog:
        si fileDialog.ShowModal ()! = wx.ID_CANCEL:
            Choisi_fichier = fileDialog.GetPath ()
            self.func (selected_file)

Classe TopLevelPickButton (PickButton):

""" Permet de choisir un fichier et d'ouvrir une toplevel """
def __init __ (self, parent, wildcard, ** kwargs):
    super () .__ init __ (parent, caractère générique, self.create_toplevel, ** kwargs)
def create_toplevel (self, nom_fichier):
    """ Ouvre une toplevel et affiche le graphique """
    self.win = TopLevelCanvas (self.Parent)
    self.win.canvas_panel.load_from_file (nom_fichier)
    self.win.Show()

classe CanvasPanel (wx.Panel):

""" Panel du graphique matplotlib """
def __init__(auto, parent):
    super().__init__(parent)
    self.figure = Figure ()

self.sizer = wx.BoxSizer (wx.VERTICAL)

    self.canvas = FigureCanvas (self, -1, self.figure)
    self.Size = self.canvas.Size

self.sizer.Add (self.canvas, 1, wx.EXPAND)

self.SetSizer (self.sizer)

def load_from_file (self, nom_fichier):
    "" "
    Méthode effectuant l'intermédiaire pour charger le fichier selon
    son type
    "" "
    self.axes = self.figure.add_subplot (111)
    si nom_fichier.endswith (". nc"):
        self._load_nc (nom_fichier)
    autre:
        self._load_txt (nom_fichier)
    self.canvas.draw ()
def _load_nc (self, nom_fichier):
    """ Simule le chargement et affichage à partir d'in fichier nc """

#plot figure

    chemin = '/home/2019/03/25/Mmul_[201903250000.nc](http://201903250000.nc)'
    nc  =  netCDF4 . Jeu de données ( '/ home / 2019/03/25 / Mmul_201903250000.nc' )
    IR = nc . variables [ 'IR_' ] [:]
    self.axes.pcolormesh (IR)
    self.figure.canvas.draw ()

classe TopLevelCanvas (wx.Frame):

""" Fenêtre affichant uniquement un graph matplotlib """
def __init __ (self, parent, ** kwargs):
    super().__init__(parent, **kwargs)
    self.canvas_panel = CanvasPanel (auto)
    self.Size = self.canvas_panel.Size

classe App (wx.App):

def OnInit (auto):
    win = Window (titre = "Un dialogue de test", taille = (1000, 800))
    win.Show()
    retourne True

si name == “main”:

app = App ()
app.MainLoop ()

but that give me error like that :

NameError Traceback (most recent call last)

in OnInit(auto)

134 class App(wx.App):
135     def OnInit(auto):

→ 136 win = Window(title=“A test dialog”, size=(1000, 800))

137         win.Show()
138         return True

in init(self, **kwargs)

 15     def __init__(self, **kwargs):
 16         super().__init__(None, **kwargs)

—> 17 RootPanel(self)

 18
 19

in init(auto, parent)

 24         super().__init__(parent)
 25

—> 26 panel_buttons = wx.Panel(self)

 27         panel_buttons_sizer = wx.GridSizer(1, 2, 0, 0)
 28

NameError: name ‘self’ is not defined

An exception has occurred, use %tb to see the full traceback.

SystemExit: OnInit returned false, exiting…

C:\Users\majdoulina\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:3275: UserWarning: To exit: use ‘exit’, ‘quit’, or Ctrl-D.

warn(“To exit: use ‘exit’, ‘quit’, or Ctrl-D.”, stacklevel=1)

In [2]:

what i can do cause i need to have plot in small size juste midlle of tha canvas ?

Le mar. 16 avr. 2019 à 14:34, Vlastimil Brom vlastimil.brom@gmail.com a écrit :

út 16. 4. 2019 v 10:52 odesílatel Majda El yacouby majdaelyacouby1990@gmail.com napsal:

hi, Vlastimil

ï change the lines :

    plt.pcolormesh(IR)
    plt.colorbar()
    plt.show()

with :

self.axes.pcolormesh(IR)

self.figure.canvas.draw()

and is work i have plot inside panel but have question how can i add canvas.size to have small plot ?

thanks

Hi,

I am glad it helped a bit;

for handling the layout, it is generally more flexible to use sizers, which can handle different screen sizes, windows/frames proportions etc.

in your case, you can let the canvas fill the available space of the app

add the sizer to the respective panel:

class CanvasPanel(wx.Panel):

def __init__(self, parent):

    self.sizer = wx.BoxSizer(wx.VERTICAL)
    self.sizer.Add(self.canvas, 1, wx.EXPAND)
    self.SetSizer(self.sizer)

and modify:

class RootPanel(wx.Panel):

def __init__(self, parent):

    sizer.Add(canvas_panel)

to an expandable item:

    sizer.Add(canvas_panel, 1, wx.EXPAND)

If you’d need more precise control for displaying the plots, the dedicated components in matplotlib can be used; check the demo code:

https://matplotlib.org/gallery/user_interfaces/embedding_in_wx2_sgskip.html#sphx-glr-gallery-user-interfaces-embedding-in-wx2-sgskip-py

which handles the figure canvas together with the toolbar controlling the zooming, panning, saving the figure etc, similar to the pyplot interface.

hth,

vbr

Hi,

I’m glad, you could solve the immediate problems with the layout;

however, it seems, something rather strange happened to the code given

in the previous post - i looks like an automatic translation into

French, even including some reserved words in python etc.

It is not likely, that this code could be run with the (usual) python

interpreter; but if something similar happend (to some lesser extent)

to the code you are trying to run, the mismatch between the original

“self” and the translated “auto” might explain some problems.

hth,

vbr

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.