def _hline(y, xmin=0, xmax=1, linecolor=None, linestyle=None, linewidth=None, overplot=False, clearwindow=True): if (not overplot) and clearwindow: _clear_window() chips.add_hline(y) for var in ('linecolor', 'linestyle', 'linewidth'): val = locals()[var] if val is not None: if 'color' in var: val = _check_hex_color(val) elif 'style' in var: val = _linestyle_map[val] getattr(chips.advanced, 'set_line_' + _attr_map[var])(val)
def _plot(x, y, yerr=None, xerr=None, title=None, xlabel=None, ylabel=None, overplot=False, clearwindow=True, xerrorbars=False, yerrorbars=False, errstyle=None, errcolor=None, errthickness=None, xlog=False, ylog=False, linestyle=chips.chips_solid, linecolor=None, symbolstyle=chips.chips_none, symbolcolor=None, symbolsize=None, symbolfill=True, linethickness=None, xaxis=False, ratioline=False): if (not overplot) and clearwindow: _clear_window() if yerrorbars and (yerr is not None) and xerrorbars and (xerr is not None): xerr = xerr / 2. chips.add_curve(x, y, (yerr, yerr, xerr, xerr) ) elif yerrorbars and (yerr is not None): chips.add_curve(x, y, yerr) else: chips.add_curve(x, y) for var in ('errstyle', 'errcolor', 'errthickness', 'linestyle', 'linecolor', 'symbolstyle', 'symbolcolor', 'symbolsize', 'symbolfill', 'linethickness'): val = locals()[var] if val is not None: if 'color' in var: val = _check_hex_color(val) getattr(chips.advanced, 'set_curve_' + var)(val) if not overplot: for log_axis, axis_id in izip((xlog, ylog), (chips.X_AXIS, chips.Y_AXIS)): if log_axis: chips.log_scale(axis_id) else: chips.linear_scale(axis_id) if title: ttl = title.replace('_', '\\_') chips.set_plot_title(ttl) if xlabel: xlbl = xlabel.replace('_', '\\_') chips.set_plot_xlabel(xlbl) if ylabel: ylbl = ylabel.replace('_', '\\_') chips.set_plot_ylabel(ylbl) if xaxis: chips.add_hline(0); if ratioline: chips.add_hline(1);
def _plot(x, y, yerr=None, xerr=None, title=None, xlabel=None, ylabel=None, overplot=False, clearwindow=True, xerrorbars=False, yerrorbars=False, errstyle=None, errcolor=None, errthickness=None, xlog=False, ylog=False, linestyle=chips.chips_solid, linecolor=None, symbolstyle=chips.chips_none, symbolcolor=None, symbolsize=None, symbolfill=True, linethickness=None, xaxis=False, ratioline=False): if (not overplot) and clearwindow: _clear_window() if yerrorbars and (yerr is not None) and xerrorbars and (xerr is not None): xerr = xerr / 2. chips.add_curve(x, y, (yerr, yerr, xerr, xerr)) elif yerrorbars and (yerr is not None): chips.add_curve(x, y, yerr) else: chips.add_curve(x, y) for var in ('errstyle', 'errcolor', 'errthickness', 'linestyle', 'linecolor', 'symbolstyle', 'symbolcolor', 'symbolsize', 'symbolfill', 'linethickness'): val = locals()[var] if val is not None: if 'color' in var: val = _check_hex_color(val) getattr(chips.advanced, 'set_curve_' + var)(val) if not overplot: for log_axis, axis_id in izip((xlog, ylog), (chips.X_AXIS, chips.Y_AXIS)): if log_axis: chips.log_scale(axis_id) else: chips.linear_scale(axis_id) if title: ttl = title.replace('_', '\\_') chips.set_plot_title(ttl) if xlabel: xlbl = xlabel.replace('_', '\\_') chips.set_plot_xlabel(xlbl) if ylabel: ylbl = ylabel.replace('_', '\\_') chips.set_plot_ylabel(ylbl) if xaxis: chips.add_hline(0) if ratioline: chips.add_hline(1)