Produce slides show of the different cycles. One plot per cycle.
430173
def slideshow(self, **kwargs):
        
        for label, cycle in self.items():
            cycle.plot(title=label, tight_layout=True)
979267
def show(cmap, var, vmin=None, vmax=None):
    '''

    '''

    # get variable data
    lat, lon, z, data = read(var)

    fig = plt.figure(figsize=(16, 12))

    # Plot with grayscale
    ax = fig.add_subplot(3, 1, 1)
    map1 = ax.scatter(lon, -z, c=data, cmap='gray', s=10, linewidths=0., vmin=vmin, vmax=vmax)
    plt.colorbar(map1, ax=ax)

    # Plot with jet
    ax = fig.add_subplot(3, 1, 2)
    map1 = ax.scatter(lon, -z, c=data, cmap='jet', s=10, linewidths=0., vmin=vmin, vmax=vmax)
    plt.colorbar(map1, ax=ax)

    # Plot with cmap
    ax = fig.add_subplot(3, 1, 3)
    map1 = ax.scatter(lon, -z, c=data, cmap=cmap, s=10, linewidths=0., vmin=vmin, vmax=vmax)
    ax.set_xlabel('Longitude [degrees]')
    ax.set_ylabel('Depth [m]')
    plt.colorbar(map1, ax=ax)

    plt.suptitle(var)
35408
function slide18() {
		var slide = pptx.addNewSlide();
		slide.addNotes('API Docs: https://gitbrent.github.io/PptxGenJS/docs/api-charts.html');
		slide.addTable( [ [{ text:'Chart Options: Shadow, Transparent Colors', options:gOptsTextL },gOptsTextR] ], gOptsTabOpts );

		var arrDataRegions = [{
			name  : 'Region 2',
			labels: ['April', 'May', 'June', 'July', 'August'],
			values: [0, 30, 53, 10, 25]
		}, {
			name  : 'Region 3',
			labels: ['April', 'May', 'June', 'July', 'August'],
			values: [17, 26, 53, 100, 75]
		}, {
			name  : 'Region 4',
			labels: ['April', 'May', 'June', 'July', 'August'],
			values: [55, 43, 70, 90, 80]
		}, {
			name  : 'Region 5',
			labels: ['April', 'May', 'June', 'July', 'August'],
			values: [55, 43, 70, 90, 80]
		}];
		var arrDataHighVals = [
			{
				name  : 'California',
				labels: ['Apartment', 'Townhome', 'Duplex', 'House', 'Big House'],
				values: [2000, 2800, 3200, 4000, 5000]
			},
			{
				name  : 'Texas',
				labels: ['Apartment', 'Townhome', 'Duplex', 'House', 'Big House'],
				values: [1400, 2000, 2500, 3000, 3800]
			}
		];
		var single = [{
			name  : 'Texas',
			labels: ['Apartment', 'Townhome', 'Duplex', 'House', 'Big House'],
			values: [1400, 2000, 2500, 3000, 3800]
		}];

		// TOP-LEFT: H/bar
		var optsChartBar1 = { x:0.5, y:0.6, w:6.0, h:3.0,
			showTitle: true,
			title: 'Large blue shadow',
			barDir: 'bar',
			barGrouping: 'standard',
			dataLabelColor   : 'FFFFFF',
			showValue        : true,
			shadow: {
				type: 'outer',
				blur: 10,
				offset: 5,
				angle: 45,
				color: '0059B1',
				opacity: 1
			}
		};

		var pieOptions = { x:7.0, y:0.6, w:6.0, h:3.0,
			showTitle: true,
			title: 'Rotated cyan shadow',
			dataLabelColor   : 'FFFFFF',
			shadow: {
				type: 'outer',
				blur: 10,
				offset: 5,
				angle: 180,
				color: '00FFFF',
				opacity: 1
			}
		};

		// BTM-LEFT: H/bar - 100% layout without axis labels
		var optsChartBar3 = { x:0.5, y:3.8, w:6.0, h:3.5,
			showTitle: true,
			title: 'No shadow, transparent colors',
			barDir     : 'bar',
			barGrouping: 'stacked',
			chartColors: ['transparent', '5DA5DA', 'transparent', 'FAA43A'],
			shadow: 'none'
		};

		// BTM-RIGHT: V/col - TITLE and LEGEND
		var optsChartBar4 = { x:7.0, y:3.8, w:6.0, h:3.5,
			barDir: 'col',
			barGrouping: 'stacked',
			showTitle: true,
			title: 'Red glowing shadow',
			catAxisLabelColor   : '0000CC',
			catAxisLabelFontFace: 'Times',
			catAxisLabelFontSize: 12,
			catAxisOrientation  : 'minMax',
			chartColors: ['5DA5DA','FAA43A'],
			shadow: {
				type: 'outer',
				blur: 20,
				offset: 1,
				angle: 90,
				color: 'A70000',
				opacity: 1
			}
		};

		slide.addChart( pptx.charts.BAR, single, optsChartBar1 );
		slide.addChart( pptx.charts.PIE, dataChartPieStat, pieOptions );
		slide.addChart( pptx.charts.BAR, arrDataRegions, optsChartBar3 );
		slide.addChart( pptx.charts.BAR, arrDataHighVals, optsChartBar4 );
	}
939616
def scatterplot(self, x, y, **kw):
        
        self.panel.scatterplot(x, y, **kw)
688558
def map_with_slider(h3: HistogramND, *, show_zero: bool = True, show_values: bool = False, **kwargs) -> dict:
    
    vega = _create_figure(kwargs)

    values_arr = get_data(h3, kwargs.pop("density", None), kwargs.pop("cumulative", None))
    values = values_arr.tolist()
    value_format = get_value_format(kwargs.pop("value_format", None))

    _add_title(h3, vega, kwargs)
    _create_scales(h3, vega, kwargs)
    _create_axes(h3, vega, kwargs)
    _create_cmap_scale(values_arr, vega, kwargs)
    _create_colorbar(vega, kwargs)

    x = h3.get_bin_centers(0)
    y = h3.get_bin_centers(1)
    x1 = h3.get_bin_left_edges(0)
    x2 = h3.get_bin_right_edges(0)
    y1 = h3.get_bin_left_edges(1)
    y2 = h3.get_bin_right_edges(1)

    data = []
    for i in range(h3.shape[0]):
        for j in range(h3.shape[1]):
            for k in range(h3.shape[2]):
                if not show_zero and values[i][j][k] == 0:
                    continue
                item = {
                    "x": float(x[i]),
                    "x1": float(x1[i]),
                    "x2": float(x2[i]),
                    "y": float(y[j]),
                    "y1": float(y1[j]),
                    "y2": float(y2[j]),
                    "k": k,
                    "c": float(values[i][j][k]),
                }
                if show_values:
                    item["label"] = value_format(values[i][j][k])
                data.append(item)

    vega["signals"] = [
        {
            "name": "k", "value": h3.shape[2] // 2,
            "bind": {
                "input": "range", "min": 0, "max": h3.shape[2] - 1,
                "step": 1, "name": (h3.axis_names[2] or "axis2") + " [slice]"
            }
        }
    ]

    vega["data"] = [{
        "name": "table",
        "values": data,
        "transform": [
             {
                 "type": "filter",
                 "expr": "k == datum.k",
             }
        ]
    }]

    vega["marks"] = [
        {
            "type": "rect",
            "from": {"data": "table"},
            "encode": {
                "enter": {
                    "x": {"scale": "xscale", "field": "x1"},
                    "x2": {"scale": "xscale", "field": "x2"},
                    "y": {"scale": "yscale", "field": "y1"},
                    "y2": {"scale": "yscale", "field": "y2"},
                    "fill": {"scale": "color", "field": "c"},
                    "stroke": {"value": 0},
                    # "strokeWidth": {"value": 0},
                    # "fillColor": {"value": "#ffff00"}
                },
                # "update": {
                #     "fillOpacity": {"value": 0.6}
                # },
                # "hover": {
                #     "fillOpacity": {"value": 0.5}
                # }
            }
        }
    ]

    if show_values:
        vega["marks"].append(
            {
                "type": "text",
                "from": {"data": "table"},
                "encode": {
                    "enter": {
                        "align": {"value": "center"},
                        "baseline": {"value": "middle"},
                        "fontSize": {"value": 13},
                        "fontWeight": {"value": "bold"},
                        "text": {"field": "label"},
                        "x": {"scale": "xscale", "field": "x"},
                        "y": {"scale": "yscale", "field": "y"},
                    }
                }
            }
        )

    return vega
106052
def combiplot(self, fontsize=8, **kwargs):
        
        ax_list = None
        for i, (label, cycle) in enumerate(self.items()):
            fig = cycle.plot(ax_list=ax_list, label=label, fontsize=fontsize,
                             lw=2.0, marker="o", linestyle="-", show=False)
            ax_list = fig.axes

        return fig
618599
function slide17() {
		// powerpoint 2016 add secondary category axis labels
		// https://peltiertech.com/chart-with-a-dual-category-axis/

		var slide = pptx.addNewSlide();
		slide.addNotes('API Docs: https://gitbrent.github.io/PptxGenJS/docs/api-charts.html');
		slide.addTable( [ [{ text:'Chart Examples: Multi-Type Charts', options:gOptsTextL },gOptsTextR] ], gOptsTabOpts );

		function doStackedLine() {
			// TOP-RIGHT:
			var opts = {
				x: 7.0, y: 0.6, w: 6.0, h: 3.0,
				barDir: 'col',
				barGrouping: 'stacked',
				catAxisLabelColor: '0000CC',
				catAxisLabelFontFace: 'Arial',
				catAxisLabelFontSize: 12,
				catAxisOrientation: 'minMax',
				showLegend: false,
				showTitle: false,
				valAxisMaxVal: 100,
				valAxisMajorUnit: 10
			};

			var labels = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'];
			var chartTypes = [
				{
					type: pptx.charts.BAR,
					data: [
						{
							name: 'Bottom',
							labels: labels,
							values: [17, 26, 53, 10, 4]
						},
						{
							name: 'Middle',
							labels: labels,
							values: [55, 40, 20, 30, 15]
						},
						{
							name: 'Top',
							labels: labels,
							values: [10, 22, 25, 35, 70]
						}
					],
					options: {
						barGrouping: 'stacked'
					}
				},
				{
					type: pptx.charts.LINE,
					data: [{
						name: 'Current',
						labels: labels,
						values: [25, 35, 55, 10, 5]
					}],
					options: {
						barGrouping: 'standard'
					}
				}
			];
			slide.addChart(chartTypes, opts);
		}

		function doColumnAreaLine() {
			var opts = {
				x: 0.6, y: 0.6, w: 6.0, h: 3.0,
				barDir: 'col',
				catAxisLabelColor: '666666',
				catAxisLabelFontFace: 'Arial',
				catAxisLabelFontSize: 12,
				catAxisOrientation: 'minMax',
				showLegend: false,
				showTitle: false,
				valAxisMaxVal: 100,
				valAxisMajorUnit: 10,

				valAxes:[
					{
						showValAxisTitle: true,
						valAxisTitle: 'Primary Value Axis'
					}, {
						showValAxisTitle: true,
						valAxisTitle: 'Secondary Value Axis',
						valGridLine: 'none'
					}
				],

				catAxes: [
					{
						catAxisTitle: 'Primary Category Axis'
					}, {
						catAxisHidden: true
					}
				]
			};

			var labels = ['April', 'May', 'June', 'July', 'August'];
			var chartTypes = [
				{
					type: pptx.charts.AREA,
					data: [{
						name: 'Current',
						labels: labels,
						values: [1, 4, 7, 2, 3]
					}],
					options: {
						chartColors: ['00FFFF'],
						barGrouping: 'standard',
						secondaryValAxis: !!opts.valAxes,
						secondaryCatAxis: !!opts.catAxes
					}
				}, {
					type: pptx.charts.BAR,
					data: [{
						name: 'Bottom',
						labels: labels,
						values: [17, 26, 53, 10, 4]
					}],
					options: {
						chartColors: ['0000FF'],
						barGrouping: 'stacked'
					}
				}, {
					type: pptx.charts.LINE,
					data: [{
						name: 'Current',
						labels: labels,
						values: [5, 3, 2, 4, 7]
					}],
					options: {
						barGrouping: 'standard',
						secondaryValAxis: !!opts.valAxes,
						secondaryCatAxis: !!opts.catAxes
					}
				}
			];
			slide.addChart(chartTypes, opts);
		}

		function doStackedDot() {
			// BOT-LEFT:
			var opts = {
				x: 0.6, y: 4.0, w: 6.0, h: 3.0,
				barDir: 'col',
				barGrouping: 'stacked',
				catAxisLabelColor: '999999',
				catAxisLabelFontFace: 'Arial',
				catAxisLabelFontSize: 14,
				catAxisOrientation: 'minMax',
				showLegend: false,
				showTitle: false,
				valAxisMaxVal: 100,
				valAxisMinVal: 0,
				valAxisMajorUnit: 20,

				lineSize: 0,
				lineDataSymbolSize: 20,
				lineDataSymbolLineSize: 2,
				lineDataSymbolLineColor: 'FF0000',

				//dataNoEffects: true,

				valAxes:[
					{
						showValAxisTitle: true,
						valAxisTitle: 'Primary Value Axis'
					}, {
						showValAxisTitle: true,
						valAxisTitle: 'Secondary Value Axis',
						catAxisOrientation  : 'maxMin',
						valAxisMajorUnit: 1,
						valAxisMaxVal: 10,
						valAxisMinVal: 1,
						valGridLine: 'none'
					}
				],
				catAxes: [
					{
						catAxisTitle: 'Primary Category Axis'
					}, {
						catAxisHidden: true
					}

				]
			};

			var labels = ['Q1', 'Q2', 'Q3', 'Q4', 'OT'];
			var chartTypes = [
				{
					type: pptx.charts.BAR,
					data: [{
						name: 'Bottom',
						labels: labels,
						values: [17, 26, 53, 10, 4]
					},
						{
							name: 'Middle',
							labels: labels,
							values: [55, 40, 20, 30, 15]
						},
						{
							name: 'Top',
							labels: labels,
							values: [10, 22, 25, 35, 70]
						}],
					options: {
						barGrouping: 'stacked'
					}
				}, {
					type: pptx.charts.LINE,
					data: [{
						name: 'Current',
						labels: labels,
						values: [5, 3, 2, 4, 7]
					}],
					options: {
						barGrouping: 'standard',
						secondaryValAxis: !!opts.valAxes,
						secondaryCatAxis: !!opts.catAxes,
						chartColors: ['FFFF00']
					}
				}
			];
			slide.addChart(chartTypes, opts);
		}

		function doBarCol() {
			// BOT-RGT:
			var opts = {
				x: 7, y: 4.0, w: 6.0, h: 3.0,
				barDir: 'col',
				barGrouping: 'stacked',
				catAxisLabelColor: '999999',
				catAxisLabelFontFace: 'Arial',
				catAxisLabelFontSize: 14,
				catAxisOrientation: 'minMax',
				showLegend: false,
				showTitle: false,
				valAxisMaxVal: 100,
				valAxisMinVal: 0,
				valAxisMajorUnit: 20,
				valAxes:[
					{
						showValAxisTitle: true,
						valAxisTitle: 'Primary Value Axis'
					}, {
						showValAxisTitle: true,
						valAxisTitle: 'Secondary Value Axis',
						catAxisOrientation  : 'maxMin',
						valAxisMajorUnit: 1,
						valAxisMaxVal: 10,
						valAxisMinVal: 1,
						valGridLine: 'none'
					}
				],
				catAxes: [
					{
						catAxisTitle: 'Primary Category Axis'
					}, {
						catAxisHidden: true
					}

				]
			};

			var labels = ['Q1', 'Q2', 'Q3', 'Q4', 'OT'];
			var chartTypes = [
				{
					type: pptx.charts.BAR,
					data: [{
						name: 'Bottom',
						labels: labels,
						values: [17, 26, 53, 10, 4]
					},
						{
							name: 'Middle',
							labels: labels,
							values: [55, 40, 20, 30, 15]
						},
						{
							name: 'Top',
							labels: labels,
							values: [10, 22, 25, 35, 70]
						}],
					options: {
						barGrouping: 'stacked'
					}
				}, {
					type: pptx.charts.BAR,
					data: [{
						name: 'Current',
						labels: labels,
						values: [5, 3, 2, 4, 7]
					}],
					options: {
						barDir: 'bar',
						barGrouping: 'standard',
						secondaryValAxis: !!opts.valAxes,
						secondaryCatAxis: !!opts.catAxes
					}
				}
			];
			slide.addChart(chartTypes, opts);
		}

		function readmeExample() {
			// for testing - not rendered in demo
			var labels = ['Q1', 'Q2', 'Q3', 'Q4', 'OT'];
			var chartTypes = [
				{
					type: pptx.charts.BAR,
					data: [{
						name: 'Projected',
						labels: labels,
						values: [17, 26, 53, 10, 4]
					}],
					options: {
						barDir: 'col'
					}
				}, {
					type: pptx.charts.LINE,
					data: [{
						name: 'Current',
						labels: labels,
						values: [5, 3, 2, 4, 7]
					}],
					options: {
						secondaryValAxis: true,
						secondaryCatAxis: true
					}
				}
			];
			var multiOpts = {
				x:1.0, y:1.0, w:6, h:6,
				valAxisMaxVal: 100,
				valAxisMinVal: 0,
				valAxisMajorUnit: 20,
				valAxes:[
					{
						showValAxisTitle: true,
						valAxisTitle: 'Primary Value Axis'
					}, {
						showValAxisTitle: true,
						valAxisTitle: 'Secondary Value Axis',
						valAxisMajorUnit: 1,
						valAxisMaxVal: 10,
						valAxisMinVal: 1,
						valGridLine: 'none'
					}
				],
				catAxes: [
					{
						catAxisTitle: 'Primary Category Axis'
					}, {
						catAxisHidden: true
					}

				]
			};

			slide.addChart(chartTypes, multiOpts);
		}

		doBarCol();
		doStackedDot();
		doColumnAreaLine();
		doStackedLine();
		//readmeExample();
	}
1084774
def show_frequencies(vid_data, fps, bounds=None):
    """"""
    averages = []

    if bounds:
        for x in range(1, vid_data.shape[0] - 1):
            averages.append(vid_data[x, bounds[2]:bounds[3], bounds[0]:bounds[1], :].sum())
    else:
        for x in range(1, vid_data.shape[0] - 1):
            averages.append(vid_data[x, :, :, :].sum())

    averages = averages - min(averages)

    charts_x = 1
    charts_y = 2
    pyplot.figure(figsize=(20, 10))
    pyplot.subplots_adjust(hspace=.7)

    pyplot.subplot(charts_y, charts_x, 1)
    pyplot.title("Pixel Average")
    pyplot.xlabel("Time")
    pyplot.ylabel("Brightness")
    pyplot.plot(averages)

    freqs = scipy.fftpack.fftfreq(len(averages), d=1.0 / fps)
    fft = abs(scipy.fftpack.fft(averages))
    idx = np.argsort(freqs)

    pyplot.subplot(charts_y, charts_x, 2)
    pyplot.title("FFT")
    pyplot.xlabel("Freq (Hz)")
    freqs = freqs[idx]
    fft = fft[idx]

    freqs = freqs[len(freqs) // 2 + 1:]
    fft = fft[len(fft) // 2 + 1:]
    pyplot.plot(freqs, abs(fft))

    pyplot.show()
253899
def plot_iv_curve(a, hold_v, i, *plt_args, **plt_kwargs):    
    """"""
    grid = plt_kwargs.pop('grid',True)
    same_fig = plt_kwargs.pop('same_fig',False) 
    if not len(plt_args):
        plt_args = ('ko-',)
    if 'label' not in plt_kwargs: 
        plt_kwargs['label'] = 'Current'
    if not same_fig:
        make_iv_curve_fig(a, grid=grid)
    if type(i) is dict:
        i = [i[v] for v in hold_v]
    plt.plot([v*1e3 for v in hold_v], [ii*1e12 for ii in i], *plt_args, **plt_kwargs)
    plt.legend(loc=2)
1061004
def summary_plotting_engine(**kwargs):
    """"""

    logging.debug(f"Using {prms.Batch.backend} for plotting")
    experiments = kwargs["experiments"]
    farms = kwargs["farms"]
    barn = None

    logging.debug("    - summary_plot_engine")
    farms = _preparing_data_and_plotting(
        experiments=experiments,
        farms=farms
    )

    return farms, barn
819020
def plot(ts, title=None, show=True):
    
    ts = _remove_pi_crossings(ts)
    fig = plt.figure()
    ylabelprops = dict(rotation=0, 
                       horizontalalignment='right', 
                       verticalalignment='center', 
                       x=-0.01)
    if ts.ndim > 2: # multiple sim timeseries. collapse vars onto each subplot.
        num_subplots = ts.shape[ts.ndim - 1]
        if title is None:
            title = u'time series at each node'
        for i in range(num_subplots):
            ax = fig.add_subplot(num_subplots, 1, i+1)
            ax.plot(ts.tspan, ts[...,i])
            if ts.labels[-1] is not None:
                ax.set_ylabel(ts.labels[-1][i], **ylabelprops)
            else:
                ax.set_ylabel('node ' + str(i), **ylabelprops)
            plt.setp(ax.get_xticklabels(), visible=False)
        fig.axes[0].set_title(title)
        plt.setp(fig.axes[num_subplots-1].get_xticklabels(), visible=True)
        fig.axes[num_subplots-1].set_xlabel('time (s)')
    else: # single sim timeseries. show each variable separately.
        if ts.ndim is 1:
            ts = ts.reshape((-1, 1))
        num_ax = ts.shape[1]
        if title is None:
            title=u'time series'
        axprops = dict()
        if num_ax > 10:
            axprops['yticks'] = []
        colors = _get_color_list()
        for i in range(num_ax):
            rect = 0.1, 0.85*(num_ax - i - 1)/num_ax + 0.1, 0.8, 0.85/num_ax
            ax = fig.add_axes(rect, **axprops)
            ax.plot(ts.tspan, ts[...,i], color=colors[i % len(colors)])
            plt.setp(ax.get_xticklabels(), visible=False)
            if ts.labels[1] is not None:
                ax.set_ylabel(ts.labels[1][i], **ylabelprops)
        fig.axes[0].set_title(title)
        plt.setp(fig.axes[num_ax-1].get_xticklabels(), visible=True)
        fig.axes[num_ax-1].set_xlabel('time (s)')
    if show:
        fig.show()
    return fig
282690
def plot_counts(df, theme):
    
    dates, counts = df['date-observation'], df[theme + "_count"]
    fig, ax = plt.subplots()
    ax.set_ylabel("{} pixel counts".format(" ".join(theme.split("_"))))
    ax.set_xlabel("observation date")
    ax.plot(dates, counts, '.')
    fig.autofmt_xdate()
    plt.show()
752202
def plot_clock_diagrams(self, colormap="summer"):
        
        cmap = plt.get_cmap(colormap)
        for res in self.topology_data.dict_of_plotted_res:
            colors = [cmap(i) for i in numpy.linspace(0, 1, len(self.topology_data.dict_of_plotted_res[res]))]
            traj_colors_ = {traj:colors[i] for i,traj in enumerate(self.topology_data.dict_of_plotted_res[res])}
            plt.figure(figsize=(2.25, 2.25))
            ring_number=[sum(1 for x in v if x) for k,v in self.topology_data.dict_of_plotted_res.items()][0]
            self.topology_data.ring_number = ring_number
            rings=[]
            # When only a few rings to plot they can be thicker
            if ring_number<2:
                width = 0.3
            else:
                width = 0.2
            for ring in range(0,ring_number):
                ring,_=plt.pie([self.topology_data.dict_of_plotted_res[res][ring],1-self.topology_data.dict_of_plotted_res[res][ring]],  radius=0.9+width*(ring+1), startangle=90, colors=[colors[ring],"white"], counterclock=False)
                rings=rings+ring
            plt.setp(rings, width=width)
            if len(self.topology_data.universe.protein.segments)<=1:
            #Settings with domain
                plt.text(-0.0,-0.62,res[0]+"\n"+res[1],ha='center',size=32, fontweight='bold')
            else:
                plt.text(-0.0,-0.72,res[0]+"\n"+res[1]+"\n"+res[2],ha='center',size=25, fontweight='bold')
            pylab.savefig(res[1]+res[2]+".svg", dpi=300, transparent=True)
1147298
def show_multi(func:Callable[[int,int],Image], r:int=1, c:int=1, figsize:Tuple=(9,9)):
    ""
    plot_multi(lambda i,j,ax: func(i,j).show(ax), r, c, figsize=figsize)
381770
function slide1() {
		var slide = pptx.addNewSlide();
		slide.addNotes('API Docs: https://gitbrent.github.io/PptxGenJS/docs/api-charts.html');
		slide.addTable( [ [{ text:'Chart Examples: Bar Chart', options:gOptsTextL },gOptsTextR] ], gOptsTabOpts );

		var arrDataRegions = [
			{
				name  : 'Region 1',
				labels: ['May', 'June', 'July', 'August'],
				values: [26, 53, 100, 75]
			},
			{
				name  : 'Region 2',
				labels: ['May', 'June', 'July', 'August'],
				values: [43.5, 70.3, 90.1, 80.05]
			}
		];
		var arrDataHighVals = [
			{
				name  : 'California',
				labels: ['Apartment', 'Townhome', 'Duplex', 'House', 'Big House'],
				values: [2000, 2800, 3200, 4000, 5000]
			},
			{
				name  : 'Texas',
				labels: ['Apartment', 'Townhome', 'Duplex', 'House', 'Big House'],
				values: [1400, 2000, 2500, 3000, 3800]
			}
		];

		// TOP-LEFT: H/bar
		var optsChartBar1 = { x:0.5, y:0.6, w:6.0, h:3.0,
			barDir: 'bar',
			border: { pt:'3', color:'00EE00' },
			fill: 'F1F1F1',

			catAxisLabelColor   : 'CC0000',
			catAxisLabelFontFace: 'Helvetica Neue',
			catAxisLabelFontSize: 14,
			catAxisOrientation  : 'maxMin',
			// valAxisCrossesAt: 10,

			titleColor   : '33CF22',
			titleFontFace: 'Helvetica Neue',
			titleFontSize: 24
		};
		slide.addChart( pptx.charts.BAR, arrDataRegions, optsChartBar1 );

		// TOP-RIGHT: V/col
		var optsChartBar2 = { x:7.0, y:0.6, w:6.0, h:3.0,
			barDir: 'col',

			catAxisLabelColor   : '0000CC',
			catAxisLabelFontFace: 'Courier',
			catAxisLabelFontSize: 12,
			catAxisOrientation  : 'minMax',

			dataBorder         : { pt:'1', color:'F1F1F1' },
			dataLabelColor     : '696969',
			dataLabelFontFace  : 'Arial',
			dataLabelFontSize  : 11,
			dataLabelPosition  : 'outEnd',
			dataLabelFormatCode: '#.0',
			showValue          : true,

			valAxisOrientation: 'maxMin',

			showLegend: false,
			showTitle : false
		};
		slide.addChart( pptx.charts.BAR, arrDataRegions, optsChartBar2 );

		// BTM-LEFT: H/bar - TITLE and LEGEND
		slide.addText( '.', { x:0.5, y:3.8, w:6.0, h:3.5, fill:'F1F1F1', color:'F1F1F1'} );
		var optsChartBar3 = { x:0.5, y:3.8, w:6.0, h:3.5,
			barDir     : 'bar',

			border: { pt:'3', color:'CF0909' },
			fill: 'F1C1C1',

			catAxisLabelColor   : 'CC0000',
			catAxisLabelFontFace: 'Helvetica Neue',
			catAxisLabelFontSize: 14,
			catAxisOrientation  : 'minMax',

			titleColor   : '33CF22',
			titleFontFace: 'Helvetica Neue',
			titleFontSize: 16,

			showTitle : true,
			title: 'Sales by Region'
		};
		slide.addChart( pptx.charts.BAR, arrDataHighVals, optsChartBar3 );

		// BTM-RIGHT: V/col - TITLE and LEGEND
		slide.addText( '.', { x:7.0, y:3.8, w:6.0, h:3.5, fill:'F1F1F1', color:'F1F1F1'} );
		var optsChartBar4 = { x:7.0, y:3.8, w:6.0, h:3.5,
			barDir: 'col',
			barGapWidthPct: 25,
			chartColors: ['0088CC', '99FFCC'],
			chartColorsOpacity: 50,
			valAxisMaxVal: 5000,

			catAxisLabelColor   : '0000CC',
			catAxisLabelFontFace: 'Times',
			catAxisLabelFontSize: 11,
			catAxisOrientation  : 'minMax',

			dataBorder         : { pt:'1', color:'F1F1F1' },
			dataLabelColor     : 'FFFFFF',
			dataLabelFontFace  : 'Arial',
			dataLabelFontSize  : 10,
			dataLabelPosition  : 'ctr',
			showValue          : true,

			showLegend : true,
			legendPos  :  't',
			legendColor: 'FF0000',
			showTitle  : true,
			titleColor : 'FF0000',
			title      : 'Red Title and Legend'
		};
		slide.addChart( pptx.charts.BAR, arrDataHighVals, optsChartBar4 );
	}
1372364
def show_xys(self, xs, ys, imgsize:int=4, figsize:Optional[Tuple[int,int]]=None, **kwargs):
        ""
        axs = subplots(len(xs), 2, imgsize=imgsize, figsize=figsize)
        for i, (x,y) in enumerate(zip(xs,ys)):
            x.show(ax=axs[i,0], **kwargs)
            y.show(ax=axs[i,1], **kwargs)
        plt.tight_layout()
1304283
def plot_lr(self, show_text=True, show_moms=True):
        """"""
        phase_limits = [0]
        for nb_batch, phase in zip(self.nb_batches, self.phases):
            phase_limits.append(phase_limits[-1] + nb_batch * phase.epochs)
        if not in_ipynb():
            plt.switch_backend('agg')
        np_plts = 2 if show_moms else 1
        fig, axs = plt.subplots(1,np_plts,figsize=(6*np_plts,4))
        if not show_moms: axs = [axs]
        for i in range(np_plts): axs[i].set_xlabel('iterations')
        axs[0].set_ylabel('learning rate')
        axs[0].plot(self.iterations,self.lrs)
        if show_moms:
            axs[1].set_ylabel('momentum')
            axs[1].plot(self.iterations,self.momentums)
        if show_text:   
            for i, phase in enumerate(self.phases):
                text = phase.opt_fn.__name__
                if phase.wds is not None: text+='\nwds='+str(phase.wds)
                if phase.beta is not None: text+='\nbeta='+str(phase.beta)
                for k in range(np_plts):
                    if i < len(self.phases)-1:
                        draw_line(axs[k], phase_limits[i+1])
                    draw_text(axs[k], (phase_limits[i]+phase_limits[i+1])/2, text) 
        if not in_ipynb():
            plt.savefig(os.path.join(self.save_path, 'lr_plot.png'))