Re: [R] why I could not reproduce the Mandelbrot plot demonstrated on R wiki

2011-07-19 Thread belisario
I had the same problem with the code of the Wikipedia in a 64-bit Windows 7.

The gif works fine if I use the executable located in bin\x64
instead of bin, which produces the ugly gif

eg, in a cmd: \bin\x64\Rscript.exe example.r

I realised the solution using the --verbose flag

Sorry about my english


--
View this message in context: 
http://r.789695.n4.nabble.com/why-I-could-not-reproduce-the-Mandelbrot-plot-demonstrated-on-R-wiki-tp2591429p3678522.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] why I could not reproduce the Mandelbrot plot demonstrated on R wiki

2010-09-26 Thread Peter Dalgaard
On 09/26/2010 04:50 AM, xin wei wrote:
> 
> hi, peter:
> thank you for your attention. adding the line you suggested did display the
> static Mandelbrot plot with good resolution on R graphics device. However,
> the resulting gif file still come out ugly. the R wiki page I was referring
> to is the following:
> http://en.wikipedia.org/wiki/R_(programming_language)
> where the nice Mandelbrot plot and sample codes are provided.
> 
> i would appreciate your help if you can provide further hint. 
> 

The caTools package might have changed since the Wikipedia graphic was
created, so perhaps you should ask its maintainer. I see an autoscale
feature that you might want to turn off. (Sorry that I can't be more
specific, but it would be overkill for me to install caTools and start
experimenting with it. After all, it is your problem, not mine.)

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] why I could not reproduce the Mandelbrot plot demonstrated on R wiki

2010-09-25 Thread xin wei

hi, peter:
thank you for your attention. adding the line you suggested did display the
static Mandelbrot plot with good resolution on R graphics device. However,
the resulting gif file still come out ugly. the R wiki page I was referring
to is the following:
http://en.wikipedia.org/wiki/R_(programming_language)
where the nice Mandelbrot plot and sample codes are provided.

i would appreciate your help if you can provide further hint. 

thanks





Peter Dalgaard-2 wrote:
> 
> On 09/24/2010 10:41 PM, xin wei wrote:
>> 
>> I am trying to reproduce the nice looking of Mandelbrot demonstrated by R
>> wiki page by the following code:
>> 
>> library(caTools)# external package providing write.gif function
>> jet.colors = colorRampPalette(c("#7F", "blue", "#007FFF", "cyan",
>> "#7FFF7F", 
>> "yellow", "#FF7F00", "red", "#7F")) 
>> m = 600 # define size
>> C = complex( real=rep(seq(-1.8,0.6, length.out=m), each=m ), 
>>  imag=rep(seq(-1.2,1.2, length.out=m), m ) ) 
>> C = matrix(C,m,m)   # reshape as square matrix of complex numbers
>> Z = 0   # initialize Z to zero
>> X = array(0, c(m,m,20)) # initialize output 3D array
>> for (k in 1:20) {   # loop with 20 iterations
>>   Z = Z^2+C # the central difference equation  
>>   X[,,k] = exp(-abs(Z)) # capture results
>> } 
>> write.gif(X, "Mandelbrot.gif", col=jet.colors, delay=100)
> 
> Hmm, I couldn't be bothered with the caTools, but it looks fine for me
> with
> 
> image(X[,,20],col=jet.colors(100))
> 
> Perhaps you need jet.colors(n) as well?
> 
> 
> 
>> however, the gif file created by this looks much worse than what is shown
>> on
>> R wiki page, see the comparison as follows (left one is what i created)
>> 
>> http://r.789695.n4.nabble.com/file/n2591429/Picture1.png 
> 
> Save for the odd color scheme, the one on the left looks like a
> Mandelbrot set, the one on the right appears to be iteration 4. I
> couldn't find your original source for this on wiki.r-project.org?
> 
> 
> -- 
> Peter Dalgaard
> Center for Statistics, Copenhagen Business School
> Phone: (+45)38153501
> Email: pd@cbs.dk  Priv: pda...@gmail.com
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: 
http://r.789695.n4.nabble.com/why-I-could-not-reproduce-the-Mandelbrot-plot-demonstrated-on-R-wiki-tp2591429p2714024.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] why I could not reproduce the Mandelbrot plot demonstrated on R wiki

2010-09-25 Thread Peter Dalgaard
On 09/24/2010 10:41 PM, xin wei wrote:
> 
> I am trying to reproduce the nice looking of Mandelbrot demonstrated by R
> wiki page by the following code:
> 
> library(caTools)# external package providing write.gif function
> jet.colors = colorRampPalette(c("#7F", "blue", "#007FFF", "cyan",
> "#7FFF7F", 
> "yellow", "#FF7F00", "red", "#7F")) 
> m = 600 # define size
> C = complex( real=rep(seq(-1.8,0.6, length.out=m), each=m ), 
>  imag=rep(seq(-1.2,1.2, length.out=m), m ) ) 
> C = matrix(C,m,m)   # reshape as square matrix of complex numbers
> Z = 0   # initialize Z to zero
> X = array(0, c(m,m,20)) # initialize output 3D array
> for (k in 1:20) {   # loop with 20 iterations
>   Z = Z^2+C # the central difference equation  
>   X[,,k] = exp(-abs(Z)) # capture results
> } 
> write.gif(X, "Mandelbrot.gif", col=jet.colors, delay=100)

Hmm, I couldn't be bothered with the caTools, but it looks fine for me with

image(X[,,20],col=jet.colors(100))

Perhaps you need jet.colors(n) as well?



> however, the gif file created by this looks much worse than what is shown on
> R wiki page, see the comparison as follows (left one is what i created)
> 
> http://r.789695.n4.nabble.com/file/n2591429/Picture1.png 

Save for the odd color scheme, the one on the left looks like a
Mandelbrot set, the one on the right appears to be iteration 4. I
couldn't find your original source for this on wiki.r-project.org?


-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.