Question

Question

Post by G.. » Fri, 03 Jan 1997 04:00:00



Hello:
I am developing interactive web page to plot data from a data file.
I have 2 questions.

1) How do I tell gnuplot/what is the command that will make a particular
column in a data file to be treated as string.  For example, I have a
data file as shown below:

AB123 3.5
DEF23 4.5
ST45G 6.2
DER8P 5.1

I want gnuplot to plot the above data file with the first column in X axis
and second column in Y axis.  Since X axis contains mixture of alphabets and
numbers, I want gnuplot to treat them as string and print them in X axis
corresponding to each individual xtics.

2) How do I plot missing data as one or more discontinuous lines? I know
that I can use '?' for missing data. But while plotting with 'lines' or
'linespoints' I get continuous line from the data before the '?' mark and
after the '?' mark.  What I want is to plot continuously to the data before
'?' mark and start a new line from data after '?' mark.  Thus the final plot
will look one or more discontinous lines and the point of discontinuity
implies missing data.

I will appreciate if somebody could help me out with the above two questions.

Thanx in Advance,
Gautham

"Knowledge is Power"
Gautham M. Jain, Large Car Platform, Chrysler Corporation
Tel: 810-576-6489  Fax: 810-576-2312

 
 
 

Question

Post by crawford.richard » Sat, 04 Jan 1997 04:00:00




Quote:> 1) How do I tell gnuplot/what is the command that will make a particular
> column in a data file to be treated as string.  For example, I have a
> data file as shown below:

> AB123 3.5
> DEF23 4.5
> ST45G 6.2
> DER8P 5.1

> I want gnuplot to plot the above data file with the first column in X axis
> and second column in Y axis.  Since X axis contains mixture of alphabets and
> numbers, I want gnuplot to treat them as string and print them in X axis
> corresponding to each individual xtics.

gnuplot currently has no mechanism for reading string data from a file.
You can do something like this, however:

Write a preprocessor that reads your file and creates a 'set xtics' command.
This command can be written to a file which can be loaded into gnuplot.

Quote:> 2) How do I plot missing data as one or more discontinuous lines? I know
> that I can use '?' for missing data. But while plotting with 'lines' or
> 'linespoints' I get continuous line from the data before the '?' mark and
> after the '?' mark.  What I want is to plot continuously to the data before
> '?' mark and start a new line from data after '?' mark.  Thus the final plot
> will look one or more discontinous lines and the point of discontinuity
> implies missing data.

One way is to put a null line in the data file at the missing point (a null
line has no characters other then newline and/or CR).  Another is to assign
a value that can never occur (perhaps a huge number or a negative number)
instead of the '?', and then plot using the 'thru' filter.  For example,
if all your data ought to be positive, use '-1' for the missing data and
then

  f(x) = x<0? 1/0 : x
  plot 'data' thru f(x)

In spite of the syntax, this should plot y vs. x.  (The 'thru' option in
3.5 is undocumented :-( ).  The manual or on-line help can tell you about
the ternary operator used in f(x) if you're unfamiliar with it.

I hope this helps.



 
 
 

1. Questions, questions, questions.

O.K. Since the 4014 is most likely a flop, I have one more question.
Does anyone know if they make graphic cards for vt100 terminals.
If so, how much do they go for, and where could I find one.
Vt100's are in vast supply around here, and although it is no VT240,
it will have to do.
Thanks.
-Gladiator

2. WANTED *ANIMATION RECORDING*

3. question, question, question

4. ENTERPRISING VENTURES - FREE HELP

5. Renderfarm question - DVD question - Connection question

6. ANSI Graphics which group to ask

7. Questions, questions, questions

8. questions questions questions!

9. Questions...Questions..

10. Questions...Questions...

11. Question for UMAX Vista S-12 scanner users [SCSI-2 question]

12. A question about asking questions <g>