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 ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Graphs?
PostPosted: Tue, 11 Apr 2006 13:24:56 UTC 
Offline
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
 Profile  
 
 Post subject:
PostPosted: Tue, 11 Apr 2006 13:56:14 UTC 
Offline
Member of the 'S.O.S. Math' Hall of Fame
User avatar

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 (x,f(x)) or those with edges and vertices (graph theory, not about function graphs)?


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 11 Apr 2006 15:21:27 UTC 
Offline
S.O.S. Oldtimer

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

_________________
BOOYA


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 11 Apr 2006 20:43:28 UTC 
Offline
Member of the 'S.O.S. Math' Hall of Fame
User avatar

Joined: Sat, 4 Sep 2004 18:49:40 UTC
Posts: 3403
Location: Uppsala, Sweden
adm wrote:
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):

\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}

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
 Profile  
 
 Post subject:
PostPosted: Sun, 11 Jun 2006 09:45:00 UTC 
Offline
S.O.S. Oldtimer
User avatar

Joined: Wed, 22 Jun 2005 13:46:36 UTC
Posts: 201
Location: CyberDyne
$\frac{How\;did\;you\;learn}{how\;to\;do\;that?}$

_________________
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
 Profile  
 
 Post subject:
PostPosted: Sun, 11 Jun 2006 10:19:11 UTC 
Offline
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:
$\frac{How\;did\;you\;learn}{how\;to\;do\;that?}$

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 \qbaqqq.

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

\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.<!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) -->{$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}

Code:
[tex]
\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}
[/tex]


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

Top
 Profile  
 
 Post subject:
PostPosted: Thu, 7 Feb 2008 03:44:36 UTC 
Offline
S.O.S. Oldtimer
User avatar

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.

It could be made like a spreadsheet and have options:

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 )
add another connectlines option?
# if yes, then do so.

See what I'm talking about?

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
 Profile  
 
 Post subject:
PostPosted: Thu, 7 Feb 2008 04:26:15 UTC 
Offline
Member of the 'S.O.S. Math' Hall of Fame
User avatar

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

(2) Upload your graph to an image-hosting service like PicOoodle!

(3) Post a link to your image here.

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 11 Mar 2008 07:49:47 UTC 
Offline
S.O.S. Oldtimer
User avatar

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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users


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

Search for:
Jump to:  
Contact Us | S.O.S. Mathematics Homepage
Privacy Statement | Search the "old" CyberBoard

users online during the last hour
Powered by phpBB © 2001, 2005-2011 phpBB Group.
Copyright © 1999-2013 MathMedics, LLC. All rights reserved.
Math Medics, LLC. - P.O. Box 12395 - El Paso TX 79913 - USA