I am doing a C program that calculates the "closest pair" among the points given in an input file.
Now my objective is to plot the points using GNUPlot and draw a line between the closest pair of points. I have succeed in drawing the points but am unable to draw line between two specific points.
Command I have used to plot the points:-
I need command to draw line between 2 points please.
gnuplot / intro / style
I suppose you could list the 2 points separate from the others, and plot them with the "lines" or "vectors" style.
then in gnuplot:
#note: 2 blank lines separate data sets
#points to draw lines between
plot "points.txt" index 0, "points.txt" index 1 with lines
Oh thanks a billion.
Still 2 more query please.
1. How to change the color of the line? It is appearing Green in Windows.
2. How to change the appearance of the points? It is appearing like cross mark in Windows.
So -- crazy I know -- but have you typed "help plot" in gnuplot? The "with" part allows you to change linecolor, pointstyle, pointsize, etc.
Originally Posted by anirban
A little late, but I'd just like to say that my encounters with GNUPlot have been crappy at best, PLplot is vastly superior, check it out: PLplot Home Page - Main
Okay thanks but I need just once to give a demo to my teacher.
So I am happy with GNUPlot and your nice help! :D