I want to plot some graphics for my course project via Mathematica. There is code from the project:
try
{
toCompute = @"Show[RegionPlot[-2 <= x1 && x1 <= 2
&& -2 <= x2 && x2 <= 2, {x1, -2,
2}, {x2, -2, 2}, PlotStyle -> RGBColor[0.7, 1, 1]],
Table[ContourPlot[Sin[x1]*x2 == i, {x1, -2, 2},
{x2, -2, 2}], {i, -5, 5, 0.5}], PlotRange -> All]";
Function.MathKernel.Compute(toCompute);
if (Function.MathKernel.Graphics.Length > 0)
Show(Function.MathKernel.Graphics[0]);
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
Code works without any error, but result Image is empty (only background without graphic). If I type toCompure string into Mathematica - it plots the graphic.
Why so happens?