Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The process for creating a set of vertical lines using gnuplot is as follows:

  1. Open the gnuplot console or terminal.
  2. Enter the command to set the output to a file or a display:
  3. To set the output to a file: set terminal <filetype> <filename.extension>
  4. To set the output to a display: set terminal <display type="">
  5. Enter the command to set the format of the data to be plotted:
  6. For vertical lines: set datafile separator "|"
  7. Enter the command to plot the vertical lines:
  8. Using the 'with lines' option: plot "<echo '|'="" '|'="" '|'="" '|'="" '|'="" '|'="" '|'"="" with="" lines<="" li="">
  9. Using the 'with vectors' option: plot "<echo '1="" 0\n1="" 10\n2="" 0\n2="" 5\n3="" 0\n3="" 15\n4="" 0\n4="" 7\n5="" 0\n5="" 20\n'|tee="" input.dat"="" using="" 1:2:(0):(-$2)="" with="" vectors="" head="" filled="" linewidth="" 2<="" li="">
  10. Alternatively, you can also create a data file with the x and y coordinates of each vertical line and then plot it using the command:
  11. plot "<cat datafile.dat"="" using="" 1:2="" with="" lines="" <="" li="">

Note: Replace the '|' symbol with the desired vertical line character.