On Tue, Nov 18, 2008 at 11:19:23PM -0800, Alan Irwin wrote:
> Hi Jerry:
> 
> I changed the subject line again since this is a separate issue from
> antialiasing.
> 
> On 2008-11-18 22:05-0700 Jerry wrote:
> 
> > [...]I notice that in the SVG file, all of the tick marks are drawn
> > twice.
> 
> I tried the following python test code in the installed examples/python
> directory to confirm this issue.
> 
> #!/usr/bin/env python
> 
> # Append to effective python path so that can find plplot modules.
> from plplot_python_start import *
> 
> import sys
> from plplot import *
> 
> # Parse and process command line arguments
> plparseopts(sys.argv, PL_PARSE_FULL)
> 
> # Initialize plplot
> plinit()
> 
> pladv(0)
> plvpor(0.1, 0.9, 0.1, 0.9)
> plwind(0.1, 0.9, 0.1, 0.9)
> plbox("bct", 0.7, 0, "bc", 0.7, 0)
> 
> # Terminate plplot
> plend()
> 
> The resulting fragment of the svg file that draws one of the tick marks is
> 
>      <polyline
>        stroke-width="1"
>        stroke="#FF0000"
>        stroke-opacity="1.000000"
>        fill="none"
>        points="503.98,54.01 503.98,63.46"
>        />
>      <polyline
>        stroke-width="1"
>        stroke="#FF0000"
>        stroke-opacity="1.000000"
>        fill="none"
>        points="503.98,63.46 503.98,54.01"
>        />
> 
> So it is clear the tick marks are drawn in one direction than redundantly in
> the reverse direction confirming Jerry's remark.  But if you look at the
> svg.c code, there is no code to reverse the stroke or anything like that. So
> the above redundant reverse stroke must be generated by the PLplot core
> using a redundant call to plD_polyline_svg with just two points (more than
> two points would generate a "points=" command with more than two points) or
> else the equivalent redundant call to plD_line_svg (which always draws a
> line between the two specified points).
> 
> In sum, these redundant reverse ticks appear to be generated in the PLplot
> core and not the device code. Could somebody with more knowledge of the
> PLplot core library than I have look further at this issue?
> 
> Also, notice how the XML format of the SVG results lends itself to
> diagnosing Plplot core issues like this.

If you look in plbox.c and at pl(xys)tik in pltick.c then it appears that
the axes and ticks are drawn as one line. For example, for the bottom of
the box you start in the bottom left corner, draw along to the first
tick mark then draw a line up/down and back, ending up on the axis, draw
the next segement of the line bounding the box and so on. 

To me this seems a slightly perverse way of doing it. Much cleaner would
be to draw the box and then mark on each tick separately. I assume there
was some logic behind this originally, perhaps it worked better for some
of the early drivers? It is hard to see how.

Anyway, I have changed plbox.c / pltick.c to implement my "more logical"
way of doing things. This removes the duplicate lines. Results look 
visually identical to before, but with slightly smaller file sizes for 
postscript (and presumable svg).

Andrew

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to