Ask Your Question
3

What is the process for creating a set of vertical lines using gnuplot?

asked 2022-01-03 11:00:00 +0000

scrum gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-05-22 21:00:00 +0000

plato gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-01-03 11:00:00 +0000

Seen: 13 times

Last updated: May 22 '21