For Programmers: Free Programming Magazines  


Home > Archive > Mathematica > December 2006 > How to plot a parellal line









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to plot a parellal line
Swati Agrawal

2006-12-11, 7:27 pm

Dear Mathgroup,

I am a new Mathematica user. I can't find a way to graph a
line parallel to the y or something like x-5=0.

Any help would be appreciated.

Jyoti.




________________________________________
________________________________________
____
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

Jean-Marc Gulliet

2006-12-11, 7:27 pm

Swati Agrawal wrote:
> Dear Mathgroup,
>
> I am a new Mathematica user. I can't find a way to graph a
> line parallel to the y or something like x-5=0.


You could use the graphics primitive Line[]. For instance,

Plot[Exp[-x^2/2]/Sqrt[2*Pi], {x, -4, 4},
Epilog -> {Line[{{2, 0}, {2, 0.4}}]}];

Regards,
Jean-Marc

Bob Hanlon

2006-12-11, 7:27 pm

f[x_]:=x^2+7x-30;

Plot[f[x],{x,0,10},PlotStyle->Blue,
Epilog->{Red,Line[{{5,f[0]},{5,f[10]}}],
Green,AbsolutePointSize[6],Point[{5,f[5]
}]}];


Bob Hanlon

---- Swati Agrawal <swati06math@yahoo.com> wrote:
> Dear Mathgroup,
>
> I am a new Mathematica user. I can't find a way to graph a
> line parallel to the y or something like x-5=0.
>
> Any help would be appreciated.
>
> Jyoti.


amitsoni.1984@gmail.com

2006-12-11, 7:27 pm

You can try this:
Show[Plot[0,{x,0,5}],Graphics[Line[{{5,-1},{5,1}}]]]

Amit

Swati Agrawal wrote:
> Dear Mathgroup,
>
> I am a new Mathematica user. I can't find a way to graph a
> line parallel to the y or something like x-5=0.
>
> Any help would be appreciated.
>
> Jyoti.
>
>
>
>
> ________________________________________
________________________________________
____
> Want to start your own business?
> Learn how on Yahoo! Small Business.
> http://smallbusiness.yahoo.com/r-index


Chris Chiasson

2006-12-11, 7:27 pm

What documentation have you read? What have you tried so far?

On 12/10/06, Swati Agrawal <swati06math@yahoo.com> wrote:
> Dear Mathgroup,
>
> I am a new Mathematica user. I can't find a way to graph a
> line parallel to the y or something like x-5=0.
>
> Any help would be appreciated.
>
> Jyoti.
>
>
>
>
> ________________________________________
________________________________________
____
> Want to start your own business?
> Learn how on Yahoo! Small Business.
> http://smallbusiness.yahoo.com/r-index
>
>



--
http://chris.chiasson.name/

Philipp

2006-12-11, 7:27 pm

Sorry, I misunderstood your question, the previous answer was wrong.
Try,
ParametricPlot[{5, t}, {t, -10, 10}]

Cheers,
Philipp.


Swati Agrawal wrote:
> Dear Mathgroup,
>
> I am a new Mathematica user. I can't find a way to graph a
> line parallel to the y or something like x-5=0.
>
> Any help would be appreciated.
>
> Jyoti.
>
>
>
>
> ________________________________________
________________________________________
____
> Want to start your own business?
> Learn how on Yahoo! Small Business.
> http://smallbusiness.yahoo.com/r-index


Swati Agrawal

2006-12-13, 4:31 pm

Thank you Bob, Valeri, Dimitris, Jean.

Regards,

--- Bob Hanlon <hanlonr@cox.net> wrote:

> f[x_]:=x^2+7x-30;
>
> Plot[f[x],{x,0,10},PlotStyle->Blue,
> Epilog->{Red,Line[{{5,f[0]},{5,f[10]}}],
>
> Green,AbsolutePointSize[6],Point[{5,f[5]
}]}];
>
>
> Bob Hanlon
>
> ---- Swati Agrawal <swati06math@yahoo.com> wrote:
> to graph a
>
>



________________________________________
__________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Narasimham

2006-12-13, 4:31 pm

Swati Agrawal wrote:

> I am a new Mathematica user. I can't find a way to graph a line
> parallel to the y or something like x-5=0.


Hi Jyothi/Swathi,

ParametricPlot[{5,y},{y,-4,6},AspectRatio->Automatic,GridLines->Automatic];

(* Just play with the above command choosing any functions for x or y,
you have an automatic grid plotting available, for example: *)

ParametricPlot[{y^2 - 4y +3,y},{y,4,-1},AspectRatio->Automatic,
GridLines->Automatic];
ParametricPlot[{x^1 - 4x^3 +3,x},{x,1,-1},AspectRatio->Automatic,
GridLines->Automatic];

learner

2006-12-13, 4:31 pm

Hi, may this satisfy you?

Show[Graphics[Line[{{5, 10}, {5, -10} }]]]

leo

On Dec 10, 5:08 am, Swati Agrawal <swati06m...@yahoo.com> wrote:
> Dear Mathgroup,
>
> I am a new Mathematica user. I can't find a way to graph a
> line parallel to the y or something like x-5=0.
>
> Any help would be appreciated.
>
> Jyoti.
>
> ________________________________________
________________________________________
____
> Want to start your own business?
> Learn how on Yahoo! Small Business.http://smallbusiness.yahoo.com/r-index


dimitris

2006-12-13, 4:31 pm

One way is the follow:

myline = Line[{{5, -5}, {5, 5}}];

Show[Graphics[{AbsoluteThickness[2], myline}], Frame -> {True, True,
False, False}, PlotLabel -> "graph 1", FrameLabel -> {"x", "y"}, Axes
-> {True, False}, AxesStyle -> AbsoluteDashing[{2, 4}], PlotRange ->
{{0, 10}, {-6, 6}}];

One more advanced example

lstlines = (Line[{{#1, -5}, {#1, 5}}] & ) /@ Range[-10, 10];
Show[Graphics[{AbsoluteThickness[2], lstlines}], Frame -> {True, True,
False, False}, PlotLabel -> "graph 1", FrameLabel -> {"x", "y"}, Axes
-> {True, False}, AxesStyle -> AbsoluteDashing[{2, 4}], PlotRange ->
{{-10, 10}, {-6, 6}},
ImageSize -> {400, 300}];

Here is some useful links for Mathematica graphics

http://library.wolfram.com/infocenter/TechNotes/263/
http://library.wolfram.com/infocenter/Conferences/179/
http://library.wolfram.com/infocenter/Conferences/181/

The last two belong to Tom Wickham-Jones the author of the very good
book
Mathematica Graphics: Techniques & Applications
http://library.wolfram.com/infocenter/Books/3753/

But read carefully the relevant material from the Mathematica Book

http://documents.wolfram.com/mathem...ok/section-2.10

Also keep in touch with this forum with so many kind Mathematica
experts!

Regards
Dimitris

Swati Agrawal wrote:
> Dear Mathgroup,
>
> I am a new Mathematica user. I can't find a way to graph a
> line parallel to the y or something like x-5=0.
>
> Any help would be appreciated.
>
> Jyoti.
>
>
>
>
> ________________________________________
________________________________________
____
> Want to start your own business?
> Learn how on Yahoo! Small Business.
> http://smallbusiness.yahoo.com/r-index


Philipp

2006-12-13, 4:31 pm

Plot[5, {x, -10, 10}]

Cheers,
Philipp.

Swati Agrawal wrote:
> Dear Mathgroup,
>
> I am a new Mathematica user. I can't find a way to graph a
> line parallel to the y or something like x-5=0.
>
> Any help would be appreciated.
>
> Jyoti.
>
>
>
>
> ________________________________________
________________________________________
____
> Want to start your own business?
> Learn how on Yahoo! Small Business.
> http://smallbusiness.yahoo.com/r-index


catny

2006-12-13, 4:31 pm

Plot[5,{t,0,10}]

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com