Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Program for graphs and diagrams

  1. Jul 2, 2004 #1

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    Hi, I'm typing up all my maths notes for when I go to university and I have some fairly good programs for displaying all the maths symbols etc. However could someone please point me in the direction of a good program that I could use to quickly make graphs of functions or easily make diagrams to illustrate geometry problems?
     
  2. jcsd
  3. Jul 2, 2004 #2
  4. Jul 2, 2004 #3

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    For diagrams, then depending on where you want to use them, try using xypic in latex (ie produce your document entirely using latex) you can insert graphs as eps files which may be created in ways muzza suggests.
     
  5. Jul 2, 2004 #4

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    Thanks muzza.

    Matt, could you please explain further. I've only ever used Latex on this website so I'm not overly used to it, however I've been planning to teach myself over the next couple of months anyway.
     
  6. Jul 2, 2004 #5

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    Well, basically it's like this.

    You will need to borrow a basic outline (often called a preamble), and then between the begin document and end document command you type as if you're typing here: plain text then you start a maths environment by using the command \ [ (no space, cos i think that the latex here would pick it up if i did it literally) do the symbols stuff and end \ ] again no space, then text then....

    once you've done that you pass it through a translator, it produce a dvi file (easily converted to ps or pdf) et voila. Now, how you implement all this depends on your system.

    Windows? Then you want to look up MikTeX. Linux and you can install it directly using whatever you use, you want the TeTeX package. (Mac not au fait with.) That installs all the compilers and fonts and things you need (though you may need to install xypic in windows, but that should be easy). Basically it's like typing in plain old html. there are a bunch of commands to remember etc, and then you need a compiler type thingy, and so on.

    there's loads of online documentation (something like tex in under sixty nine hours is often cited) and books to help you.

    there are WISYWIG editors as well if you like that kind of thing (emacs of vim are my preferred tools, they have tex modes that highlight the syntax and match brackets and so on).

    xypic is a very powerful way to create diagrams, graphs (in the sense of graph theory) and so on, google for it, look at their documents and see if it appears to do what you want. as a guide it WILL do what you want, no matter how bizarre, but it may take you a month to figure out how.

    the key to starting is to have a basic framework to work in. if you like i'll email you mine, with copious notes added explaining what all the stuff means. this is the general way of starting to use latex.

    oh, and miktex etc are all free to obtain (though the editors often aren't if they're MS based ones)
     
  7. Jul 2, 2004 #6
    I think you need Ghostscript as well, in order to run Miktex.
     
  8. Jul 2, 2004 #7

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    if you want to make it into a ps file, or read them, which is the usual thing, yes.
     
  9. Jul 2, 2004 #8

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    That's great thanks, I'll spend tommorw trying to make sense of what was said lol.
     
  10. Jul 7, 2004 #9

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    Thanks, I've downloaded MikTeX, but I can't seem to find anything about what I do now. And on the web sites I've been on I can't seem to make heads nor tails of xypic.
     
  11. Jul 7, 2004 #10
    Have you read this?
     
  12. Jul 7, 2004 #11

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    :biggrin: Thanks, I'm sure this will be a big help.
     
  13. Jul 7, 2004 #12
    I don't think you need Ghostscript if you use PDFLatex. Is this correct?

    I suggest gnuplot. It is free and easy to use. If you have about $100, go for Maple or Mathematica.
     
  14. Jul 8, 2004 #13
    Well, I needed Ghostscript to use pdflatex ;)
     
  15. Jul 8, 2004 #14

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    zurtex, here's a sample latex file. have you installed emacs? probably should do so, or you need to get used to command lines (ok, some of you will use winedit too). when you save it change the ending to .tex not .txt, you can't upload .tex files here which seems like a bizarre idea.

    anyway, open in some text editor to see what it looks like and change it around.

    to process it, well, get a dos prompt up, move to the dir the file is in and type

    > latex sample.tex

    it should produce sample.dvi, you can use yap to view it, yap comes with miktex.

    there will be some errors when you do this to do with citations, you can ignore them.

    then ask questions (pm me if nec)
     

    Attached Files:

  16. Jul 8, 2004 #15
    Mathematica is cool :) I like it. Pretty easy to use as well, it has a GUI, but it's not that good.
     
  17. Jul 8, 2004 #16

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    I tried what you said matt but I just go this:

    Code (Text):

    C:\Documents and Settings\Damian\Desktop>latex sample.tex
    This is e-TeX, Version 3.141592-2.1 (MiKTeX 2.4)
    etex.exe --ini --interaction=nonstopmode --halt-on-error --alias latex *C:/texmf
    /tex/latex/base/latex.ltx \dump
    This is e-TeX, Version 3.141592-2.1 (MiKTeX 2.4) (INITEX)
    entering extended mode
    (C:/texmf/tex/latex/base/latex.ltx (C:\texmf\tex\latex\00miktex\texsys.cfg)
    ./texsys.aux found


    \@currdir set to: ./.


    Assuming \openin and \input
    have the same search path.


    Defining UNIX/DOS style filename parser.

    catcodes, registers, compatibility for TeX 2,  parameters,
    LaTeX2e <2003/12/01>
    hacks, control, par, spacing, files, font encodings, lengths,
    ====================================

    Local config file fonttext.cfg used

    ====================================
    (C:\texmf\tex\latex\00miktex\fonttext.cfg (C:\texmf\tex\latex\base\fonttext.ltx
    === Don't modify this file, use a .cfg file instead ===

    (C:\texmf\tex\latex\base\omlenc.def) (C:\texmf\tex\latex\base\t1enc.def)
    (C:\texmf\tex\latex\base\ot1enc.def) (C:\texmf\tex\latex\base\omsenc.def)
    (C:\texmf\tex\latex\base\t1cmr.fd) (C:\texmf\tex\latex\base\ot1cmr.fd)
    (C:\texmf\tex\latex\base\ot1cmss.fd) (C:\texmf\tex\latex\base\ot1cmtt.fd)))
    ====================================

    Local config file fontmath.cfg used

    ====================================
    (C:\texmf\tex\latex\00miktex\fontmath.cfg (C:\texmf\tex\latex\base\fontmath.ltx
    === Don't modify this file, use a .cfg file instead ===

    (C:\texmf\tex\latex\base\omlcmm.fd) (C:\texmf\tex\latex\base\omscmsy.fd)
    (C:\texmf\tex\latex\base\omxcmex.fd) (C:\texmf\tex\latex\base\ucmr.fd)))
    ====================================

    Local config file preload.cfg used

    =====================================
    (C:\texmf\tex\latex\base\preload.cfg (C:\texmf\tex\latex\base\preload.ltx))
    page nos., x-ref, environments, center, verbatim, math definitions, boxes,
    title, sectioning, contents, floats, footnotes, index, bibliography, output,
    ===========================================
    Local configuration file hyphen.cfg used
    ===========================================
    (C:\texmf\tex\generic\babel\hyphen.cfg (C:\texmf\tex\generic\hyphen\ushyph.tex)
    (C:\texmf\tex\generic\hyphen\frhyph.tex
    frhyph.tex - French hyphenation patterns (V2.11) <2002/01/16>)
    (C:\texmf\tex\generic\hyphen\dehypht.tex
    German Traditional Hyphenation Patterns `dehypht' Version 3.2a <1999/03/03>
    (Formerly known under the name `ghyph31' and `ghyphen'.))
    (C:\texmf\tex\generic\hyphen\dehyphn.tex
    New German Hyphenation Patterns `dehyphn' Rev.31 <2001-05-07> (WaS))
    (C:\texmf\tex\generic\hyphen\dumyhyph.tex)
    (C:\texmf\tex\generic\hyphen\zerohyph.tex))
    =================================
    Applying patch file ltpatch.ltx
    =================================
    (C:\texmf\tex\latex\base\ltpatch.ltx)
     )
    Beginning to dump on file latex.efmt
     (preloaded format=latex 2004.7.8)
    4359 strings of total length 54759
    43926 memory locations dumped; current usage is 144&41982
    3142 multiletter control sequences
    \font\nullfont=nullfont
    \font\OMX/cmex/m/n/10=cmex10
    \font\tenln=line10
    \font\tenlnw=linew10
    \font\tencirc=lcircle10
    \font\tencircw=lcirclew10
    \font\OT1/cmr/m/n/5=cmr5
    \font\OT1/cmr/m/n/7=cmr7
    \font\OT1/cmr/m/n/10=cmr10
    \font\OML/cmm/m/it/5=cmmi5
    \font\OML/cmm/m/it/7=cmmi7
    \font\OML/cmm/m/it/10=cmmi10
    \font\OMS/cmsy/m/n/5=cmsy5
    \font\OMS/cmsy/m/n/7=cmsy7
    \font\OMS/cmsy/m/n/10=cmsy10
    3633 words of font info for 14 preloaded fonts
    14 hyphenation exceptions
    Hyphenation trie of length 23218 has 713 ops out of 2048
      2 for language 4
      235 for language 3
      207 for language 2
      88 for language 1
      181 for language 0
    No pages of output.
    Transcript written on latex.log.
    entering extended mode
    (sample.tex
    LaTeX2e <2003/12/01>
    Babel <v3.8a> and hyphenation patterns for english, french, german, ngerman, du
    mylang, nohyphenation, loaded.
    (C:\texmf\tex\latex\base\article.cls
    Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
    (C:\texmf\tex\latex\base\size12.clo)) (C:\texmf\tex\latex\base\latexsym.sty)
    (C:\texmf\tex\latex\amsfonts\amsfonts.sty)
    (C:\texmf\tex\latex\amsmath\amscd.sty (C:\texmf\tex\latex\amsmath\amsgen.sty))
    (C:\texmf\tex\latex\amsfonts\amssymb.sty)

    ! LaTeX Error: File `enumerate.sty' not found.

    Type X to quit or <RETURN> to proceed,
    or enter new name. (Default extension: sty)

    Enter file name:
     
     
  18. Jul 9, 2004 #17

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    okay, this means that one of the package's i've specified isn't in your system, the way round this is to remover enumerate from the first \usepackage{..} instruction.
     
  19. Jul 9, 2004 #18

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    kk thanks, I'll work it out later
     
  20. Jul 26, 2004 #19

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    Sorry to come up with another problem but I removed the package command and tried it again and it came up with this error:

    Code (Text):
    (sample.tex
    LaTeX2e <2003/12/01>
    Babel <v3.8a> and hyphenation patterns for english, french, german, ngerman, du
    mylang, nohyphenation, loaded.
    (C:\texmf\tex\latex\base\article.cls
    Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
    (C:\texmf\tex\latex\base\size12.clo)) (C:\texmf\tex\generic\xypic\xy.sty
    (C:\texmf\tex\generic\xypic\xy.tex Bootstrap'ing: catcodes, docmode,
    (C:\texmf\tex\generic\xypic\xyrecat.tex)
    (C:\texmf\tex\generic\xypic\xyidioms.tex)

     Xy-pic version 3.7 <1999/02/16>
     Copyright (c) 1991-1998 by Kristoffer H. Rose <krisrose@ens-lyon.fr>
     Xy-pic is free software: see the User's Guide for details.

    Loading kernel: messages; fonts; allocations: state, direction,
    utility macros; pictures: \xy, positions, objects, decorations;
    kernel objects: directionals, circles, text; options; algorithms: directions,
    edges, connections;  Xy-pic loaded) (C:\texmf\tex\generic\xypic\xyall.tex
     Xy-pic option: All features v.3.3 (C:\texmf\tex\generic\xypic\xycurve.tex
     Xy-pic option: Curve and Spline extension v.3.7 curve, circles, loaded)
    (C:\texmf\tex\generic\xypic\xyframe.tex
     Xy-pic option: Frame and Bracket extension v.3.7 loaded)
    (C:\texmf\tex\generic\xypic\xycmtip.tex
     Xy-pic option: Computer Modern tip extension v.3.3
    (C:\texmf\tex\generic\xypic\xytips.tex
     Xy-pic option: More Tips extension v.3.3 loaded) loaded)
    (C:\texmf\tex\generic\xypic\xyline.tex
     Xy-pic option: Line styles extension v.3.6 loaded)
    (C:\texmf\tex\generic\xypic\xyrotate.tex
     Xy-pic option: Rotate and Scale extension v.3.3 loaded)
    (C:\texmf\tex\generic\xypic\xycolor.tex  Xy-pic option: Colour extension v.3.3
    loaded) (C:\texmf\tex\generic\xypic\xymatrix.tex
     Xy-pic option: Matrix feature v.3.4 loaded)
    (C:\texmf\tex\generic\xypic\xyarrow.tex
     Xy-pic option: Arrow and Path feature v.3.5 path, \ar, loaded)
    (C:\texmf\tex\generic\xypic\xygraph.tex  Xy-pic option: Graph feature v.3.7
    loaded) loaded))
    No file sample.aux.

    ! LaTeX Error: Environment lem undefined.

    See the LaTeX manual or LaTeX Companion for explanation.
    Type  H <return>  for immediate help.
     ...

    l.165 \begin{lem}
    Also could you please explain how I install packages and what they do. (Oh and I tried asking it for help but it just came up with more and more confusing errors)
     
  21. Jul 26, 2004 #20

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    shoot, i'd forgotten about that bit.

    let me produce some more examples and see which works

    sample corrects the problem but uses my preferred way of numbering theorem headings and such

    sample2 i've removed all the offending things inside the body, but there are no examples of lemma headings and so on, but you can create your own using the info in any latex starter guide
     

    Attached Files:

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Program for graphs and diagrams
Loading...