5
votes

Let us consider the following scenario .

     for x in range (1,100)
         for y in range (2,500)
                 #plot(f(x),g(y))
         end
     end

where f(x) and g(y) are some user defined functions.

The output must be the desired points on plane.

Is there any way in julia to do like what I need ?

In general I can do like this

     for x in range (1,100)
         for y in range (2,500)
                 push!(l,f(x))
                 push!(m,g(y))
         end
     end

and then plotting from the two lists l,m as x,y axes respectively.

But now I want to plot points while executing loop.

2
You can do this with Winston, see oplot.jverzani
Where do you want the plots to appear? In separate files? Each plot in its own Window? Or ... ?Steven G. Johnson
@StevenG.Johnson In only one plot.hanugm

2 Answers

4
votes

This is mostly supported in Plots... see https://github.com/tbreloff/Plots.jl/issues/30 for a little more information and some example usage.

1
votes

use the display function:

for x in 1:100
          p = plot(f(x),g(y))
          display(p)
          sleep(1)
 end

(inspired by Andreas Peter on the Julia slack #helpdesk channel)