LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   create chart from csv file (https://www.linuxquestions.org/questions/linux-software-2/create-chart-from-csv-file-617682/)

wolfipa 01-31-2008 10:56 AM

create chart from csv file
 
hi,

i'm trying to create a graph from a csv file.
The file mainly has the date/time and a varying value
like:
Code:

1/30/2008 17:54:51,20
1/30/2008 17:54:54,24
1/30/2008 17:54:58,18
.
.
.

now i want to automatically convert this values into a chart graph.

Any ideas?

makyo 01-31-2008 12:34 PM

Hi.

I'm not sure what you mean by chart, but if you have not yet looked at gnuplot, I suggest that ... cheers, makyo

teddyt 01-31-2008 01:17 PM

It's not clear how you want to put them into a chart (i.e., do you want to transform the data in some way).

If you just want to read in the data and plot the values after the comma, you can use Gnumeric, openoffice calc, or any spreadsheet. If the file has a .csv extension, Gnumeric will recognize that it is a csv file, and open the import wizard automatically. You can then plot the values using the "Insert a chart" button.

wolfipa 01-31-2008 02:05 PM

hi,

thanks for your answers. i want to automate the output - so when the csv file is created i want to start a program which produces a graphic file (doesn't matter which format ... png, jpeg, ...)

pppaaarrrkkk 01-31-2008 07:34 PM

GNUplot - I've just been trying to use that. It only reads .dat files and I can't seem to find out how to convert a .csv to a .dat file

pppaaarrrkkk 01-31-2008 07:38 PM

Actually, I think it's gnuplot, not GNUplot.

makyo 01-31-2008 08:59 PM

H.

Here's a sample script showing some degree of automation with gnuplot:
Code:

#!/bin/sh

# @(#) s4      Demonstrate ASCII output from gnuplot.
# See: http://www.gnuplot.info/
# for documentation and demos.

echo
echo " Sample bovine temperature:"
echo

sample -10 cow-temperatures |
tee t1

echo 'set terminal dumb 50 15 ; plot "t1"' | gnuplot

exit $?

Producing:
Code:

% ./s4

 Sample bovine temperature:

3      54
6      66
8      95
10      69
11      56
12      70
14      60
20      59
27      57
30      59


  95 ++-----+---A--+------+------+------+-----++
  90 ++    +      +      +      + "t1" + A  ++
  85 ++                                      ++
    |                                        |
  80 ++                                      ++
  75 ++                                      ++
  70 ++            A  A                      ++
  65 ++      A                                ++
    |                                        |
  60 ++                  A      A        A  +A
  55 ++  A  +      +A    +      +      +    ++
  50 ++-----+------+------+------+------+-----++
    0      5      10    15    20    25    30

Of course, you'd probably want a different output device, but this is convenient for pasting ... cheers, makyo


All times are GMT -5. The time now is 08:43 AM.