Re: [ROOT]: Markers

From: Robert Feuerbach (feuerbac@jlab.org)
Date: Fri Mar 26 2004 - 16:19:07 MET


Hi Matej,

If you are primarily interested in the postscript output, the
resultant postscript files can always be editted.

Below is a perl script I've used to replace the Marker-style 3
(asterisk) with a filled diamond, and 'enhanced' the marker 2 and
5 to be more solid, giving you a solid '+' and 'X'. This script
has been used with output from ROOT-3.05/04 and I believe should
still work with the output from TPostScript in ROOT-4.00/03.

I'm also looking forward to being able to define further symbols,
hopefully with an interface similar to what is available for
polylines, where TStyle::SetLineStyleString permits you to
define (for postscript output, anyway) a new dotted-dashed
pattern.

Good luck,
Rob Feuerbach

------------------------------------------------------------

#!/usr/bin/perl
#
# Robert Feuerbach, Jefferson Lab Mar 10, 2004
#
# Written and tested with the TPostscript output from ROOT 3.05/04
#
# Look through the postscript file for the definition of markers m2 and m5
# and replace, in the definition, the sequence " s}" by " 10 lw s 3 lw}"
# to change them from hairlines to more 'solid' figures.
# Also, replace the marker 3  (asterisk -- coded as m31) with a filled in
# diamond, taking the definition for m27 and making it solid, coded as marker m32.
#
#
# use as:
#   replace_symbols.pl file1.eps [ file2.eps ... ]
# the output file is file1_RPL.eps
#

if ($#ARGV <0) {
    print "Must specify filename(s)\n";
    exit;
}

$m32="";
while ( $file = pop @ARGV ) {
#$file = $ARGV[0];
    open(INPUT, $file) || die "Can't open $file : $!\n";
    $fileo = $file;
    $fileo =~ s/\.eps$/_RPL.eps/;
    print "input file is $file, output file is $fileo\n";
    open(OUT, ">".$fileo) || die "Can't open $fileo for output : $!\n";

    while ( <INPUT> ) {
	if ( /\/m2 / || /\/m5 / ) {
	    $outl = s/ s\}/ 10 lw s 3 lw\}/;
	}
	if ( /\/m27 / ) { # hollow diamond: save it to use for m32
	    $m32 = $_;
	    $m32 =~ s/\/m27 /\/m32 /;
	    $m32 =~ s/ s\}/ f\}/;
	    print OUT $m32;
	}
	s/ m31/ m32/g;
	print OUT $_;
    }

    close INPUT;
    close OUT;
}

--------------------------------------------------------
> >>Olivier Couet wrote:
> >>
> >>>Hi,
> >>>
> >>>No, it is not possible to define your own marker. Several makers have an
> >>>empty and a filled version but not that one, sorry. Defining a new marker
> >>>is not that easy because it should be described for X11, PS, PDF etc ...
> >>>So for the time being what you are requesting is not possible.
> >>>
> >>> Cheers, Olivier
> >>>
> >>>On Fri, 26 Mar 2004, matej batic wrote:
> >>>
> >>>
> >>>
> >>>>Is it possible to define new markers? Well, actually I would like to use
> >>>>marker no 27, but filled with color. How can one do that, if it is
> >>>>possible at all?
> >>>>Thanks in advance.
> >>>>matej
>

/***************************************************
 * Robert Feuerbach              feuerbac@jlab.org *
 * Jefferson Lab                CEBAF Center  A120 *
 * 12000 Jefferson Avenue   Office: (757) 269-7254 *
 * Mail Stop 12H              Page:       584-7254 *
 * Newport News, VA 23606      Fax: (757) 269-5703 *
 ***************************************************/



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:07 MET