Example #1
0
        public string Generate(Gnuplot plot)
        {
            if (plot.CurrentTerminal is TikzPlotTerminal)
            {
                // Probably incomplete list.
                return Label.Replace(@"\", @"\\").Replace("_", @"\_").Replace("{", @"\{").Replace("}", @"\}").Replace("$", @"\$");
            }

            return Label;
        }
Example #2
0
        public string Generate(Gnuplot plot)
        {
            if (plot.CurrentTerminal is TikzPlotTerminal)
            {
                // Only use the TeX label with the Tikz terminal.
                return TeXLabel;
            }

            return PlainLabel;
        }
        public void Generate(Gnuplot plot)
        {
            if (SupportsMouseClose())
            {
                // wxt terminal no longer supported in Debian Jessie. Using gnuplot-qt instead.
                // https://launchpad.net/debian/jessie/+source/gnuplot/+changelog
                // [4d67729] Disable wxt-terminal. (Closes: #750045)
                // [7342432] Increase priority of gnuplot-qt over gnuplot-x11.
                plot.Add("set terminal qt");
            }

            // Allow dashed lines, but remember to keep default solid lines.
            plot.Add("set termoption dashed");
        }
Example #4
0
        public string Generate(Gnuplot plot)
        {
            string fileName = Path.GetRandomFileName();
            using (StreamWriter writer = new StreamWriter(Path.Combine(plot.WorkingDirectory.FullName, fileName)))
            {
                foreach (IPlotPoint point in Points)
                {
                    writer.WriteLine(string.Format(CultureInfo.InvariantCulture, "{0} {1}", point.X, point.Y));
                }
                writer.Close();
            }

            // Format specification here:
            // http://www.gnuplot.info/docs_4.2/gnuplot.html#x1-10100034

            return string.Format("'{0}' using 1:2 {1} {2} {3}",
                fileName,
                Properties.Axes != null ? "axes " + Properties.Axes.Generate(plot) : "",
                Properties.Label != null ? "title '" + Properties.Label.Generate(plot) + "'" : "notitle",
                Properties.Generate(this, plot));
        }
Example #5
0
 public string Generate(Gnuplot plot)
 {
     if (Color != null)
     {
         return "linecolor rgb '" + Color + "'";
     }
     else
     {
         return "linecolor " + Index.ToString();
     }
 }
Example #6
0
 public string Generate(Gnuplot plot)
 {
     return "linetype " + Index.ToString();
 }
Example #7
0
 public string Generate(Gnuplot plot)
 {
     return Identifier;
 }
Example #8
0
 public string Generate(Gnuplot plot)
 {
     return "linewidth " + Width.ToString(CultureInfo.InvariantCulture);
 }
Example #9
0
        public string Generate(Gnuplot plot)
        {
            if (Segments.Count != 1)
            {
                throw new NotImplementedException();
            }

            /*if (function is LinearInterpolationFunction)
            {
            }*/

            string fileName = Path.GetRandomFileName();
            using (StreamWriter writer = new StreamWriter(Path.Combine(plot.WorkingDirectory.FullName, fileName)))
            {
                foreach (double x in Segments[0].CreatePoints(Function))
                {
                    double y = Function.Value(x);
                    writer.WriteLine(string.Format(CultureInfo.InvariantCulture, "{0} {1}", x, y));
                }
                writer.Close();
            }

            // Format specification here:
            // http://www.gnuplot.info/docs_4.2/gnuplot.html#x1-10100034

            return string.Format("'{0}' using 1:2 with lines {1} {2} {3}",
                fileName,
                Properties.Axes != null ? "axes " + Properties.Axes.Generate(plot) : "",
                Properties.Label != null ? "title '" + Properties.Label.Generate(plot) + "'" : "notitle",
                Properties.Generate(this, plot));
        }
        public string Generate(object sender, Gnuplot plot)
        {
            // Styles as defined here:
            // http://www.gnuplot.info/docs_4.2/gnuplot.html#x1-14700034.7

            StringBuilder sb = new StringBuilder();

            if (LineType != null)
            {
                sb.Append(LineType.Generate(plot));
                sb.Append(" ");
            }
            else if (sender is IFunctionPlot)
            {
                sb.Append(LineType.Solid.Generate(plot));
                sb.Append(" ");
            }

            if (LineWidth != null)
            {
                sb.Append(LineWidth.Generate(plot));
                sb.Append(" ");
            }
            else if (sender is IFunctionPlot && plot.CurrentTerminal is TikzPlotTerminal)
            {
                sb.Append(LineWidth.Thick.Generate(plot));
                sb.Append(" ");
            }

            if (LineColor != null)
            {
                sb.Append(LineColor.Generate(plot));
                sb.Append(" ");
            }

            if (PointType != null)
            {
                sb.Append(PointType.Generate(plot));
                sb.Append(" ");
            }

            if (PointSize != null)
            {
                sb.Append(PointSize.Generate(plot));
                sb.Append(" ");
            }
            else if (sender is IDataPlot && plot.CurrentTerminal is TikzPlotTerminal)
            {
                sb.Append(PointSize.Medium.Generate(plot));
                sb.Append(" ");
            }

            return sb.ToString();
        }
Example #11
0
 public void Generate(Gnuplot plot)
 {
     plot.Add(string.Format("set terminal pngcairo size {0},{1}", Width, Height));
     plot.Add(string.Format("set output '{0}'", File.FullName));
 }
Example #12
0
 public string Generate(Gnuplot plot)
 {
     return "pointsize " + Size.ToString(CultureInfo.InvariantCulture);
 }
        public void Generate(Gnuplot plot)
        {
            if (Options != null)
            {
                plot.Add("set terminal tikz " + Options);
            }
            else
            {
                plot.Add("set terminal tikz");
            }
            plot.Add(string.Format("set output '{0}'", TempFile.File.FullName));

            // Allow dashed lines, but remember to keep default solid lines.
            plot.Add("set termoption dashed");

            //plot.Add("set object rectangle from screen 0,0 to screen 1,1 lw 0 fillstyle noborder behind");

            // Prefer a slightly thicker line width for this terminal.
            // http://www.gnuplot.info/docs_4.2/gnuplot.html#x1-16400043.6
            plot.Add("set border linewidth " + LineWidth.Thick.Width.ToString(CultureInfo.InvariantCulture));
        }