Plot a straight line, parallell to the y-axis in gnuplot?

Click For Summary

Discussion Overview

The discussion centers around how to plot a straight line parallel to the y-axis in Gnuplot, specifically addressing the syntax and methods to achieve this. It includes technical explanations and user experiences related to plotting in Gnuplot.

Discussion Character

  • Technical explanation, Debate/contested, Experimental/applied

Main Points Raised

  • One participant asks how to plot a line parallel to the y-axis, suggesting the equation x = 20.
  • Another participant initially misunderstands and suggests plotting y = 20, which is a line parallel to the x-axis.
  • A different participant proposes using 'set parametric' and 'plot 20,t' to achieve the desired plot.
  • One participant notes that the previous suggestion results in a short line, stopping at around y = 5, indicating a need for a longer line for plotting linear inequalities.
  • Another participant suggests adjusting the range with 'plot [t=-1000:1000] 20,t' to extend the line as needed.
  • Several participants express satisfaction with the solutions provided, indicating successful resolution of the plotting issue.
  • A participant inquires about the availability of Gnuplot for Windows, leading to a discussion about using Cygwin to run Gnuplot on Windows systems.
  • Another participant provides detailed instructions on obtaining Gnuplot for Windows, including links and necessary dependencies.

Areas of Agreement / Disagreement

Participants generally agree on the methods to plot a line parallel to the y-axis after some initial confusion. However, there is a divergence in the approaches suggested, particularly regarding the use of parametric plotting and the range settings.

Contextual Notes

Some limitations include the initial misunderstanding of the question and the specific requirements for plotting linear inequalities, which may depend on the user's context and needs.

Who May Find This Useful

This discussion may be useful for users of Gnuplot, particularly those looking to plot specific types of lines or who are using Gnuplot on Windows systems.

Dr-NiKoN
Messages
93
Reaction score
0
How do you plot a straight line, parallell to the y-axis in gnuplot?
Something like:
x = 20
?
 
Computer science news on Phys.org
plot 20, gives y = 20, a line parallell with the x-axis.

I want x = 20
 
Try this:

'set parametric'
'plot 20,t'
 
Hm, that gives me a short line, it stops at around y = 5. I need it all the way up since I'm plotting linear unequalities.
 
'plot [t=-1000:1000] 20,t'

Just change the t-range to whatever fits for you.
 
Ah, perfect.

Thanks a lot :)
 
Looks like you've gotten the other problem of the linear programming thing figured out. ;)
 
hehe, yup :)
 
  • #10
can I get Gnuplot for windows?
 
  • #11
Yes, you can, but there's a catch. Gnuplot is primarily for Unix systems, however, an environment does exist for Win32 called Cygwin that will enable you to build Unix applications, such as Gnuplot.

You can get Cygwin (be sure to read the documentation) from:

http://www.cygwin.com

Once you have Cygwin installed, grab the Unix sources from:

http://www.gnuplot.info

Gnuplot's primary graphics environment is X11 - you'll have to install XFree86 in the Cygwin distribution. If you feel this is too complex for your tastes, Gnuplot can generate PDF and Postscript plots.

Edit: I found this nice link on Gnuplot SF site:

http://sourceforge.net/project/showfiles.php?group_id=2055&package_id=1996

There are some Win32 packages, but you might have to have the Cygwin .dll or some more dependencies that are present in the Cygwin distribution. This will save you from building Gnuplot, regardless.
 
Last edited by a moderator:

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
5
Views
17K
Replies
4
Views
4K
  • · Replies 3 ·
Replies
3
Views
5K
Replies
2
Views
3K
Replies
17
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K