/articles/toma

To get this branch, use:
bzr branch http://darksoft.org/webbzr/articles/toma

« back to all changes in this revision

Viewing changes to figs/gen/reconbench.py

  • Committer: Suren A. Chilingaryan
  • Date: 2018-06-01 19:04:28 UTC
  • Revision ID: csa@suren.me-20180601190428-unnmuil13xpdlvf1
Revised 8-page version of short paper

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
import sys
4
4
import numpy as np
 
5
import matplotlib as mpl
5
6
import matplotlib.pyplot as plt
6
7
import matplotlib.ticker as ticker
7
8
 
 
9
font=14
 
10
mpl.rcParams.update({'font.size': font})
 
11
 
8
12
ops = 3526656000.
9
13
 
10
14
#colors=['blue', 'green', 'red']
70
74
 
71
75
ax = plt.gca()
72
76
ax.xaxis.grid(alpha=0.25)
73
 
plt.xticks(np.concatenate(([256], np.arange(512,4097,512)), axis=0))
 
77
 
74
78
plt.xlim(256, 4096)
75
79
plt.xlabel("pixels")
76
 
ax.xaxis.set_label_coords(0.99, -0.07)
 
80
 
 
81
if (font is not None) and (font > 12):
 
82
    plt.xticks(np.concatenate(([256], np.arange(512,4097,512)), axis=0), np.concatenate(([256,''], np.arange(512,4097,512)), axis=0))
 
83
    ax.xaxis.set_label_coords(0.99, -0.09)
 
84
    legend_offset=(0.5,-0.14)
 
85
else:
 
86
    plt.xticks(np.concatenate(([256], np.arange(512,4097,512)), axis=0))
 
87
    ax.xaxis.set_label_coords(0.99, -0.07)
 
88
    legend_offset=(0.5,-0.1)
77
89
 
78
90
ax.yaxis.grid(alpha=0.25)
79
91
plt.ylim(0, 10)
91
103
ax2.set_yticks(np.arange(0,10.1,1))
92
104
ax2.set_yticklabels(ticks)
93
105
 
94
 
 
95
 
legend = p.legend(
96
 
    loc='upper center', bbox_to_anchor=(0.5,-0.1), ncol=4)
 
106
legend = p.legend(loc='upper center', bbox_to_anchor=legend_offset, ncol=4)
97
107
 
98
108
#plt.savefig('reconbench.pdf', dpi=300, bbox_inches='tight', bbox_extra_artists=(legend,))
99
109
plt.savefig('reconbench.pdf', dpi=300, bbox_inches='tight')