Pxgraph

Xgraph is a 2-D plotting package for the X Window System that is written in C. Pxgraph is an extension to xgraph.
  • pxgraph11.3.4.tar.gz - Sources for pxgraph.
  • The README.html included in the pxgraph11.3.4 tar file.
  • Ptplot - A Java implementation of pxgraph.
  • Ptolemy User's manual Pxgraph chapter
  • tkgraph - A Tk interface that creates a new wish that uses the C functions in xgraph
  • pxgraph binaries

    Below are links to prebuilt GNU zipped pxgraph binaries.
    Note that in Ptolemy 0.7.1, the $PTOLEMY/bin/pxgraph script reads the PT_USE_X11_PXGRAPH environment variable. If that PT_USE_X11_PXGRAPH is set to anything, then $PTOLEMY/bin.$PTARCH/pxgraph.x11 is run.
    Thus, the pxgraph.exe or pxgraph binaries below should be copied to $PTOLEMY/bin.$PTARCH/pxgraph.x11 See $PTOLEMY/src/pxgraph/README.txt
  • Cygnus Cygwin32 b19.1 under NT4.0 (Requires Cygwin32 and X11R6, see Ptolemy NT Installation instructions
  • Digital Unix V4.0
  • HPUX10.20
  • HPUX9.x
  • Solaris2.5.1
  • SunOS4.1.3
  • Bug in st.c

    (12/03) The following problem was reported by Shachindra Sharma in st.c where a particular string results in a negative hash code because of overflow.
    Pxgraph does not call this function, but st.c appears in other locations, such as http://embedded.eecs.berkeley.edu/pubs/downloads/octtools/index.htm and http://www.mit.edu/afs/sipb/project/ruby-lang/src/ruby-1.6.4/st.c.
    The fix is below:
    int st_strhash(string, modulus)
         register char *string;
         int modulus;
    {
      register long val = 0;
      register int c;
    
      while ((c = *string++) != '\0') {
        val = val*997 + c;
      }
    
      /* Shachindra Sharma writes:
    
           ".. will have a problem when the value variable "val" is equal
           to the maximum negative integer value (for the particular OS its being
           run on say if its 32 bit OS the value would be -2^31 = -2147483648)
           val < 0 ? -val : val will still be -val for such a case due to the
           property of maximum negative integer that -val == val.
    
           As an example if we have a input string to this function like
           the one given below:
    
           "TRDTOP_HIP_UHIF1_HPDMA_UHPDREG1_HPDRCH3E1MCUADDR[20]"
    
           the value of the variable "val" would be -2147483648 resulting
           in a negative value being returned by the function which could result
           in problems for the user is OS was 32 bit. The hash function otherwise
           for any values of "val" larger or smaller than this value would work
           fine so the probabilty of such a situation is rather low.
      */
      if (val == -val) {
        unsigned int newhash = -val;
        return (newhash%modulus);
      } else {
        return ((val < 0) ? -val : val)%modulus;
      }
    }
    
    

    Last Updated: $Date$