-
Notifications
You must be signed in to change notification settings - Fork 41
/
load_plot_pkg.jl
32 lines (28 loc) · 943 Bytes
/
load_plot_pkg.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using PlotlyJS
# Set default values for all plots
nlaStyle = let
axis = attr(showgrid=true, gridcolor="#E5E5E5",
linewidth=1.0,
titlefont_color="#555555", titlefont_size=18,
linecolor="black", mirror=true, zeroline=false,
ticks="inside")
layout = Layout(font_size=16, xaxis=axis, yaxis=axis,
titlefont_size=18, width=500, height=300)
colors = Cycler([
"#E24A33", "#348ABD", "#988ED5", "#777777",
"#FBC15E", "#8EBA42", "#FFB5B8"
])
gta = attr(
marker_line_width=0.5, marker_line_color="#348ABD",
marker_color=colors, marker_size=10
)
Style(layout=layout, global_trace=gta)
end
use_style!(nlaStyle)
function plotToPDF(p,fileName)
savefig(p,"$fileName.html")
cmd = `/usr/libexec/cups/filter/xhtmltopdf 0 0 0 0 0 $fileName.html`
run(pipeline(cmd, stdout="$fileName.pdf"))
cmd = `pdfcrop $fileName.pdf`
run(cmd)
end