Wiwik Andriyani
Wiwik Andriyani

Reputation: 51

Use a plot from R in C#

I need your help...to solve my problem...

I want to use the plot() function from R in C#. However, I don't know how to put the plot that I get from R, into picture box or panel in C#.

Here the code that I've used to get plot from R:

engine.Evaluate("r.plot <- plot(r$condition, r$access, 
                                main='condition category vs access category',
                                xlab='condition', ylab='access', 
                                pch=1, col='blue')" );

How could I put the plot into picture box or panel in C# ???

Upvotes: 5

Views: 2579

Answers (1)

j-m
j-m

Reputation: 1554

The best working option is to save a file from R and open with a picture box. A couple of contributors to R.NET wrote code currently in an alpha NuGet package R.NET.Graphics. This was a prototype for a seamless graphic device for R. A fully fledged device would be a lot of work, and this graphics module is not actively developed currently (anyone game for it out there?).

Have a look at RDotNet.Graphics.Tests there is code showing side by side the visual output via R.NET.Graphics and from a loaded file.

Upvotes: 5

Related Questions