# S.O.S. Mathematics CyberBoard

Your Resource for mathematics help on the web!
 It is currently Sat, 18 May 2013 20:13:56 UTC

 All times are UTC [ DST ]

 Page 1 of 1 [ 9 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Graphs?Posted: Tue, 11 Apr 2006 13:24:56 UTC
 S.O.S. Oldtimer

Joined: Mon, 9 Jan 2006 15:34:48 UTC
Posts: 206
How do i post graphs? It is an irregular graph. I could also use the knowledge for regular graphs too.

thanks

_________________
BOOYA

Top

 Post subject: Posted: Tue, 11 Apr 2006 13:56:14 UTC
 Member of the 'S.O.S. Math' Hall of Fame

Joined: Sat, 4 Sep 2004 18:49:40 UTC
Posts: 3403
Location: Uppsala, Sweden
What kind of graphs do you mean? Those sometimes plotted as or those with edges and vertices (graph theory, not about function graphs)?

Top

 Post subject: Posted: Tue, 11 Apr 2006 15:21:27 UTC
 S.O.S. Oldtimer

Joined: Mon, 9 Jan 2006 15:34:48 UTC
Posts: 206
anything... I have no clue

_________________
BOOYA

Top

 Post subject: Posted: Tue, 11 Apr 2006 20:43:28 UTC
 Member of the 'S.O.S. Math' Hall of Fame

Joined: Sat, 4 Sep 2004 18:49:40 UTC
Posts: 3403
Location: Uppsala, Sweden
anything... I have no clue

You're not following me, and therefore I assume you're talking about function graphs (considering your calculus questions recently).

It is possible to do such things in LaTeX, but LaTeX is by no means designed for it. It's really quite cumbersome to produce graphics with LaTeX. It's fine until comutative diagrams and the like, but after that I would suggest making pictures somewhere else.

Here's an example of graphics in LaTeX (which I copied from a guide):

Here's the code:

Code:
\setlength{\unitlength}{1cm}
\begin{picture}(6,4)(-3,-2)
\put(-2.5,0){\vector(1,0){5}}
\put(2.7,-0.1){$\chi$}
\put(0,-1.5){\vector(0,1){3}}
\multiput(-2.5,1)(0.4,0){13}
{\line(1,0){0.2}}
\multiput(-2.5,-1)(0.4,0){13}
{\line(1,0){0.2}}
\put(0.2,1.4)
{$\beta=v/c=\tanh\chi$}
\qbezier(0,0)(0.8853,0.8853)
(2,0.9640)
\qbezier(0,0)(-0.8853,-0.8853)
(-2,-0.9640)
\put(-3,-2){\circle*{0.2}}
\end{picture}

Top

 Post subject: Posted: Sun, 11 Jun 2006 09:45:00 UTC
 S.O.S. Oldtimer

Joined: Wed, 22 Jun 2005 13:46:36 UTC
Posts: 201
Location: CyberDyne

_________________
We spent a lot of time in Nicaragua and places like that. For a while there, she was with this crazy ex-Green Beret guy, running guns. Then there were some other guys. She'd shack up with anybody she could learn from so she could teach me how to be this great military leader. Then she gets busted and it's like, "Sorry kid, your mom's a psycho. Didn't you know?" It's like, everything I'd been brought up to believe was all made of bull***?. I hated her for that. But everything she said was true.

Top

 Post subject: Posted: Sun, 11 Jun 2006 10:19:11 UTC
 Member of the 'S.O.S. Math' Hall of Fame

Joined: Sat, 14 Jan 2006 22:40:49 UTC
Posts: 694
Location: Yountville, California
Cyberman wrote:

A good guide to LaTeX graphics is this PDF document from this web site.

The most useful tip is on page 10 of the document where it suggests using the \qbezier command to draw lines. For example. to draw a line between points (0,0) and (1,1) use \qbezier(0,0)(0,0)(1,1). The only trick here is to use the same coordinates twice (either coordinates, it does not matter what order). This is much easier than using \put with \line.

As the man says: "By this 'abuse' of the \qbezier command, one of the two severe drawbacks of the original picture environment can be comfortably circumvented. As the \linethickness{thickness} command applies to the \qbezier command, line segments of arbitrary slope and thickness can be drawn. What else would you want?"

You may find that the LaTeX engine here will only allow you to draw a limited number of lines using \qbezier. (it's not too bad, just don't think you can pile on lines forever.) If it overflows it gives the dreaded message .

Here's a graph from a recent post. It's simple, but it saved a lot of words (though less than the proverbial 1000).

Code:
$$\setlength{\unitlength}{1.5cm} \begin{picture}(3.6,3.4) \qbezier(0,0)(0,0)(3,0) \qbezier(0,0)(0,0)(0,3) \qbezier(1,0)(1,0)(3,2) \qbezier(0,1.5)(0,1.5)(3,1.5) \qbezier(.75,1.5)(.75,1.5)(.75,0) \qbezier(2.5,1.5)(2.5,1.5)(2.5,0) \qbezier(3,1.5)(3,1.5)(3,0) \put(.75,0){\circle{.13}} \put(2.5,0){\circle{.13}} \put(3,-.3){\omega} \put(-.3,2.8){X} \put(-1,1.4){x = 1.5} \linethickness{1.5pt} \qbezier(0,3)(0,3)(1,1) \qbezier(1,0)(1,0)(3,2) \end{picture}$$

Last edited by Bilbo on Mon, 28 Feb 2011 04:26:38 UTC, edited 1 time in total.

Top

 Post subject: Posted: Thu, 7 Feb 2008 03:44:36 UTC
 S.O.S. Oldtimer

Joined: Wed, 22 Jun 2005 13:46:36 UTC
Posts: 201
Location: CyberDyne
I'm thinking with Linux, a program could be made with the gtk or tk/tcl language to allow a person to make lines and shapes much faster instead of the repetitive typing. This thread, albeit dated, is still good. Most sites on google kept telling people to import a .jpg.

y1 = 2x + 3
y2 = -1/2x + 3
add another line? (yes / no)

# if no, then move onto line configuration

connect lines? (yes /no)

# if no, then don't activate box
# if yes, activate boxes.

Connectlines = y1 + 2
Form of connection = (dotted / solid / dashed )
# if yes, then do so.

A script could be made to interpret the line, and it could be more rigid and constrictive to control user input. But yeah, not too impossible.

Probably faster than my idea of making a graphing utility completely out of shell scripting: my idea was portability.

This could probably be made with a shell script, too. ^___^
Just echo the text each time a line is added.

What would you like for y1 = ? (ex: 2x + 3):
1/2x + 4

echo "\$ANS" >> /tmp/blahblah123.huh

I'm a nut for shell scripting.

Top

 Post subject: Posted: Thu, 7 Feb 2008 04:26:15 UTC
 Member of the 'S.O.S. Math' Hall of Fame

Joined: Wed, 1 Oct 2003 04:45:43 UTC
Posts: 9631
Besides using LaTeX, another way is to follow these steps:

(1) Generate a graph on your computer with a program like Graph

edit: I just noticed that this thread is almost two years old...

Top

 Post subject: Posted: Tue, 11 Mar 2008 07:49:47 UTC
 S.O.S. Oldtimer

Joined: Wed, 22 Jun 2005 13:46:36 UTC
Posts: 201
Location: CyberDyne
GNUplot seems like it translates to LaTeX, but I'm not completely sure how it works.
It looks like it processes code. I don't feel like learning that. I'm for GUIs.

Quote:
Gplot simplifies gnuplot graph creation
By Ben Martin on February 27, 2008 (4:00:00 PM)

http://www.linux.com/feature/127798

And Gnuplot can output to a terminal/console.... :P
I saw it somewhere; I can't recall where, though. The WWW is a big place.

Frontends, third part extensions, and other software parts of Gnuplot make it easier to use. I've never really liked the idea of coding tons of stuff for visual data. Maybe in macromedia flash and CAD, but not really for simple math.

Extcalc is pretty awesome, too, but it's for Linux at the moment.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 9 posts ]

 All times are UTC [ DST ]

#### Who is online

Users browsing this forum: No registered users

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forum

Search for:
 Jump to:  Select a forum ------------------ High School and College Mathematics    Algebra    Geometry and Trigonometry    Calculus    Matrix Algebra    Differential Equations    Probability and Statistics    Proposed Problems Applications    Physics, Chemistry, Engineering, etc.    Computer Science    Math for Business and Economics Advanced Mathematics    Foundations    Algebra and Number Theory    Analysis and Topology    Applied Mathematics    Other Topics in Advanced Mathematics Other Topics    Administrator Announcements    Comments and Suggestions for S.O.S. Math    Posting Math Formulas with LaTeX    Miscellaneous