[Rivet] PSTrick on ratio-only plots

Simon Paul Berlendis simon.paul.berlendis at cern.ch
Fri Sep 2 17:09:11 BST 2016


 Hi Andy,

Unfortunately, my knowledge on the code in too poor to fill this task...
However, I still tried to have a look at the code and I have the impression that all happens in line 1077 of make-plots.
But I have no idea what to change in order to make the coordinate proportional to the canvas...

 Cheers, Simon.

    def draw(self,coors):
        out = ""
        out += ('\n%\n% Special\n%\n')
        import re
        regex = re.compile(r'^(.*?)(\\physics[xy]?coor)\(\s?([0-9\.eE+-]+)\s?,\s?([0-9\.eE+-]+)\s?\)(.*)')
        # TODO: More precise number string matching, something like this:
        # num = r"-?[0-9]*(?:\.[0-9]*)(?:[eE][+-]?\d+]"
        # regex = re.compile(r'^(.*?)(\\physics[xy]?coor)\(\s?(' + num + ')\s?,\s?(' + num + ')\s?\)(.*)')
        for i in xrange(len(self.data)):
            while regex.search(self.data[i]):
                match = regex.search(self.data[i])
                xcoor, ycoor = float(match.group(3)), float(match.group(4))
                if match.group(2)[1:] in ["physicscoor", "physicsxcoor"]:
                    xcoor = coors.phys2frameX(xcoor)
                if match.group(2)[1:] in ["physicscoor", "physicsycoor"]:
                    ycoor = coors.phys2frameY(ycoor)
                line = "%s(%f, %f)%s" % (match.group(1), xcoor, ycoor, match.group(5))
                self.data[i] = line
            out += self.data[i]+'\n'
        return out


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.hepforge.org/lists-archive/rivet/attachments/20160902/83447d92/attachment.html>


More information about the Rivet mailing list