|
From: David B. <stu...@gm...> - 2018-05-03 17:56:29
Attachments:
wxAndPlTest.cpp
|
Dear all, I am using plplot 5.13.0 and wxwidgets 3.1.0 in a windows environment, VS 2017. I've attempted to merge the plplot wxwidgets example with more complex wxwidgets examples to generate plots in various frames and panels in a larger GUI format. The specific example that produced the figures in this email were made using wxWidgets uiaction sample (UI action simulator) and the WxPLplotDemo code. In a nut shell I've made a splitter window in the main GUI and placed a copy of one of the plots there via a call to Plot() in the mainframe definition. The same plot is called for some menu action too. The issue I am seeing is that the plot in the main GUI does not have axis labels or tick mark values but the separate plot, activated by the menu does. Also, if I refresh the plot in the gui via a separate menu action the missing data returns. All calls are to the same function. I'm asking here first since it's the plot generated by PLplot that is inconsistency but it may be a wxwidgets issue. (it is clear that I was messing with other PLplot attributes too, like subplot, color, etc. This was not the cause of the difference as it is present regardless.) Modified code is attached (note that the "run simulation" menu item will cause a crash.), it is a quick hack job but I'm not seeing an obvious cause for the diff. This is the main frame GUI This is the separate plot generated in a new frame. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus |
|
From: Alan W. I. <ir...@be...> - 2018-05-03 20:26:02
|
On 2018-05-03 13:56-0400 David Bergman wrote: > Dear all, > > I am using plplot 5.13.0 and wxwidgets 3.1.0 in a windows environment, VS > 2017. > I've attempted to merge the plplot wxwidgets example with more complex > wxwidgets examples to generate plots in various frames and panels in a larger > GUI format. > > The specific example that produced the figures in this email were made using > wxWidgets uiaction sample (UI action simulator) and the WxPLplotDemo code. > > In a nut shell I've made a splitter window in the main GUI and placed a copy > of one of the plots there via a call to Plot() in the mainframe definition. > The same plot is called for some menu action too. > > The issue I am seeing is that the plot in the main GUI does not have axis > labels or tick mark values but the separate plot, activated by the menu does. > > Also, if I refresh the plot in the gui via a separate menu action the missing > data returns. > > All calls are to the same function. I'm asking here first since it's the > plot generated by PLplot that is inconsistency but it may be a wxwidgets > issue. > > (it is clear that I was messing with other PLplot attributes too, like > subplot, color, etc. This was not the cause of the difference as it is > present regardless.) Modified code is attached (note that the "run > simulation" menu item will cause a crash.), it is a quick hack job but I'm > not seeing an obvious cause for the diff. > > This is the main frame GUI > > > This is the separate plot generated in a new frame. Hi David: I suggest you make a self-contained example that demonstrates the issue in the simplest way possible. Such simplified test examples are really worthwhile since they normally help you to find the bug in your own code or if there is no such bug make it much easier to debug external library code such as that from PLplot or wxwidgets. Also if it turns out the bug is not in your own code such a simplified example should be easy for PLplot developers to build with CMake and run on various platforms to see whether the issue shows up on all platforms. For example, I would be willing to help with such a test on the Linux platform. Good luck with implementing this suggested simplified example, and let us know how it goes. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
|
From: Alan W. I. <ir...@be...> - 2018-05-03 20:45:14
|
On 2018-05-03 13:56-0400 David Bergman wrote: P.S. I noticed just after (natch) I sent off my previous post that you had included source code in your post, but it is hard for me to evaluate whether you have simplified that example as much as possible. So here is what I would like you to do instead. Please give us the simplest possible patch for examples/c++/wxPLplotDemo.cpp that demonstrates the issue. Such a patch clearly demonstrates the minimal changes required to show the issue. It also should allow our current build and test system to build and test your (slight) modification of examples/c++/wxPLplotDemo.cpp, and that would be a great convenience for us when we are attempting to replicate the issue on our various platforms. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
|
From: David B. <stu...@gm...> - 2018-05-04 17:56:14
Attachments:
simple.cpp
|
Alan, Thanks for the quick response. You are correct, this was a rather convoluted piecemeal hack of several examples from both wxwidgets and plplot. Attached is a simplified version. There is one, and only on, plot function, and a very simple widgets GUI with no buttons or menus. The issue is present, i.e. no tick mark values and no labels. I did not add any external frames, rather than show a difference I opted to show one thing in this example. The only real difference is that I am using a wxPanel to make the plot in the splitter window. I am fairly new to both PLplot and wxWidgets so I may be using these functions incorrectly (it is not my intent to unnecessarily spin people up for help but I have tried and am clearly missing something). Viable hypotheses are (1) I'm instantiating the Panel incorrectly, (2) invoking the plot incorrectly, (3) that plots and panels don't work like plots and frames do (and I'm missing some data), (4) there is a size issue and the text I expect to see is outside the limits of the Panel. As I stated before, in a more complex code base this issue goes away if I "re-plot" the same plot in the same window via an external button push. Would it help if the plot function was "owned" by the myApp? David On 5/3/2018 4:45 PM, Alan W. Irwin wrote: > On 2018-05-03 13:56-0400 David Bergman wrote: > > P.S. I noticed just after (natch) I sent off my previous post that you > had included source code in your post, but it is hard for me to > evaluate whether you have simplified that example as much as possible. > > So here is what I would like you to do instead. Please give us the > simplest possible patch for examples/c++/wxPLplotDemo.cpp that > demonstrates the issue. Such a patch clearly demonstrates the minimal > changes required to show the issue. It also should allow our current > build and test system to build and test your (slight) modification of > examples/c++/wxPLplotDemo.cpp, and that would be a great convenience > for us when we are attempting to replicate the issue on our various > platforms. > > Alan > __________________________ > Alan W. Irwin > > Astronomical research affiliation with Department of Physics and > Astronomy, > University of Victoria (astrowww.phys.uvic.ca). > > Programming affiliations with the FreeEOS equation-of-state > implementation for stellar interiors (freeeos.sf.net); the Time > Ephemerides project (timeephem.sf.net); PLplot scientific plotting > software package (plplot.sf.net); the libLASi project > (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); > and the Linux Brochure Project (lbproject.sf.net). > __________________________ > > Linux-powered Science > __________________________ > --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus |
|
From: Alan W. I. <ir...@be...> - 2018-05-04 21:45:27
|
On 2018-05-04 13:55-0400 David Bergman wrote:
> Alan,
>
> Thanks for the quick response. You are correct, this was a rather convoluted
> piecemeal hack of several examples from both wxwidgets and plplot.
>
> Attached is a simplified version.
Just to test that out, I locally copied that version on top of
examples/c++/wxPLplotDemo.cpp
and then tested using a CMake-based build of PLplot as follows:
software@raven> make test_wxPLplotDemo
[ 0%] Built target plhershey-unicode-gen
[ 0%] Built target plhershey-unicode.h_built
[ 0%] Built target csirocsa
[ 16%] Built target csironn
[ 16%] Built target tai-utc-gen
[ 16%] Built target tai-utc.h_built
[ 16%] Built target deltaT-gen
[ 16%] Built target deltaT.h_built
[ 16%] Built target qsastime
[ 83%] Built target plplot
[100%] Built target plplotcxx
[100%] Built target plplotwxwidgets
[100%] Building CXX object examples/c++/CMakeFiles/wxPLplotDemo.dir/wxPLplotDemo.cpp.o
/home/software/plplot/HEAD/plplot.git/examples/c++/wxPLplotDemo.cpp:109:22: error: expected ‘;’ at end of member declaration
virtual bool OnInit() wxOVERRIDE;
^
/home/software/plplot/HEAD/plplot.git/examples/c++/wxPLplotDemo.cpp:109:24: error: ‘wxOVERRIDE’ does not name a type
virtual bool OnInit() wxOVERRIDE;
^
examples/c++/CMakeFiles/wxPLplotDemo.dir/build.make:62: recipe for target 'examples/c++/CMakeFiles/wxPLplotDemo.dir/wxPLplotDemo.cpp.o' failed
make[3]: *** [examples/c++/CMakeFiles/wxPLplotDemo.dir/wxPLplotDemo.cpp.o] Error 1
CMakeFiles/Makefile2:13159: recipe for target 'examples/c++/CMakeFiles/wxPLplotDemo.dir/all' failed
make[2]: *** [examples/c++/CMakeFiles/wxPLplotDemo.dir/all] Error 2
CMakeFiles/Makefile2:5315: recipe for target 'examples/CMakeFiles/test_wxPLplotDemo.dir/rule' failed
make[1]: *** [examples/CMakeFiles/test_wxPLplotDemo.dir/rule] Error 2
Makefile:1807: recipe for target 'test_wxPLplotDemo' failed
make: *** [test_wxPLplotDemo] Error 2
You should be able to follow my Linux steps on Windows by copying your
simple.cpp on top of examples/c++/wxPLplotDemo.cpp, configuring PLplot
using cmake on the command line using the "NMake Makefiles" generator, and replacing make with nmake
to attempt to build the test_wxPLplotDemo target.
Let me know how that test attempt goes, and please fix whatever causes
the above build error (at least for the Linux case) in your simple.cpp
and send it to me again.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
|
|
From: David B. <stu...@gm...> - 2018-06-06 12:02:18
|
Alan, Thanks. It seems that we're making some progress. I am working on Windows and I do not get the warning "Somehow we attempted to plot before the wxPLplotwindow was ready. The plot will not be drawn". I get a plot with some missing elements. I've not tried to build or run in Linux. Thanks for your help, David On 6/6/2018 1:48 AM, Alan W. Irwin wrote: > On 2018-05-25 15:37-0400 David Bergman wrote: > >> Alan, >> >> I regret waiting this long to reply but have had a lot of work. >> To tell you the truth I am not sure what exactly caused the issue but >> I've deleted the "wxOVERRIDE" from the code, which was clearly a >> copy-paste from a wxWidgets example. >> >> I copied the simple.cpp code into the PLplot-Widgets example. >> >> cmake and nmake both ran find but cmake install generated the >> following fatal error. Recall that I had quite a bit of trouble >> getting it to install the first time and I may have missed an option >> that is required. Not sure if my error is due to the same issue that >> caused your error. >> >> >> Install the project... >> -- Install configuration: "Debug" >> -- Installing: C:/Program Files (x86)/plplot/share/doc/plplot/ABOUT >> CMake Error at cmake_install.cmake:39 (file): >> file INSTALL cannot copy file "C:/plplot-5.13.0/ABOUT" to >> "C:/Program Files >> (x86)/plplot/share/doc/plplot/ABOUT". >> >> >> NMAKE : fatal error U1077: 'echo' : return code '0x1' >> Stop. > > Hi David: > > In my case, it was configuration of a new computer which kept me from > replying to what you said above in a timely way. My apologies for that > delay. But that new computer configuration has now been a success (I > am writing this from the new computer and PLplot also builds > on that new computer) so I now have a chance to answer you. > > I think the nmake trouble you are having is due to the (default) > install prefix > "C:/Program Files (x86)" having a blank in the path. I think all > those "blank in > path" issues are now gone in the git version of PLplot so please try > that not > only for that reason but also because that is the version of PLplot I > test with > in any case. > > I tried a similar test (copying simple.cpp on top of > examples/c++/wxPLplotDemo.cpp) here, > but in my case I configured PLplot with the cmake option > -DBUILD_TEST=ON which > allows users to test in the build tree without having to install. The > result on > my new Debian Buster platform was I could build and run simple.cpp using > "make test_wxPLplotDemo". That test had two key warnings which were > > Gtk-Message: 22:23:32.181: GtkDialog mapped without a transient > parent. This is discouraged. > > on the command line + a dialog box with the following contents: > > "Somehow we attempted to plot before the wxPLplotwindow was ready. > The plot will not be drawn". > > And indeed that was followed by a blank plot. So it appears your > simple.cpp is still > not set up correctly for the Linux case. > > I have put this thread back on the plplot-general list because Phil > Rosenberg, the author of the PLplot wxwidgets binding and device may > wish to comment since he had similar "waiting for events" trouble in > the past on Linux which might be related to what I am seeing on Linux > with > the current simple.cpp. > > Alan > __________________________ > Alan W. Irwin > > Astronomical research affiliation with Department of Physics and > Astronomy, > University of Victoria (astrowww.phys.uvic.ca). > > Programming affiliations with the FreeEOS equation-of-state > implementation for stellar interiors (freeeos.sf.net); the Time > Ephemerides project (timeephem.sf.net); PLplot scientific plotting > software package (plplot.sf.net); the libLASi project > (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); > and the Linux Brochure Project (lbproject.sf.net). > __________________________ > > Linux-powered Science > __________________________ --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus |
|
From: Phil R. <p.d...@gm...> - 2018-06-07 13:55:51
|
Hi David Sorry, I haven't replied - I've been away and off email for close to a month. Anyway - the problem is that when you create your wxPLplotwindow using the default constructor it gets a size of wxDefaultSize at initialisation. This is 20x20 pixels on my Windows system. PLPlot then uses this size along with the DPI to calculate the most appropriate text size, which comes out at I think about 0.3 mm. This is converted to a pt size and used to create a wxFont. One of either of the following is happening wxFont only accepts integers for pt size and the pt size is less than 1 so gets rounded down to 0 and no text is drawn, or the text is sortof there, but it is so small it doesn't actually show up. The easiest workaround is to specify a size at construction time - this will change when your frame actually sorts out the sizing of its child windows, but that's fine. So something like m_right = new wxPLplotwindow<wxPanel>(true, wxSize(800, 800)); works and the text displays. You should also be able to manually set the size using pls->schr() in your Plot function, but I've just quickly tried that and it didn't work. I'll try to investigate why. Hope that gets you going for now. Phil On 6 June 2018 at 13:01, David Bergman <stu...@gm...> wrote: > Alan, > > Thanks. It seems that we're making some progress. I am working on Windows > and I do not get the warning > "Somehow we attempted to plot before the wxPLplotwindow was ready. The plot > will not be drawn". > I get a plot with some missing elements. I've not tried to build or run in > Linux. > > Thanks for your help, > David > > > On 6/6/2018 1:48 AM, Alan W. Irwin wrote: >> >> On 2018-05-25 15:37-0400 David Bergman wrote: >> >>> Alan, >>> >>> I regret waiting this long to reply but have had a lot of work. >>> To tell you the truth I am not sure what exactly caused the issue but >>> I've deleted the "wxOVERRIDE" from the code, which was clearly a copy-paste >>> from a wxWidgets example. >>> >>> I copied the simple.cpp code into the PLplot-Widgets example. >>> >>> cmake and nmake both ran find but cmake install generated the following >>> fatal error. Recall that I had quite a bit of trouble getting it to install >>> the first time and I may have missed an option that is required. Not sure >>> if my error is due to the same issue that caused your error. >>> >>> >>> Install the project... >>> -- Install configuration: "Debug" >>> -- Installing: C:/Program Files (x86)/plplot/share/doc/plplot/ABOUT >>> CMake Error at cmake_install.cmake:39 (file): >>> file INSTALL cannot copy file "C:/plplot-5.13.0/ABOUT" to "C:/Program >>> Files >>> (x86)/plplot/share/doc/plplot/ABOUT". >>> >>> >>> NMAKE : fatal error U1077: 'echo' : return code '0x1' >>> Stop. >> >> >> Hi David: >> >> In my case, it was configuration of a new computer which kept me from >> replying to what you said above in a timely way. My apologies for that >> delay. But that new computer configuration has now been a success (I >> am writing this from the new computer and PLplot also builds >> on that new computer) so I now have a chance to answer you. >> >> I think the nmake trouble you are having is due to the (default) install >> prefix >> "C:/Program Files (x86)" having a blank in the path. I think all those >> "blank in >> path" issues are now gone in the git version of PLplot so please try that >> not >> only for that reason but also because that is the version of PLplot I test >> with >> in any case. >> >> I tried a similar test (copying simple.cpp on top of >> examples/c++/wxPLplotDemo.cpp) here, >> but in my case I configured PLplot with the cmake option -DBUILD_TEST=ON >> which >> allows users to test in the build tree without having to install. The >> result on >> my new Debian Buster platform was I could build and run simple.cpp using >> "make test_wxPLplotDemo". That test had two key warnings which were >> >> Gtk-Message: 22:23:32.181: GtkDialog mapped without a transient parent. >> This is discouraged. >> >> on the command line + a dialog box with the following contents: >> >> "Somehow we attempted to plot before the wxPLplotwindow was ready. The >> plot will not be drawn". >> >> And indeed that was followed by a blank plot. So it appears your >> simple.cpp is still >> not set up correctly for the Linux case. >> >> I have put this thread back on the plplot-general list because Phil >> Rosenberg, the author of the PLplot wxwidgets binding and device may >> wish to comment since he had similar "waiting for events" trouble in >> the past on Linux which might be related to what I am seeing on Linux with >> the current simple.cpp. >> >> Alan >> __________________________ >> Alan W. Irwin >> >> Astronomical research affiliation with Department of Physics and >> Astronomy, >> University of Victoria (astrowww.phys.uvic.ca). >> >> Programming affiliations with the FreeEOS equation-of-state >> implementation for stellar interiors (freeeos.sf.net); the Time >> Ephemerides project (timeephem.sf.net); PLplot scientific plotting >> software package (plplot.sf.net); the libLASi project >> (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); >> and the Linux Brochure Project (lbproject.sf.net). >> __________________________ >> >> Linux-powered Science >> __________________________ > > > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Plplot-general mailing list > Plp...@li... > https://lists.sourceforge.net/lists/listinfo/plplot-general |
|
From: Phil R. <p.d...@gm...> - 2018-06-07 14:46:29
|
Hi David again
Just to let you know that a way to get the automatic text sizing to
work correctly without specifying an initial size for your window
would be to wait until the window is displayed to call your Plot
routine. You could do this by catching the first resize event or first
paint event and calling Plot at that point.
Or if you wish to manually set text size you should note that
pls->adv() and pls->env() (which calls plsadv()) reset the size to
what plplot thinks is the best. Hence you must do the work of
pls->env() manually. In your case, replace pls->env() with
pls->clear();
pls->vsta();
pls->wind(xmin, xmax, ymin, ymax);
pls->schr(5.0, 1.0);
plbox("bcnst", (PLFLT) 0.0, 0, "bcnstv", (PLFLT) 0.0, 0);
pls->schr(8.0, 1.0);
pls->lab("x", "y", "sin(x)/x");
replacing the values 5.0 and 8.0 witht he size you want your numbers
and labels (in mm).
On 7 June 2018 at 14:55, Phil Rosenberg <p.d...@gm...> wrote:
> Hi David
> Sorry, I haven't replied - I've been away and off email for close to a month.
>
> Anyway - the problem is that when you create your wxPLplotwindow using
> the default constructor it gets a size of wxDefaultSize at
> initialisation. This is 20x20 pixels on my Windows system. PLPlot then
> uses this size along with the DPI to calculate the most appropriate
> text size, which comes out at I think about 0.3 mm. This is converted
> to a pt size and used to create a wxFont. One of either of the
> following is happening wxFont only accepts integers for pt size and
> the pt size is less than 1 so gets rounded down to 0 and no text is
> drawn, or the text is sortof there, but it is so small it doesn't
> actually show up.
>
> The easiest workaround is to specify a size at construction time -
> this will change when your frame actually sorts out the sizing of its
> child windows, but that's fine. So something like
>
> m_right = new wxPLplotwindow<wxPanel>(true, wxSize(800, 800));
>
> works and the text displays.
>
> You should also be able to manually set the size using pls->schr() in
> your Plot function, but I've just quickly tried that and it didn't
> work. I'll try to investigate why.
>
> Hope that gets you going for now.
>
> Phil
>
>
>
> On 6 June 2018 at 13:01, David Bergman <stu...@gm...> wrote:
>> Alan,
>>
>> Thanks. It seems that we're making some progress. I am working on Windows
>> and I do not get the warning
>> "Somehow we attempted to plot before the wxPLplotwindow was ready. The plot
>> will not be drawn".
>> I get a plot with some missing elements. I've not tried to build or run in
>> Linux.
>>
>> Thanks for your help,
>> David
>>
>>
>> On 6/6/2018 1:48 AM, Alan W. Irwin wrote:
>>>
>>> On 2018-05-25 15:37-0400 David Bergman wrote:
>>>
>>>> Alan,
>>>>
>>>> I regret waiting this long to reply but have had a lot of work.
>>>> To tell you the truth I am not sure what exactly caused the issue but
>>>> I've deleted the "wxOVERRIDE" from the code, which was clearly a copy-paste
>>>> from a wxWidgets example.
>>>>
>>>> I copied the simple.cpp code into the PLplot-Widgets example.
>>>>
>>>> cmake and nmake both ran find but cmake install generated the following
>>>> fatal error. Recall that I had quite a bit of trouble getting it to install
>>>> the first time and I may have missed an option that is required. Not sure
>>>> if my error is due to the same issue that caused your error.
>>>>
>>>>
>>>> Install the project...
>>>> -- Install configuration: "Debug"
>>>> -- Installing: C:/Program Files (x86)/plplot/share/doc/plplot/ABOUT
>>>> CMake Error at cmake_install.cmake:39 (file):
>>>> file INSTALL cannot copy file "C:/plplot-5.13.0/ABOUT" to "C:/Program
>>>> Files
>>>> (x86)/plplot/share/doc/plplot/ABOUT".
>>>>
>>>>
>>>> NMAKE : fatal error U1077: 'echo' : return code '0x1'
>>>> Stop.
>>>
>>>
>>> Hi David:
>>>
>>> In my case, it was configuration of a new computer which kept me from
>>> replying to what you said above in a timely way. My apologies for that
>>> delay. But that new computer configuration has now been a success (I
>>> am writing this from the new computer and PLplot also builds
>>> on that new computer) so I now have a chance to answer you.
>>>
>>> I think the nmake trouble you are having is due to the (default) install
>>> prefix
>>> "C:/Program Files (x86)" having a blank in the path. I think all those
>>> "blank in
>>> path" issues are now gone in the git version of PLplot so please try that
>>> not
>>> only for that reason but also because that is the version of PLplot I test
>>> with
>>> in any case.
>>>
>>> I tried a similar test (copying simple.cpp on top of
>>> examples/c++/wxPLplotDemo.cpp) here,
>>> but in my case I configured PLplot with the cmake option -DBUILD_TEST=ON
>>> which
>>> allows users to test in the build tree without having to install. The
>>> result on
>>> my new Debian Buster platform was I could build and run simple.cpp using
>>> "make test_wxPLplotDemo". That test had two key warnings which were
>>>
>>> Gtk-Message: 22:23:32.181: GtkDialog mapped without a transient parent.
>>> This is discouraged.
>>>
>>> on the command line + a dialog box with the following contents:
>>>
>>> "Somehow we attempted to plot before the wxPLplotwindow was ready. The
>>> plot will not be drawn".
>>>
>>> And indeed that was followed by a blank plot. So it appears your
>>> simple.cpp is still
>>> not set up correctly for the Linux case.
>>>
>>> I have put this thread back on the plplot-general list because Phil
>>> Rosenberg, the author of the PLplot wxwidgets binding and device may
>>> wish to comment since he had similar "waiting for events" trouble in
>>> the past on Linux which might be related to what I am seeing on Linux with
>>> the current simple.cpp.
>>>
>>> Alan
>>> __________________________
>>> Alan W. Irwin
>>>
>>> Astronomical research affiliation with Department of Physics and
>>> Astronomy,
>>> University of Victoria (astrowww.phys.uvic.ca).
>>>
>>> Programming affiliations with the FreeEOS equation-of-state
>>> implementation for stellar interiors (freeeos.sf.net); the Time
>>> Ephemerides project (timeephem.sf.net); PLplot scientific plotting
>>> software package (plplot.sf.net); the libLASi project
>>> (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
>>> and the Linux Brochure Project (lbproject.sf.net).
>>> __________________________
>>>
>>> Linux-powered Science
>>> __________________________
>>
>>
>>
>> ---
>> This email has been checked for viruses by Avast antivirus software.
>> https://www.avast.com/antivirus
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Plplot-general mailing list
>> Plp...@li...
>> https://lists.sourceforge.net/lists/listinfo/plplot-general
|
|
From: David B. <dav...@ya...> - 2018-06-07 16:02:14
|
Phil,
Thank you very much for the help. I will try these edits and see how it goes.As for specifying the size of the window (as per your last email). I've shied away from that as it screwed up the splitter windows construction I had.This suggestion looks like the best route, will let you know how it works.David
On Thursday, June 7, 2018, 10:46:44 AM EDT, Phil Rosenberg <p.d...@gm...> wrote:
Hi David again
Just to let you know that a way to get the automatic text sizing to
work correctly without specifying an initial size for your window
would be to wait until the window is displayed to call your Plot
routine. You could do this by catching the first resize event or first
paint event and calling Plot at that point.
Or if you wish to manually set text size you should note that
pls->adv() and pls->env() (which calls plsadv()) reset the size to
what plplot thinks is the best. Hence you must do the work of
pls->env() manually. In your case, replace pls->env() with
pls->clear();
pls->vsta();
pls->wind(xmin, xmax, ymin, ymax);
pls->schr(5.0, 1.0);
plbox("bcnst", (PLFLT) 0.0, 0, "bcnstv", (PLFLT) 0.0, 0);
pls->schr(8.0, 1.0);
pls->lab("x", "y", "sin(x)/x");
replacing the values 5.0 and 8.0 witht he size you want your numbers
and labels (in mm).
On 7 June 2018 at 14:55, Phil Rosenberg <p.d...@gm...> wrote:
> Hi David
> Sorry, I haven't replied - I've been away and off email for close to a month.
>
> Anyway - the problem is that when you create your wxPLplotwindow using
> the default constructor it gets a size of wxDefaultSize at
> initialisation. This is 20x20 pixels on my Windows system. PLPlot then
> uses this size along with the DPI to calculate the most appropriate
> text size, which comes out at I think about 0.3 mm. This is converted
> to a pt size and used to create a wxFont. One of either of the
> following is happening wxFont only accepts integers for pt size and
> the pt size is less than 1 so gets rounded down to 0 and no text is
> drawn, or the text is sortof there, but it is so small it doesn't
> actually show up.
>
> The easiest workaround is to specify a size at construction time -
> this will change when your frame actually sorts out the sizing of its
> child windows, but that's fine. So something like
>
> m_right = new wxPLplotwindow<wxPanel>(true, wxSize(800, 800));
>
> works and the text displays.
>
> You should also be able to manually set the size using pls->schr() in
> your Plot function, but I've just quickly tried that and it didn't
> work. I'll try to investigate why.
>
> Hope that gets you going for now.
>
> Phil
>
>
>
> On 6 June 2018 at 13:01, David Bergman <stu...@gm...> wrote:
>> Alan,
>>
>> Thanks. It seems that we're making some progress. I am working on Windows
>> and I do not get the warning
>> "Somehow we attempted to plot before the wxPLplotwindow was ready. The plot
>> will not be drawn".
>> I get a plot with some missing elements. I've not tried to build or run in
>> Linux.
>>
>> Thanks for your help,
>> David
>>
>>
>> On 6/6/2018 1:48 AM, Alan W. Irwin wrote:
>>>
>>> On 2018-05-25 15:37-0400 David Bergman wrote:
>>>
>>>> Alan,
>>>>
>>>> I regret waiting this long to reply but have had a lot of work.
>>>> To tell you the truth I am not sure what exactly caused the issue but
>>>> I've deleted the "wxOVERRIDE" from the code, which was clearly a copy-paste
>>>> from a wxWidgets example.
>>>>
>>>> I copied the simple.cpp code into the PLplot-Widgets example.
>>>>
>>>> cmake and nmake both ran find but cmake install generated the following
>>>> fatal error. Recall that I had quite a bit of trouble getting it to install
>>>> the first time and I may have missed an option that is required. Not sure
>>>> if my error is due to the same issue that caused your error.
>>>>
>>>>
>>>> Install the project...
>>>> -- Install configuration: "Debug"
>>>> -- Installing: C:/Program Files (x86)/plplot/share/doc/plplot/ABOUT
>>>> CMake Error at cmake_install.cmake:39 (file):
>>>> file INSTALL cannot copy file "C:/plplot-5.13.0/ABOUT" to "C:/Program
>>>> Files
>>>> (x86)/plplot/share/doc/plplot/ABOUT".
>>>>
>>>>
>>>> NMAKE : fatal error U1077: 'echo' : return code '0x1'
>>>> Stop.
>>>
>>>
>>> Hi David:
>>>
>>> In my case, it was configuration of a new computer which kept me from
>>> replying to what you said above in a timely way. My apologies for that
>>> delay. But that new computer configuration has now been a success (I
>>> am writing this from the new computer and PLplot also builds
>>> on that new computer) so I now have a chance to answer you.
>>>
>>> I think the nmake trouble you are having is due to the (default) install
>>> prefix
>>> "C:/Program Files (x86)" having a blank in the path. I think all those
>>> "blank in
>>> path" issues are now gone in the git version of PLplot so please try that
>>> not
>>> only for that reason but also because that is the version of PLplot I test
>>> with
>>> in any case.
>>>
>>> I tried a similar test (copying simple.cpp on top of
>>> examples/c++/wxPLplotDemo.cpp) here,
>>> but in my case I configured PLplot with the cmake option -DBUILD_TEST=ON
>>> which
>>> allows users to test in the build tree without having to install. The
>>> result on
>>> my new Debian Buster platform was I could build and run simple.cpp using
>>> "make test_wxPLplotDemo". That test had two key warnings which were
>>>
>>> Gtk-Message: 22:23:32.181: GtkDialog mapped without a transient parent.
>>> This is discouraged.
>>>
>>> on the command line + a dialog box with the following contents:
>>>
>>> "Somehow we attempted to plot before the wxPLplotwindow was ready. The
>>> plot will not be drawn".
>>>
>>> And indeed that was followed by a blank plot. So it appears your
>>> simple.cpp is still
>>> not set up correctly for the Linux case.
>>>
>>> I have put this thread back on the plplot-general list because Phil
>>> Rosenberg, the author of the PLplot wxwidgets binding and device may
>>> wish to comment since he had similar "waiting for events" trouble in
>>> the past on Linux which might be related to what I am seeing on Linux with
>>> the current simple.cpp.
>>>
>>> Alan
>>> __________________________
>>> Alan W. Irwin
>>>
>>> Astronomical research affiliation with Department of Physics and
>>> Astronomy,
>>> University of Victoria (astrowww.phys.uvic.ca).
>>>
>>> Programming affiliations with the FreeEOS equation-of-state
>>> implementation for stellar interiors (freeeos.sf.net); the Time
>>> Ephemerides project (timeephem.sf.net); PLplot scientific plotting
>>> software package (plplot.sf.net); the libLASi project
>>> (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
>>> and the Linux Brochure Project (lbproject.sf.net).
>>> __________________________
>>>
>>> Linux-powered Science
>>> __________________________
>>
>>
>>
>> ---
>> This email has been checked for viruses by Avast antivirus software.
>> https://www.avast.com/antivirus
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Plplot-general mailing list
>> Plp...@li...
>> https://lists.sourceforge.net/lists/listinfo/plplot-general
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Plplot-general mailing list
Plp...@li...
https://lists.sourceforge.net/lists/listinfo/plplot-general
|
|
From: David B. <stu...@gm...> - 2018-06-15 19:14:53
|
Phil,
Thanks for your help. I just tried both suggestions and the use of
wxSize(800, 800) forked but the suggestion below did not.
I will try and forge ahead but I had ran into an issue with nested
splitter windows not resizing correctly and the wxWidgets community
suggested fix was to never use wxSize, always use default, i.e. no
manual setting of arguments.
Admittedly I am new to PLplot and while I've been using wxWdgets for a
while now this new project has me expanding my repertoire. I have been
using the examples provided but simple changes lead to strange results.
It is not my intent to waste your time and I appreciate your help. I
ask only when I've tried several times and read the PLplot manual. I
think that will be my weekend reading.
David
On 6/7/2018 10:46 AM, Phil Rosenberg wrote:
> Hi David again
>
> Just to let you know that a way to get the automatic text sizing to
> work correctly without specifying an initial size for your window
> would be to wait until the window is displayed to call your Plot
> routine. You could do this by catching the first resize event or first
> paint event and calling Plot at that point.
>
> Or if you wish to manually set text size you should note that
> pls->adv() and pls->env() (which calls plsadv()) reset the size to
> what plplot thinks is the best. Hence you must do the work of
> pls->env() manually. In your case, replace pls->env() with
>
> pls->clear();
> pls->vsta();
> pls->wind(xmin, xmax, ymin, ymax);
> pls->schr(5.0, 1.0);
> plbox("bcnst", (PLFLT) 0.0, 0, "bcnstv", (PLFLT) 0.0, 0);
> pls->schr(8.0, 1.0);
> pls->lab("x", "y", "sin(x)/x");
>
> replacing the values 5.0 and 8.0 witht he size you want your numbers
> and labels (in mm).
>
> On 7 June 2018 at 14:55, Phil Rosenberg <p.d...@gm...> wrote:
>> Hi David
>> Sorry, I haven't replied - I've been away and off email for close to a month.
>>
>> Anyway - the problem is that when you create your wxPLplotwindow using
>> the default constructor it gets a size of wxDefaultSize at
>> initialisation. This is 20x20 pixels on my Windows system. PLPlot then
>> uses this size along with the DPI to calculate the most appropriate
>> text size, which comes out at I think about 0.3 mm. This is converted
>> to a pt size and used to create a wxFont. One of either of the
>> following is happening wxFont only accepts integers for pt size and
>> the pt size is less than 1 so gets rounded down to 0 and no text is
>> drawn, or the text is sortof there, but it is so small it doesn't
>> actually show up.
>>
>> The easiest workaround is to specify a size at construction time -
>> this will change when your frame actually sorts out the sizing of its
>> child windows, but that's fine. So something like
>>
>> m_right = new wxPLplotwindow<wxPanel>(true, wxSize(800, 800));
>>
>> works and the text displays.
>>
>> You should also be able to manually set the size using pls->schr() in
>> your Plot function, but I've just quickly tried that and it didn't
>> work. I'll try to investigate why.
>>
>> Hope that gets you going for now.
>>
>> Phil
>>
>>
>>
>> On 6 June 2018 at 13:01, David Bergman <stu...@gm...> wrote:
>>> Alan,
>>>
>>> Thanks. It seems that we're making some progress. I am working on Windows
>>> and I do not get the warning
>>> "Somehow we attempted to plot before the wxPLplotwindow was ready. The plot
>>> will not be drawn".
>>> I get a plot with some missing elements. I've not tried to build or run in
>>> Linux.
>>>
>>> Thanks for your help,
>>> David
>>>
>>>
>>> On 6/6/2018 1:48 AM, Alan W. Irwin wrote:
>>>> On 2018-05-25 15:37-0400 David Bergman wrote:
>>>>
>>>>> Alan,
>>>>>
>>>>> I regret waiting this long to reply but have had a lot of work.
>>>>> To tell you the truth I am not sure what exactly caused the issue but
>>>>> I've deleted the "wxOVERRIDE" from the code, which was clearly a copy-paste
>>>>> from a wxWidgets example.
>>>>>
>>>>> I copied the simple.cpp code into the PLplot-Widgets example.
>>>>>
>>>>> cmake and nmake both ran find but cmake install generated the following
>>>>> fatal error. Recall that I had quite a bit of trouble getting it to install
>>>>> the first time and I may have missed an option that is required. Not sure
>>>>> if my error is due to the same issue that caused your error.
>>>>>
>>>>>
>>>>> Install the project...
>>>>> -- Install configuration: "Debug"
>>>>> -- Installing: C:/Program Files (x86)/plplot/share/doc/plplot/ABOUT
>>>>> CMake Error at cmake_install.cmake:39 (file):
>>>>> file INSTALL cannot copy file "C:/plplot-5.13.0/ABOUT" to "C:/Program
>>>>> Files
>>>>> (x86)/plplot/share/doc/plplot/ABOUT".
>>>>>
>>>>>
>>>>> NMAKE : fatal error U1077: 'echo' : return code '0x1'
>>>>> Stop.
>>>>
>>>> Hi David:
>>>>
>>>> In my case, it was configuration of a new computer which kept me from
>>>> replying to what you said above in a timely way. My apologies for that
>>>> delay. But that new computer configuration has now been a success (I
>>>> am writing this from the new computer and PLplot also builds
>>>> on that new computer) so I now have a chance to answer you.
>>>>
>>>> I think the nmake trouble you are having is due to the (default) install
>>>> prefix
>>>> "C:/Program Files (x86)" having a blank in the path. I think all those
>>>> "blank in
>>>> path" issues are now gone in the git version of PLplot so please try that
>>>> not
>>>> only for that reason but also because that is the version of PLplot I test
>>>> with
>>>> in any case.
>>>>
>>>> I tried a similar test (copying simple.cpp on top of
>>>> examples/c++/wxPLplotDemo.cpp) here,
>>>> but in my case I configured PLplot with the cmake option -DBUILD_TEST=ON
>>>> which
>>>> allows users to test in the build tree without having to install. The
>>>> result on
>>>> my new Debian Buster platform was I could build and run simple.cpp using
>>>> "make test_wxPLplotDemo". That test had two key warnings which were
>>>>
>>>> Gtk-Message: 22:23:32.181: GtkDialog mapped without a transient parent.
>>>> This is discouraged.
>>>>
>>>> on the command line + a dialog box with the following contents:
>>>>
>>>> "Somehow we attempted to plot before the wxPLplotwindow was ready. The
>>>> plot will not be drawn".
>>>>
>>>> And indeed that was followed by a blank plot. So it appears your
>>>> simple.cpp is still
>>>> not set up correctly for the Linux case.
>>>>
>>>> I have put this thread back on the plplot-general list because Phil
>>>> Rosenberg, the author of the PLplot wxwidgets binding and device may
>>>> wish to comment since he had similar "waiting for events" trouble in
>>>> the past on Linux which might be related to what I am seeing on Linux with
>>>> the current simple.cpp.
>>>>
>>>> Alan
>>>> __________________________
>>>> Alan W. Irwin
>>>>
>>>> Astronomical research affiliation with Department of Physics and
>>>> Astronomy,
>>>> University of Victoria (astrowww.phys.uvic.ca).
>>>>
>>>> Programming affiliations with the FreeEOS equation-of-state
>>>> implementation for stellar interiors (freeeos.sf.net); the Time
>>>> Ephemerides project (timeephem.sf.net); PLplot scientific plotting
>>>> software package (plplot.sf.net); the libLASi project
>>>> (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
>>>> and the Linux Brochure Project (lbproject.sf.net).
>>>> __________________________
>>>>
>>>> Linux-powered Science
>>>> __________________________
>>>
>>>
>>> ---
>>> This email has been checked for viruses by Avast antivirus software.
>>> https://www.avast.com/antivirus
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Plplot-general mailing list
>>> Plp...@li...
>>> https://lists.sourceforge.net/lists/listinfo/plplot-general
|