Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently working on some graph theory, and I'm checking the robustness of graphs, by removing random vertices from a graph and then check how many vertices are outside the giant component. Then I'll do that for a lot of vertices, and plot them using ListPlot.

This takes along time to calculate, is there a way I can visualise it, that it plots something everytime a value is calculated.

thisFunctionTakesVeryLongAndReturnsAList := ....
ListPlot[thisFunctionTakesVeryLongAndReturnsAList [graph]]

thisFunctionTakesVeryLongAndReturnsAList calculates a value that can be plotted all the time

share|cite|improve this question
up vote 1 down vote accepted

Timo,

If you have Mathematica 6 or later, you can use Dynamic for this. You should rewrite your thisFunctionTakesVeryLongAndReturnsAList like this:

list = {};
calculateOnePointVeryLong[x_] := (Pause[1]; result = {x, x^2}; 
   AppendTo[list, result]; result);
Graphics[Point[Dynamic[list]], Axes -> True, 
 AspectRatio -> 1/GoldenRatio]
makeList = Table[calculateOnePointVeryLong[x], {x, 0, 10}];
share|cite|improve this answer
    
Awesome, thanks I'll check into this :) – Timo Willemsen Mar 20 '11 at 13:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.