public static void TwinTwinPlot(
            Dictionary <string, IEnumerable <double> > y1,
            Dictionary <string, IEnumerable <double> > y2,
            string title,
            string xlabel,
            string y1Label,
            string y2Label,
            bool show = false)
        {
            var series1 = y1.Select(ia => (ISeries)(new LineSeries {
                Label = ia.Key, X = ia.Value
            })).ToArray();
            var series2 = y2.Select(ia => (ISeries)(new LineSeries {
                Label = ia.Key, X = ia.Value
            })).ToArray();

            // Turn on color cycling for both series
            series1[0].Color = "next(palette)";
            series2[0].Color = "next(palette)";

            // Here we build the plotting script for the second plot (without the pre/postamble),
            // so we can append it to the script for the first plot
            var plotter2 = new Plotter {
                XLabel = xlabel, YLabel = y2Label, Series = series2, TwinX = true
            };

            plotter2.BuildScript();

            // TODO: http://matplotlib.org/examples/api/two_scales.html

            var plotter1 = new Plotter
            {
                Title  = title,
                XLabel = xlabel,
                YLabel = y1Label,
                Series = series1,
                Python = PythonPath,
                Show   = show,
                Tight  = true
            };

            plotter1.Plot(plotter2.Script);
        }
        /// <summary>
        /// Plot errors with evidence on twinx
        /// </summary>
        public static void PlotErrorsWithEvidence(IList <double> bases, IList <double> errors, IList <double> evidence, bool show = false)
        {
            // Here we're going to customise the Plotter.TwinPlot function
            const string title   = "Effect of number of bases";
            const string xlabel  = "#bases";
            const string y1Label = "Reconstruction error";
            const string y2Label = "Log Evidence";

            var series1 = new ISeries[] { new LineSeries {
                                              X = bases, Y = errors, Color = "next(palette)", Label = "Reconstruction error"
                                          } };
            var series2 = new ISeries[] { new LineSeries {
                                              X = bases, Y = evidence, Color = "next(palette)", Label = "Evidence"
                                          } };

            // Here we build the plotting script for the second plot (without the pre/postamble),
            // so we can append it to the script for the first plot
            var plotter2 = new Plotter {
                XLabel = xlabel, YLabel = y2Label, Series = series2, TwinX = true
            };

            plotter2.BuildScript();

            // TODO: http://matplotlib.org/examples/api/two_scales.html

            var plotter1 = new Plotter
            {
                Title      = title,
                XLabel     = xlabel,
                YLabel     = y1Label,
                Series     = series1,
                Python     = PythonPath,
                ScriptName = Path.Combine(ScriptPath, "EffectOfBases"),
                FigureName = Path.Combine(FigurePath, "EffectOfBases"),
                Show       = show
            };

            plotter1.Plot(plotter2.Script);
        }