gnuplot

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • UnknownBlue
    New Member
    • Jan 2007
    • 14

    #1

    gnuplot

    Hi.
    I am trying to plot a 3D graph using gnuplot through visual C++ using *.bin file with 12 columns, in which only the 1st, 6th and 8th column is used as x,y,z axis to plot the 3D graph.
    My first question is that must I rewrite the file into 3 columns for the gnuplot or can I use the original file (12 columns) to plot the graph? If the latter can be used, what are the codes that I must use to use the 1st, 6th and 8th column?
    My second question, is there a need to define a space for the graph like a picture control or will the graph be shown as per normal like when running gnuplot itself?
    My last question, how do I call gnuplot after opening the *.bin file?
    Thanks in advance!
  • AdrianH
    Recognized Expert Top Contributor
    • Feb 2007
    • 1251

    #2
    Originally posted by UnknownBlue
    Hi.
    I am trying to plot a 3D graph using gnuplot through visual C++ using *.bin file with 12 columns, in which only the 1st, 6th and 8th column is used as x,y,z axis to plot the 3D graph.
    My first question is that must I rewrite the file into 3 columns for the gnuplot or can I use the original file (12 columns) to plot the graph? If the latter can be used, what are the codes that I must use to use the 1st, 6th and 8th column?
    My second question, is there a need to define a space for the graph like a picture control or will the graph be shown as per normal like when running gnuplot itself?
    My last question, how do I call gnuplot after opening the *.bin file?
    Thanks in advance!
    Looking quickly at the documentation, it looks like you may be able to do what you are asking without rewriting the file:
    Originally posted by info page of gnuplot
    BINARY DATA FILES:

    Gnuplot can read binary data files. However, adequate information
    about details of the file format must be given on the command line or
    extracted from the file itself for a supported binary `filetype`. In
    particular, there are two structures for binary files, a matrix binary
    format and a general binary format.

    The matrix binary format contains a two dimensional array of 32 bit
    IEEE float values with an additional column and row of coordinate
    values. As with ASCII matrix, in the using list, repetition of the
    coordinate row constitutes column 1, repetition of the coordinate
    column constitutes column 2, and the array of values constitutes column
    3.

    The general binary format contains an arbitrary number of columns
    for which information must be specified at the command line. For
    example, `array`, `record`, `format` and *Note using:: can indicate the
    size, format and dimension of data. There are a variety of useful
    commands for skipping file headers and changing endianess. There are a
    set of commands for positioning and translating data since often
    coordinates are not part of the file when uniform sampling is inherent
    in the data. Different from matrix binary or ASCII, general binary
    does not treat the generated columns as 1, 2 or 3 in the using list.
    Rather, column 1 begins with column 1 of the file, or as specified in
    the `format` list.

    There are global default settings for the various binary options
    which may be set using the same syntax as the options when used as part
    of the `(s)plot <filename> binary ...` command. This syntax is `set
    datafile binary ...`. The general rule is that common command-line
    specified parameters override file-extracted parameters which override
    default parameters.

    Matrix binary is the default binary format when no keywords specific
    to general binary are given, i.e., `array`, `record`, `format`,
    `filetype`.

    General binary data can be entered at the command line via the
    special file name '-'. However, this is intended for use through a
    pipe where programs can exchange binary data, not for keyboards. There
    is no "end of record" character for binary data. Gnuplot continues
    reading from a pipe until it has read the number of points declared in
    the `array` qualifier.

    See `datafile binary` for more details.
    As for the syntax, see "binary general" in the info page.

    As for the last two questions, I'll have to answer that later, I have to go.


    Adrian

    Comment

    • AdrianH
      Recognized Expert Top Contributor
      • Feb 2007
      • 1251

      #3
      Originally posted by UnknownBlue
      Hi.
      My second question, is there a need to define a space for the graph like a picture control or will the graph be shown as per normal like when running gnuplot itself?
      I'm not sure what you are asking here.
      Originally posted by UnknownBlue
      My last question, how do I call gnuplot after opening the *.bin file?
      Why are you opening the *.bin file for?


      Adrian

      Comment

      Working...