Hi, I have an aesthetic concern over an ugly little moment in an app.
I am embedding a matplotlib plot in a wxPython app, and when I
add the plot (in this case to a wx.AuiNotebook), there is a brief moment
(~1 sec) when the plot and notebook page can be "seen being built", in
these rapidly fired-off steps:
1. a small white square appears in the upper left hand side of the notebook.
2. the notebook tab and notebook page appear
3. a sort of garbled bit in that area where the white square was appears.
4. the full plot appears (and looks fine in the end).
It is sort of ugly to watch, and although it doesn't affect usability, it would
be nice to hide this process. I thought Freeze and Thaw were used for
hiding things somehow until they were ready to be displayed, but I admit
I really have no understanding of how to use them. I also don't know if they
would help in this case.
Any help or pointers would be appreciated.
Thanks,
Che
Hi, I have an aesthetic concern over an ugly little moment in an app.
I am embedding a matplotlib plot in a wxPython app, and when I
add the plot (in this case to a wx.AuiNotebook), there is a brief moment
(~1 sec) when the plot and notebook page can be "seen being built", in
these rapidly fired-off steps:
1. a small white square appears in the upper left hand side of the notebook.
2. the notebook tab and notebook page appear
3. a sort of garbled bit in that area where the white square was appears.
4. the full plot appears (and looks fine in the end).
It is sort of ugly to watch, and although it doesn't affect usability, it would
be nice to hide this process. I thought Freeze and Thaw were used for
hiding things somehow until they were ready to be displayed, but I admit
I really have no understanding of how to use them. I also don't know if they
would help in this case.
Any help or pointers would be appreciated.
It happened to me too in some of my apps. What I did is to Freeze()
the notebook *parent* before doing anything, then I added the pages
and the plots and everything else, and in the end I called Thaw() on
the notebook parent. With a matplotlib plot in one of your notebook
pages, there might be the need of calling Refresh() or Update() again
once you have called Thaw().
Hi Andrea. Thank you. That tip eliminated steps #1 and #2 above. I still
have a brief-but-noticeable moment where #3--the garbled "miniature" (little
square in upper left corner) version of the plot--shows up. Were you able to
not have that? Maybe something is wrong with the way I am making that
plot?
Sorry to fuss, but when it is getting closer to perfect the temptation is to
keep going. Thanks again,
Che
···
On Tue, Jan 13, 2009 at 4:11 AM, Andrea Gavana <andrea.gavana@gmail.com> wrote:
Hi Che,
On Tue, Jan 13, 2009 at 6:05 AM, C M wrote:
Hi, I have an aesthetic concern over an ugly little moment in an app.
I am embedding a matplotlib plot in a wxPython app, and when I
add the plot (in this case to a wx.AuiNotebook), there is a brief moment
(~1 sec) when the plot and notebook page can be "seen being built", in
these rapidly fired-off steps:
1. a small white square appears in the upper left hand side of the notebook.
2. the notebook tab and notebook page appear
3. a sort of garbled bit in that area where the white square was appears.
4. the full plot appears (and looks fine in the end).
It is sort of ugly to watch, and although it doesn't affect usability, it would
be nice to hide this process. I thought Freeze and Thaw were used for
hiding things somehow until they were ready to be displayed, but I admit
I really have no understanding of how to use them. I also don't know if they
would help in this case.
Any help or pointers would be appreciated.
It happened to me too in some of my apps. What I did is to Freeze()
the notebook *parent* before doing anything, then I added the pages
and the plots and everything else, and in the end I called Thaw() on
the notebook parent. With a matplotlib plot in one of your notebook
pages, there might be the need of calling Refresh() or Update() again
once you have called Thaw().
Hi, I have an aesthetic concern over an ugly little moment in an app.
I am embedding a matplotlib plot in a wxPython app, and when I
add the plot (in this case to a wx.AuiNotebook), there is a brief moment
(~1 sec) when the plot and notebook page can be "seen being built", in
these rapidly fired-off steps:
1. a small white square appears in the upper left hand side of the notebook.
2. the notebook tab and notebook page appear
3. a sort of garbled bit in that area where the white square was appears.
4. the full plot appears (and looks fine in the end).
It is sort of ugly to watch, and although it doesn't affect usability, it would
be nice to hide this process. I thought Freeze and Thaw were used for
hiding things somehow until they were ready to be displayed, but I admit
I really have no understanding of how to use them. I also don't know if they
would help in this case.
Any help or pointers would be appreciated.
It happened to me too in some of my apps. What I did is to Freeze()
the notebook *parent* before doing anything, then I added the pages
and the plots and everything else, and in the end I called Thaw() on
the notebook parent. With a matplotlib plot in one of your notebook
pages, there might be the need of calling Refresh() or Update() again
once you have called Thaw().
Hi Andrea. Thank you. That tip eliminated steps #1 and #2 above. I still
have a brief-but-noticeable moment where #3--the garbled "miniature" (little
square in upper left corner) version of the plot--shows up. Were you able to
not have that? Maybe something is wrong with the way I am making that
plot?
Sorry to fuss, but when it is getting closer to perfect the temptation is to
keep going. Thanks again,
Uhm, it should have gone away... anyway, there are a couple of things
you may try:
1) Call Freeze() and Thaw() on the main frame, freezing everything in
your app until the plot is ready, OR
2) Use something like this:
notebookParent.Freeze()
# Do your stuff here, plots and AddPage and so on
wx.CallAfter(notebookParent.Thaw)
If it doesn't go away with one of these 2 solutions, it might be wort
trying to recreate the problem in one app so that people using
matplotlib with wxPython can play with it.
Hi, I have an aesthetic concern over an ugly little moment in an app.
I am embedding a matplotlib plot in a wxPython app, and when I
add the plot (in this case to a wx.AuiNotebook), there is a brief moment
(~1 sec) when the plot and notebook page can be "seen being built", in
these rapidly fired-off steps:
1. a small white square appears in the upper left hand side of the notebook.
2. the notebook tab and notebook page appear
3. a sort of garbled bit in that area where the white square was appears.
4. the full plot appears (and looks fine in the end).
It is sort of ugly to watch, and although it doesn't affect usability, it would
be nice to hide this process. I thought Freeze and Thaw were used for
hiding things somehow until they were ready to be displayed, but I admit
I really have no understanding of how to use them. I also don't know if they
would help in this case.
Any help or pointers would be appreciated.
It happened to me too in some of my apps. What I did is to Freeze()
the notebook *parent* before doing anything, then I added the pages
and the plots and everything else, and in the end I called Thaw() on
the notebook parent. With a matplotlib plot in one of your notebook
pages, there might be the need of calling Refresh() or Update() again
once you have called Thaw().
HTH.
Andrea.
Thanks, again, Andrea. I think I know where my problem here is, it's
that I have some resizing rules in my code that is not quite right. What
I am still seeing is resizing on idle. I got it to go away, but then somehow
my regular resizing wasn't working. My code is based on the example here: http://www.scipy.org/Matplotlib_figure_in_a_wx_panel
I've been struggling with it for hours and think I will come back and take
a fresh look. It's probably something simple but I've just gotten myself
confused. When I get either the solution or at least a small runnable sample,
I will post back on this.
Che
···
On Tue, Jan 13, 2009 at 11:12 AM, Andrea Gavana <andrea.gavana@gmail.com> wrote:
On Tue, Jan 13, 2009 at 4:08 PM, C M wrote:
On Tue, Jan 13, 2009 at 4:11 AM, Andrea Gavana <andrea.gavana@gmail.com> wrote:
Hi Andrea. Thank you. That tip eliminated steps #1 and #2 above. I still
have a brief-but-noticeable moment where #3--the garbled "miniature" (little
square in upper left corner) version of the plot--shows up. Were you able to
not have that? Maybe something is wrong with the way I am making that
plot?
Sorry to fuss, but when it is getting closer to perfect the temptation is to
keep going. Thanks again,
Uhm, it should have gone away... anyway, there are a couple of things
you may try:
1) Call Freeze() and Thaw() on the main frame, freezing everything in
your app until the plot is ready, OR
2) Use something like this:
notebookParent.Freeze()
# Do your stuff here, plots and AddPage and so on
wx.CallAfter(notebookParent.Thaw)
If it doesn't go away with one of these 2 solutions, it might be wort
trying to recreate the problem in one app so that people using
matplotlib with wxPython can play with it.