コード例 #1
0
ファイル: bar_plot.py プロジェクト: breedlun/clearplot
# -*- coding: utf-8 -*-
"""
Created on Mon May 30 20:50:04 2016

@author: Ben
"""

import clearplot.plot_functions as pf
import numpy as np

#Verification that bar plots work propery
xa = np.arange(1,5,1)
ya = np.arange(4,8,1)
ya_err = ya / 10.0
xb = np.arange(1,4,1)
yb = np.array([4, 3, 5.5])
yb_err = np.array([yb / 20.0, yb / 10.0])
[fig, ax, bars] = pf.plot_bars('', [xa, xb], [ya, yb], \
	['\alpha', '\beta'], ['\mathsf{Categories}'], ['d-D']);
ax.plot_error_bars([xa, xb], [ya, yb], y_err = [ya_err, yb_err])
fig.save('bar_plot')
コード例 #2
0
ファイル: bar_plot.py プロジェクト: breedlun/clearplot
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 18 15:25:41 2015

@author: Ben
"""
import clearplot.plot_functions as pf
import numpy as np

xa = np.array([1, 2.5, 4, 6])
ya = np.arange(4,8,1)
ya_err = ya / 10.0
xb = np.array([1, 3, 5.5, 7])
yb = np.array([2, 4, 3, 5.5])
yb_err = np.array([yb / 20.0, yb / 10.0])

[fig, ax, bars] = pf.plot_bars('', [xa, xb], [ya, yb], \
    labels = ['\alpha', '\beta'], x_label = ['N'], y_label = ['d-D'], \
    widths = 0.75)
ax.plot_error_bars([xa, xb], [ya, yb], y_err = [ya_err, yb_err])
fig.save('bar_plot.png')