Skip to content

Commit

Permalink
Improved plot settings
Browse files Browse the repository at this point in the history
  • Loading branch information
cgpotts committed Oct 6, 2015
1 parent 067e296 commit 308964d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion embeddedscalars/embimp.mplstyle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ xtick.major.size: 0

ytick.color: black
ytick.direction: out
ytick.major.pad: 4
ytick.major.pad: 3
ytick.major.size: 0

grid.color: EEEEEE
Expand Down
16 changes: 9 additions & 7 deletions embeddedscalars/paper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from analysis import Analysis
from utils import *

IMAGE_FILE_TYPE = '.pdf'

######################################################################
# Figure 2

Expand Down Expand Up @@ -227,14 +229,14 @@ def embedded_disjunction_example(refinable={}):
def experiment_plot_and_report_binary():
experiment_plot_and_report(
src_filename=BINARY_EXPERIMENT_SRC_FILENAME,
output_filename=BINARY_EXPERIMENT_SRC_FILENAME.replace('.csv', '.pdf'),
output_filename=BINARY_EXPERIMENT_SRC_FILENAME.replace('.csv', IMAGE_FILE_TYPE),
response_transformation=(lambda x : 1.0 if x=='T' else 0.0),
plot_keywordargs={'xlim':[0.0,1.0], 'xlabel':'Percentage True responses', 'xticks':np.arange(0.2, 1.2, .2)})

def experiment_plot_and_report_likert():
experiment_plot_and_report(
src_filename=LIKERT_EXPERIMENT_SRC_FILENAME,
output_filename=LIKERT_EXPERIMENT_SRC_FILENAME.replace('.csv', '.pdf'),
output_filename=LIKERT_EXPERIMENT_SRC_FILENAME.replace('.csv', IMAGE_FILE_TYPE),
response_transformation=(lambda x : int(x)),
plot_keywordargs={'xlabel':'Mean Likert response'})

Expand Down Expand Up @@ -264,23 +266,23 @@ def experiment_plot_and_report(
def experimental_assessment_binary():
experimental_assessment(
experiment_src=BINARY_EXPERIMENT_SRC_FILENAME,
plot_output_filename="allmodels-binary.pdf",
plot_output_filename="allmodels-binary%s" % IMAGE_FILE_TYPE,
response_transformation=(lambda x : 1.0 if x=='T' else 0.0),
rescaler=0.0)

# Table 8 (but does much more if run):
def experimental_assessment_likert():
experimental_assessment(
experiment_src=LIKERT_EXPERIMENT_SRC_FILENAME,
plot_output_filename="allmodels-likert.pdf",
plot_output_filename="allmodels-likert%s" % IMAGE_FILE_TYPE,
response_transformation=(lambda x : int(x)),
rescaler=1.0)

# Figure 6
def experimental_assessment_binary_critical_optimal_params():
experimental_assessment(
experiment_src=BINARY_EXPERIMENT_SRC_FILENAME,
plot_output_filename='allmodels-paramexplore-binary.pdf',
plot_output_filename='allmodels-paramexplore-binary%s' % IMAGE_FILE_TYPE,
response_transformation=(lambda x : 1.0 if x=='T' else 0.0),
rescaler=0.0,
uctemp=0.1,
Expand Down Expand Up @@ -492,7 +494,7 @@ def process_listener_by_param(lisdict):
if __name__ == '__main__':

## Figure 2
# simple_scalar_inference_example()
simple_scalar_inference_example()

## Table 2, with and without refinement:
# scalar_disjunction_example(refinable={'some_shot': ['only_some_shot'], 'OR':['XOR'] })
Expand All @@ -519,7 +521,7 @@ def process_listener_by_param(lisdict):
# experimental_assessment_binary()

## Table 8
experimental_assessment_likert()
# experimental_assessment_likert()

## Figure 6
# experimental_assessment_binary_critical_optimal_params()
2 changes: 0 additions & 2 deletions embeddedscalars/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
matplotlib.rc('text', usetex=True)
matplotlib.rc('font', family='serif', serif='times')
matplotlib.rcParams['text.latex.preamble'] = [r"\usepackage{amsmath}", r'\boldmath']
matplotlib.rcParams['xtick.major.pad']='1'
matplotlib.rcParams['ytick.major.pad']='0'

# Colors that should be good for colorblind readers.
colors = [
Expand Down

0 comments on commit 308964d

Please sign in to comment.