Skip to content
Snippets Groups Projects
Commit b1f0ee3d authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

three new definitions in wups suffice to enable 2D plots

parent 4c165d61
No related branches found
No related tags found
No related merge requests found
......@@ -151,7 +151,7 @@ void NSpecial::export_p2d(bool allow_overwrite)
const CSpec* s = f->VS(j);
vector<double> xlim = triv::histogram_limits(s->x);
for (size_t i=0; i<s->size(); ++i)
ofs << ( format("%13.7g wx %13.7g wx %13.7g wy %13.7g wy %13.7g wh p2d\n")
ofs << ( format("%13.7g wx %13.7g wx %13.7g wy %13.7g wy %13.7g wh t2d\n")
% xlim[i] % xlim[i+1] % zlim[j] % zlim[j+1] % s->y[i] );
ofs << "\n";
}
......
......@@ -171,6 +171,20 @@ WuGdict11a begin
wyd
} bind def
} def
/hSetCoord { % log min max | -
/whmax x def
/whmin x def
/whlog x 0 eq not def
% prepare conversion world coord -> frame coord
/whdel whmax whmin whlog { div log } { sub } ifelse def
/whd { % dx(world) | dx(frame)
whlog { log } if whdel div 10 mul
} bind def
/wh { % x(world) | x(frame)
whmin whlog { div } { sub } ifelse
whd
} bind def
} def
% pair conversion
/wxy { % x,y(world) -> x,y(frame)
......@@ -1244,6 +1258,16 @@ WuGdict11a begin
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 2D plots %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/t2d {
icCol
{ fill } execRectangle3
black
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% List %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......@@ -1413,7 +1437,21 @@ WuGdict11a begin
grestore
grestore
} def
/execRectangle2 { % xl xh yl yh {proc} | -
/execRectangle3 { % xl xh yl yh {proc} | -
5 1 roll
gsave
ym /qqyh x def
ym /qqyl x def
xm /qqxh x def
xm /qqxl x def
np
qqxl qqyl mv
qqxh qqyl li
qqxh qqyh li
qqxl qqyh li
cp exec grestore
} def
/execRectangle2 { % xl xh yl yh {proc} | - OBSOLETE, BOGUS (duplicate xm|ym operations)
5 1 roll
gsave
ym /qqyh x def
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment