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:[email protected]]
Sent: Friday, August 15, 2014 12:08 AM
To: Arjen Markus; laurent Berger; [email protected]
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<mailto:[email protected]>
Sent: 14/08/2014 15:08
To: laurent Berger<mailto:[email protected]>;
[email protected]<mailto:[email protected]>
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:[email protected]]
> Sent: Thursday, August 14, 2014 3:46 PM
> To: [email protected]
> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel