Hi Arjen I had a look at this as well this morning and found the same thing, I thought I sent an email out, but I just found that email waiting in my drafts folder - oops. At least we found the same problem :-) I agree that the line rd_data( pls, &(pls->width), sizeof(pls->width); would be best as it makes things robust to later changes. Might be worth making similar changes to other reads.
Yes as you say once we have a confirmed workflow the solution can be pushed up to the repo. I also noticed some other potential problems though. Firstly in a really simple example that I used to debug - just a call to plinit, then plwidth then plreplot, a number of unrecognised commands were found when the buffer was read, which presumably shouldn't be the case. I thought these were caused by the bad read of the width, causing misalignment of the read pointer, but it turned out at least some remain after the fix. I also noticed that font changes don't seem to be logged in the buffer. I'm not sure if there is anything else that is missing, but perhaps we should look? Following on from this - does anyone use the buffer to write to file? I have vague recollections that there is an option to do so. If so then we might be causing ourselves issues. If the font is added to the buffer then older versions of the library that trys to read a more modern version of a file will see an unrecognised entry, not know how many bytes to read and will end up with a misaligned read pointer affecting the reading of the remainder of the file. The same would be true of the fixed width parameter. However I guess even now the options of PLFLT as a float or double mean the file would be ambiguous. By the way Arjen, just out of curiosity - you use VC++ and Windows, is that right? If so do you just use nmake or do you use the full VC++ IDE and debugger? Phil From: Arjen Markus <arjen.mar...@deltares.nl> To: Phil Rosenberg <philip_rosenb...@yahoo.com>; laurent Berger <laurent.ber...@univ-lemans.fr>; "plplot-devel@lists.sourceforge.net" <plplot-devel@lists.sourceforge.net> Sent: Friday, 15 August 2014, 10:42 Subject: RE: [Plplot-devel] About svg Hi Phil, With some additional analysis from Laurent we were able to track down the cause: The routine rd_data() in plbuf.c is reading a U_CHAR value, whereas the width has been changed to a floating-point number. Changing the type solves the problem: switch ( op ) { case PLSTATE_WIDTH: { PLFLT width; rd_data( pls, &width, sizeof ( PLFLT ) ); pls->width = width; plP_state( PLSTATE_WIDTH ); break; } (The companion wr_data uses pls->width directly.) Maybe we should recode this to: rd_data( pls, &(pls->width), sizeof(pls->width); so that the code is agnostic to the actual data type, just as wr_data() is. That is what I have done in my repository – next step: get knowledgeable about git ;). Regards, Arjen From:Phil Rosenberg [mailto:philip_rosenb...@yahoo.com] Sent: Friday, August 15, 2014 12:08 AM To: Arjen Markus; laurent Berger; plplot-devel@lists.sourceforge.net Subject: RE: [Plplot-devel] About svg Arjen might well be right about the replot function, or maybe the stored replot data. What happens if you resize a Plplot window? Does that also show problems? Phil From: Arjen Markus Sent: 14/08/2014 15:08 To: laurent Berger; plplot-devel@lists.sourceforge.net Subject: Re: [Plplot-devel] About svg Hi Laurent, The odd thing is that the SVG plots produced _directly_ with one of the standard examples shows all the right line widths. It must be that the replot function (called in plotwindow->SavePlot(..)) is faulty – the line width might not be set properly. It is not an area of Plplot I am familiar with though. (I am still trying to figure out where the pls->width(..) function is overloaded). Regards, Arjen > -----Original Message----- > From: laurent Berger [mailto:laurent.ber...@univ-lemans.fr] > Sent: Thursday, August 14, 2014 3:46 PM > To: plplot-devel@lists.sourceforge.net > Subject: Re: [Plplot-devel] About svg > > Thanks you for your answer. > plplot 5.9.10, wxwidgets 3.0.0 visual studio 2012 C++ with pls->width( 2.0 > ); nothing > changes. > You can download source file and svg, ps and xfig here : > perso.univ-lemans.fr/~berger/aqzersPLPLOT > My source code is : > wxPLplotstream* pls=plotwindow->GetStream(); int iMin=0,iMax=16383; > > const size_t np=65536; > if (x[0]==NULL) > for (int i=0;i<3;i++) > { > x[i]=new PLFLT[np]; > y[i]=new PLFLT[np]; > yFiltre[i]=new PLFLT[np]; > } > PLFLT xmin=iMin, xmax=iMax; > PLFLT ymin=1e30, ymax=-1e30; > .... > > pls->adv( 0 ); > pls->scol0 ( 3, 0,0,255); > pls->scol0 ( 4, 0,0,128); > pls->scol0 ( 5, 0,255,0); > pls->scol0 ( 6, 0,128,0); > pls->scol0 ( 7, 255,0,0); > pls->scol0 ( 8, 128,0,0); > > if(bgcolor) > { > pls->scol0( 0, 255, 255, 255 ); > pls->scol0( 15, 0, 0, 0 ); > } > else > { > pls->scol0( 15, 255, 255, 255 ); > pls->scol0( 0, 0, 0, 0 ); > } > pls->col0( 1 ); > pls->env( xmin, xmax, ymin*.99, ymax*1.01, 0, 0 ); col0( 2 ); lab( "x", > pls->"y", "Histogram"); > for (int j=0;j<nbPlan;j++) > { > pls->col0( 3+2*j); > pls->width( 2.0 ); > pls->line( nbGraines[j], x[j], y[j] ); > pls->col0( 4+2*j); > pls->width( 3.0 ); > pls->line( nbGraines[j], x[j], yFiltre[j] ); > } > pls->RenewPlot(); > Refresh(); > plotwindow->SavePlot(wxString("svg"),wxString("tt.svg")); > plotwindow->SavePlot(wxString("xfig"),wxString("tt.xfig")); > plotwindow->SavePlot(wxString("ps"),wxString("tt.ps")); > //plotwindow->SavePlot(wxString("wxpng"),wxString("tt.png")); BUG > > > ------------------------------------------------------------------------------ > _______________________________________________ > Plplot-devel mailing list > Plplot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/plplot-devel > DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail. DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail.
------------------------------------------------------------------------------
_______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel