My Community

General Category => Tips and Tutorials => Topic started by: Ron D. on January 01, 2015, 01:48:16 AM

Title: UPDATED: Accentuating individual lines in an exported plot
Post by: Ron D. on January 01, 2015, 01:48:16 AM
UPDATE: Sliver v1.4 includes a feature to thicken selected lines in the PC Plot. In a PDF export, these lines will be plotted with a specific thickness you can specify in the Options-->PostScript/PDF Settings menu option. These lines are also rendered completely opaque regardless of the alpha transparency setting, and are drawn on top of the other lines for easier viewing.

Have a look at this PDF export (it's much better to download and open it rather than open it in your browser):

http://www.sliversoftware.com/Downloads/MarkPlaceAtSplitsNoHalfTop2000Finishers_101714v1.pdf (http://www.sliversoftware.com/Download/MarkPlaceAtSplitsNoHalfTop2000Finishers_101714v1.pdf)

It's a PC plot of the Overall Place at each split for the top 2000 finishers of the 2014 Berlin Marathon. The person I made this for (Mark) is represented by the dark blue solid polyline on top of the other semi-transparent polylines. To accentuate the visibility of his trace, after the export I directly edited the PostScript file created as an intermediate step to the PDF, and then created a new PDF from this edited PS file using Acrobat Distiller.

I've also attached this edited PostScript file, which you can download and then open in a text editor. (Yes, Sliver writes every line of this file...).

http://www.sliversoftware.com/Downloads/MarkPlaceAtSplitsNoHalfTop2000Finishers_101714v1.ps (http://www.sliversoftware.com/Download/MarkPlaceAtSplitsNoHalfTop2000Finishers_101714v1.ps)

I knew Mark's final place in the race, so before I exported the PC plot I located his polyline on it by selecting the menu option Plots-->Display Values on Mouse-Over, zooming into the last scale of the PC plot, and moving the mouse until the highlighted polyline displayed his final place value on that scale. Then I swiped that line to select it and color brushed it in white.

When the setting for displaying values on mouse-over is enabled, each highlighted line is brought to the front, which can mess up the plotting order of brushes, e.g., if you range brushed an axis and you want the default blue plotted first and red last. So after zooming, selecting and coloring the desired line white it's a good idea to zoom out again and use the Brushes-->Show/Hide/Recolor Brushes menu option to first hide all the brushes and then show them again one at a time in the order you want the brushes plotted. Then you can export the plot to PDF.

After the export I opened the PS file and located the following two text  lines:

1.0000 1.0000 1.0000 setrgbcolor
1.9519 7.4915 m 4.8659 7.2346 l 7.7799 6.5696 l 10.6939 6.2900 l 13.6079 5.8743 l 16.5219 5.4965 l 19.4359 4.7483 l 22.3499 3.7734 l 25.2639 3.4787 l s

The first line is the command to set the color to white, and the next line is to draw a polyline between coordinates in the PDF file. So this is Mark's trace. I moved these two text lines to later in the file after the transparency was set back to none, and I added text lines to set the linewidth of that line wider than that which was specified for the other lines at the start of the file (derived from the export settings). I also set the color to pure blue. The final text is

[ /CA 1.0 /BM /Normal /SetTransparency pdfmark
[ /ca 1.0 /BM /Normal /SetTransparency pdfmark
% Mark's Trace.
0.03 setlinewidth
0.0000 0.0000 1.0000 setrgbcolor
% 1.0000 1.0000 1.0000 setrgbcolor
1.9519 7.4915 m 4.8659 7.2346 l 7.7799 6.5696 l 10.6939 6.2900 l 13.6079 5.8743 l 16.5219 5.4965 l 19.4359 4.7483 l 22.3499 3.7734 l 25.2639 3.4787 l s

where the % at the start of a line indicates it is commented out. The fact that this polyline is listed last also means it is plotted on top of the other polylines. Opening this PS file in Acrobat Distiller (a double-click for me) then creates the PDF with Mark's trace nicely accented relative to all the others.

Ron