FIX: Make Python scripts more robust (Closes FFBUG0000006)
[freefoam.git] / doc / UserGuide / tutorials / assets / plateHole / sigmaxx.asy
blobe2c81d822eec1e4762410aa56b74d7eaa17047f8
1 // process with:
2 //   asy -f <fmt> -tex <pdflatex|xelatex> sigmaxx
3 // DO NOT SPECIFY AN OUTPUT NAME (this confuses asy...)
4 import graph;
6 usepackage("units");
8 settings.render = -2;
10 // fiddling-parameter
11 real s = 0.8;
12 size(s*15cm);
14 // draw invisible box around image in order to provide a frame-of-reference
15 draw(box((0,0),(15,12.2)), invisible);
17 // place the plot and the color bar
18 label(graphic("field.png", format("height=%fcm", 12*s)),(6.1,6.1));
19 label(graphic("bar.png", format("height=%fcm", 11*s)),(14.5,6.1));
21 // add a label to the color bar
22 draw(rotate(90)*Label("$\sigma_{xx}\,\left[\unit{kPa}\right]$"), (12.8,6.1));
24 // fiddling parameters for the colorbar tick labels
25 real yf = 1/2.94;
26 real yo = 2.4;
27 real yscale(real v){return (v+yo)*yf;}
28 // create the tick labels for the colorbar
29 for(int i=0; i<=30; i+=5) {
30   label(format("$%d$",i), (14, yscale(i)), W);