source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/missing-data/label_graph.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 963 bytes
Line 
1function o = label_graph(ifile, xlabs, xminval, xmaxval, ylabs, yminval, ymaxval)
2% Draw Axis for graph, on left and bottom of bounding rect.
3% Add hash marks for labels.
4% Also, write stuff to close file.
5
6o = 1;
7irec_lx = 50;
8irec_ly = 50;
9irec_ux = 500;
10irec_uy = 500;
11lab_length = 20;
12% We write to an image rectangle with l giving lower corner, u upper.
13% This must be same values as in graph_idraw.
14
15fid = fopen(ifile, 'a');
16line_idraw(fid, irec_lx, irec_ly, irec_lx, irec_uy);
17line_idraw(fid, irec_lx, irec_ly, irec_ux, irec_ly);
18
19x_len = irec_ux - irec_lx;
20xvals = irec_lx + round(x_len*(xlabs - xminval)./(xmaxval-xminval));
21
22y_len = irec_uy - irec_ly;
23yvals = irec_ly + round(y_len*(ylabs - yminval)./(ymaxval-yminval));
24
25for x = xvals
26  line_idraw(fid, x, irec_ly, x, irec_ly - lab_length);
27end
28
29for y = yvals
30  line_idraw(fid, irec_lx - lab_length, y, irec_lx, y);
31end
32
33fprintf(fid, '\n\nEnd %%I eop\n\nshowpage\n\n%%%%Trailer\n\nend');
34fclose(fid);
35
Note: See TracBrowser for help on using the repository browser.