Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Reading pgm files.

Help
Mikel
2011-07-05
2013-04-24
  • Mikel
    Mikel
    2011-07-05

    I am using version 2.12.10 on Windows 7. Problem is in plotting from a pgm file. Below are the Gri program and the textfile that it was reading. A blank output page is produced. Error messages are about plotting points off the page.

    Gri script

    set x size 15
    set y size 15
    set x grid 0 24 1
    set y grid 0 7 1
    #GRdata
    # variables = in small.pgm
    open "small.pgm"
    set image range 0 15
    read image pgm
    set image grayscale
    set clip on
    draw image
    quit

    small.pgm

    P2
    24 7
    255
    0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
    0  3  3  3  3  0  0  7  7  7  7  0  0 11 11 11 11  0  0 15 15 15 15  0
    0  3  0  0  0  0  0  7  0  0  0  0  0 11  0  0  0  0  0 15  0  0 15  0
    0  3  3  3  0  0  0  7  7  7  0  0  0 11 11 11  0  0  0 15 15 15 15  0
    0  3  0  0  0  0  0  7  0  0  0  0  0 11  0  0  0  0  0 15  0  0  0  0
    0  3  0  0  0  0  0  7  7  7  7  0  0 11 11 11 11  0  0 15  0  0  0  0
    0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0

     
  • Dan Kelley
    Dan Kelley
    2011-07-06

    I have fixed this bug in the version stored here on SourceForge, but *only* in the "git repository" version, *not* (yet) in the tarball/zipball version.  In other words, if you know how to use "git", I recommend that you try updating, to see that the solution works.

    (As a check for you - the image is the word 'FEEP')

    • Dan.
     
  • Dan Kelley
    Dan Kelley
    2011-07-06

    I have fixed this bug in the version stored  on github ()

    It is not updated on SourceForge, however.  I'll do that after a few days of testing.

    If you can work git, and if you can build on your machine, I recommend you try the latest version on https://github.com/dankelley/gri

     
  • Mikel
    Mikel
    2011-07-11

    I'm impressed with the turn-around, will look for the sourceforge version. I do not compile C programs, so I rely on the distributions. I want to include Gri in a chapter of a book I am writing on statistical graphics. Would you be willing to read/critique it?

     
  • Dan Kelley
    Dan Kelley
    2011-07-13

    As it turns out, I am writing my own book on statistical/graphical methods.  Depending on when you have your chapter ready, I could look at it.

     
  • Mikel
    Mikel
    2011-07-18

    Will there be a gnuwin32 distribution of a version later than 2.12.10 that includes this fix? Reading pgm files was the last topic I needed for my Gri chapter, so it would be nice to be able to include it. The book includes chapters on APIs to a number of graphics programs from Stata.

     

  • Anonymous
    2011-07-18

    Sorry, but I don't know anything about windows distributions.  I build the source, and check it on my local machine.  When it works there, a co-author checks it on debian.  If these two things work, then the release is made. This has been done.

    Gri is released as open source code.  Anyone can build it.  In particular, any distribution can do so.  But I have no idea about gnuwin32, e.g. whether they tend to build within weeks of a new release, or years.

    I note that the version you are using was released 2006 Jan 26.  There have been a dozen new versions since then.