Creating Graphs in TeX

Creating Graphs in TeX

by John Rodgers -
Number of replies: 11
I have been watching some of the discussions here with interest, but not a comprehensive understanding.

I am very impressed and interested in the SVG graphs that I see produced with the ascii-SVG filter. Unfortunately the absence of SVG support in IE is a deal breaker for me. Is there a way to do something similar generating PNG or GIF's?

A second possible solution for me would be to produce the graphics beforehand, rather than at run time, and load them into a course. That might mean generating the SVG files and converting them to PNG's or GIF's, and then uploading them.

To give you and idea of my current work flow:

I generate questions sets using a spreadsheet (for example, I might produce 10-20 versions of the same question, each with different parameters). I have added several functions to the sheets to translate and produce the TeX.

If I want to include graphics, I generate them first using screen captures, encode the appropriate parameters in the file names, then have a filter generate the appropriate question. It is an arcane process. Being able to generate the questions and the graphics from the appropriate parameters would really streamline things.
Average of ratings: -
In reply to John Rodgers

Re: Creating Graphs in TeX

by Jeff Forssell -
1 Having the names of picture files contain too much information (for students when you don't want to assess their ability to guess based on the img src file name) can be a problem. It's nice for the teacher to have a file name that says what it is showing when finding which graph goes to which question, but that can be a "risk" in assessment.

The same goes for sound and other media files.
In reply to John Rodgers

Re: Creating Graphs in TeX

by Marc Grober -
IE does not do mathml or svg without plugins, which are available, but as I understand you won't use, and you won't pass on IE, which is arguably lousy proprietary software which runs on a proprietary os whose licensor has been repeatedly charged worldwide with unlawful business practices. Mmmmmm, I am sure Pearson has a solution for you ;=}
In reply to Marc Grober

Re: Creating Graphs in TeX

by John Rodgers -
Unfortunately, I'm not the one making the decisions on IE (I never use it myself). And who is this Pearson guy?
In reply to John Rodgers

Re: Creating Graphs in TeX

by Marc Grober -
Sorry John, just yanking your chain-Pearosom is a huge commercial textbook publisher now getting into CMS ;=}

Yes, webworks has extensive perl. In fact the moodle algebra filter was adapted from the webworks syntax parser.

Did you check out the moz based svg plugin I posted the link for (sevarese)?
In reply to Marc Grober

Re: Creating Graphs in TeX

by John Rodgers -
Sorry Marc. My use of the semi-colon wink is limited. I did actually know about big brother Pearson.

My problem is my courses are delivered to a variety of locations in the district and the only requirement specified to take the course is IE. Unfortunately the students can't install their own plug ins.
In reply to John Rodgers

Re: Creating Graphs in TeX

by Mauno Korpelainen -

Hi John,

there are of course several such tools that can output different image formats and graph types...or you can create svg images online or offline and save them as png images...

Check for example http://moodle.org/mod/forum/discuss.php?d=128880 

What kind of graphs do you need? Can you give an example?

In reply to Mauno Korpelainen

Re: Creating Graphs in TeX

by John Rodgers -
The simplest example would be a Cartesian plane with a parabola translated to some location.

The context might be: Identify the appropriate equation (multiple choice or fill in the blank)

The current work flow would involve:
  1. use Geogebra or Geometer' Sketchpad to generate graphs
  2. use Snagit to capture them, saving them with a file name that would encode the parameters
  3. putting the graphic file names onto a spreadsheet.
  4. writing a formula to extract the parameters from the file names.
  5. create the question template to use the parameters
  6. generate the questions in GIFT format
  7. upload the questions.
  8. upload the graphics.
If the current ascii SVG were available to me the work flow would look more like:
  1. Generate the template and parameters
  2. Generate the questions
  3. Upload the questions.
An alternative that would be favorable:
  1. Generate the question template and parameters
  2. generate the questions
  3. Capture the graphics generated by the questions (a possibility with ascii SVG) using snagit, or perhaps generating the SVG files and converting them to PNGs.
  4. upload the questions and graphics.
The fewer steps, the fewer errors. Obviously STACK would be ideal but its a significant few steps away.

I have contemplated trying to integrate with some of the CAS systems (maxima with GNU plot, but I'm not sure I can satisfy my needs without some significant development.


In reply to John Rodgers

Re: Creating Graphs in TeX

by Marc Grober -
Couple of points John,
a) you could put asciimath asciisvg etc at any web accessible location and the reference it in a hotpot and then load your hotpot into your moodle if you can't install on your moodle site.
b) you can look at Descartes and invoke it as part of quiz or even java sketch pad- eg http://pedagogy.wik.is/Mathematics_Instruction/Using_Java_in_the_Wiki
c) once SEE us available you can look at students submitting their own graphs; this could be done with asciisvg but students would have to learn primitives
In reply to John Rodgers

Re: Creating Graphs in TeX

by Marc Grober -
In reply to Marc Grober

Re: Creating Graphs in TeX

by John Rodgers -
I was rummaging through WebWork a long time ago and I noticed a passing reference to a png graphing package. I believe it is used by the Webwork framework to generate the pngs on the fly, much as TeX will with formulas (PERL I bet).

You guys seem to be doing some amazing things with plug ins, I was curious if there was an obvious solution.

I admit a PNG or GIF solution is extremely inelegant but the stack is almost always in place for the end user.