Re: Postgres and GnuPlot

From: Mila Boldareva <me(at)pierro(dot)dds(dot)nl>
To: Hrishikesh Deshmukh <hdeshmuk(at)gmail(dot)com>
Cc: Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Postgres and GnuPlot
Date: 2005-05-09 15:19:34
Message-ID: 427F7F86.6050509@pierro.dds.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>Has anybody tried using gnuplot to plot results from queries; there
>are some suggestions given in PostgreSQL Developer's Handbook but i
>have not any luck so far!
>Any pointers as how to send results from queries straight to a simple
>plotting utility (ex:gnuplot)!
>
>
>
I use a text file as an intermediary.
You only need to slightly modify (postgres output) and/or (gnuplot
input) options:

for postgres, put something like this before the query:

\pset null '?9'
-- or other impossible beginning char to indicate missing values correctly

\t
-- will show only data rows

\f '\t'
-- make sure columns are tab-separated

-- don't align the output:
\a

Instead of the last two, you may change in the gnuplot script:

set datafile separator '|'

Additionally, let gnuplot know your missing columns:
set datafile missing '?'

Hope this helps.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Petrilli 2005-05-09 15:27:54 Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL 8.0)
Previous Message Hrishikesh Deshmukh 2005-05-09 14:51:01 Postgres and GnuPlot