Merge.
author |
Steve Losh <steve@stevelosh.com> |
date |
Tue, 17 Mar 2020 11:28:35 -0700 |
parents |
0fc8cb89809b |
children |
fbcdf7c9370b |
# Basic Settings ---------------------------------------------------------- {{{
set encoding utf8
set terminal qt noraise
set samples 1000
# }}}
# Styles ------------------------------------------------------------------ {{{
set grid
set pointintervalbox 1.25
clr = "call '~/src/dotfiles/gnuplot-scripts/color.gp'"
bwp = "call '~/src/dotfiles/gnuplot-scripts/black-and-white-points.gp'"
bwl = "call '~/src/dotfiles/gnuplot-scripts/black-and-white-lines.gp'"
@clr
# }}}
# Constants --------------------------------------------------------------- {{{
tau = 2 * pi
e = 2.71828182845905
r2 = sqrt(2.0)
# }}}
# Utility Functions ------------------------------------------------------- {{{
min(a, b) = (a<b) ? a : b
max(a, b) = (a>b) ? a : b
# }}}
# Exporting --------------------------------------------------------------- {{{
export(file, terminal) = sprintf( \
"set terminal push;" . \
"set terminal %s;" . \
"set output '%s';" . \
"replot;" . \
"set output;" . \
"set terminal pop;" . \
"print system('realpath %s | nnl | pbcopy');" \
, terminal, file, file)
export_pdf(file) = export(file . '.pdf', "pdfcairo")
export_png(file) = export(file . '.png', "pngcairo")
pdf = "eval export_pdf('graph')"
png = "eval export_png('graph')"
# }}}
# Other ------------------------------------------------------------------- {{{
kdens(file, column, bandwidth) = sprintf( \
"stats '%s' using %d;" . \
"plot '%s' using %d:(1.0/STATS_records) smooth kdensity bandwidth %f;" \
, file, column, file, column, bandwidth)
cdf(file, column) = sprintf( \
"plot '%s' using %d:(1.0) smooth cnormal;" \
, file, column)
# }}}