|
From: James00007 <ach...@gm...> - 2010-05-14 03:05:22
|
Hi, I needed to plot straight lines and I can do this generally using the form y=mx+c However, almost-vertical lines give rise to unbounded values of m and c and hence they can not be plotted. For this reason, I have to represent lines the Hough Transform way i.e (r, theta) How can I plot lines that are represented by (r, theta)? This is just a representation and not an equation. Thanks -- View this message in context: http://old.nabble.com/Plotting-lines-represented-by-%28r%2C-theta%29-tp28554781p28554781.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2010-05-14 13:28:25
|
you may use 'parametric mode' http://www.gnuplot.info/docs_4.2/gnuplot.html#x1-14400034.4 James00007 wrote: > > Hi, > > I needed to plot straight lines and I can do this generally using the form > y=mx+c > > However, almost-vertical lines give rise to unbounded values of m and c > and hence > they can not be plotted. For this reason, I have to represent lines the > Hough Transform way i.e (r, theta) > > How can I plot lines that are represented by (r, theta)? This is just a > representation and not an equation. > > Thanks > -- View this message in context: http://old.nabble.com/Plotting-lines-represented-by-%28r%2C-theta%29-tp28554781p28559365.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2010-05-15 14:50:40
|
a simple example: xoffset=1. yoffset=3. set zeroaxis set parametric set xrange [-4:6] set yrange [-2:8] set trange [-4:4] set angles degree fx(t,phi)=xoffset+t*sin(phi) fy(t,phi)=yoffset+t*cos(phi) plot for [i=0:359] fx(t,i) , fy(t,i) notitle Hi Thomas, Thanks for help again...but I`m afraid I need more of it! I`ve had a look at parametric mode and I can plot vertical lines using this example: http://t16web.lanl.gov/Kawano/gnuplot/parametric-e.html But I need to plot a nearly vertical line through a point (x,y) with a (steep) gradient of m. Do you have any idea how the plot command will look like now (taking into account the point (x,y) and gradient m?) Hope I`m not asking too much! Thanks Thomas Sefzick wrote: > > you may use 'parametric mode' > http://www.gnuplot.info/docs_4.2/gnuplot.html#x1-14400034.4 > > > -- View this message in context: http://old.nabble.com/Plotting-lines-represented-by-%28r%2C-theta%29-tp28554781p28568882.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: James00007 <ach...@gm...> - 2010-05-16 05:49:02
|
Hi, The script does not work, i.e plot for [i=0:359] fx(t,i) , fy(t,i) notitle gives an error message. I didnt know that for statements existed in gnuplot but it may be that u just gave my the pseudo code. Guess I have asked you enough and need to do a few things myself! -- View this message in context: http://old.nabble.com/Plotting-lines-represented-by-%28r%2C-theta%29-tp28554781p28572793.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: James00007 <ach...@gm...> - 2010-05-15 05:59:21
|
Hi Thomas, Thanks for help again...but I`m afraid I need more of it! I`ve had a look at parametric mode and I can plot vertical lines using this example: http://t16web.lanl.gov/Kawano/gnuplot/parametric-e.html But I need to plot a nearly vertical line through a point (x,y) with a (steep) gradient of m. Do you have any idea how the plot command will look like now (taking into account the point (x,y) and gradient m?) Hope I`m not asking too much! Thanks you may use 'parametric mode' http://www.gnuplot.info/docs_4.2/gnuplot.html#x1-14400034.4 -- View this message in context: http://old.nabble.com/Plotting-lines-represented-by-%28r%2C-theta%29-tp28554781p28566458.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2010-05-16 11:37:46
|
you are using an older version of gnuplot, not the actual one. use this command instead: plot fx(t,359.) , fy(t,359.) notitle, fx(t,0.) , fy(t,0.) notitle, fx(t,1.) , fy(t,1) notitle James00007 wrote: > > > Hi, > > The script does not work, i.e > > plot for [i=0:359] fx(t,i) , fy(t,i) notitle > > gives an error message. > > I didnt know that for statements existed in gnuplot but it may be that u > just gave my the pseudo code. > Guess I have asked you enough and need to do a few things myself! > > > > -- View this message in context: http://old.nabble.com/Plotting-lines-represented-by-%28r%2C-theta%29-tp28554781p28574133.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: James00007 <ach...@gm...> - 2010-05-17 03:57:36
|
Thanks a lot for all the help. I was able to do what I needed to. -- View this message in context: http://old.nabble.com/Plotting-lines-represented-by-%28r%2C-theta%29-tp28554781p28579286.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Hans-Bernhard B. <HBB...@t-...> - 2010-05-18 00:07:31
|
James00007 wrote: > I am doing some other plotting the in the same script/plot but those > functions are *not* > in parametric mode whereas this particular plot requires parametric mode. > > Is there a way to plot both kinds of functions in the same plot? Of course. Any function f(x) is representable as a parametric curve (t, f(t)), or in case you need the x range to be different from the t range: (my_x(t), f(my_x(t))) Lesson to be learned: functions don't care about the name of their arguments. It doesn't _have_ to be 'x'. |