1
1
//---------------------------------------------------------------------------//
2
// $Id: x07.java,v 1.7 2004/01/17 16:41:39 rlaboiss Exp $
2
// $Id: x07.java,v 1.16 2005/12/10 20:14:45 airwin Exp $
3
3
//---------------------------------------------------------------------------//
5
5
//---------------------------------------------------------------------------//
6
6
// Copyright (C) 2001 Geoffrey Furnish
7
7
// Copyright (C) 2001, 2002 Alan W. Irwin
8
// Copyright (C) 2001 Andrew Ross
9
10
// This file is part of PLplot.
20
21
// You should have received a copy of the GNU Library General Public License
21
22
// along with PLplot; if not, write to the Free Software
22
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
24
//---------------------------------------------------------------------------//
25
26
//---------------------------------------------------------------------------//
48
49
public x07( String[] args )
50
PLStreamc plsdummy = new PLStreamc();
51
plplotjavac pls = new plplotjavac();
51
PLStream pls = new PLStream();
53
53
// NumberFormat nf = NumberFormat.getNumberInstance();
54
54
// Change to this custom format to get stupid locale commas
55
55
// separating hundreds and thousands place out of labels.
56
DecimalFormat nf = new DecimalFormat("#####");
56
DecimalFormat nf = new DecimalFormat("####0");
59
59
double x[] = new double[1];
62
62
// Parse and process command line arguments.
64
pls.plParseOpts( args, pls.PL_PARSE_FULL | pls.PL_PARSE_NOPROGRAM );
64
pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM );
66
66
// Initialize plplot.
71
71
for( l = 0; l < base.length; l++ ) {
74
74
// Set up viewport and window.
77
pls.plvpor(0.15, 0.95, 0.1, 0.9);
78
pls.plwind(0.0, 1.0, 0.0, 1.0);
77
pls.vpor(0.15, 0.95, 0.1, 0.9);
78
pls.wind(0.0, 1.0, 0.0, 1.0);
80
80
// Draw the grid using plbox.
82
pls.plbox("bcgt", 0.1, 0, "bcgt", 0.1, 0);
82
pls.box("bcg", 0.1, 0, "bcg", 0.1, 0);
84
84
// Write the digits below the frame.
87
87
for (i = 0; i <= 9; i++) {
88
88
String text = nf.format(i);
89
pls.plmtex("b", 1.5, (0.1 * i + 0.05), 0.5, text);
89
pls.mtex("b", 1.5, (0.1 * i + 0.05), 0.5, text);
95
95
// Write the digits to the left of the frame.
97
97
String text = nf.format( base[l] + 10*i );
98
pls.plmtex("lv", 1.0, (0.95 - 0.1 * i), 1.0, text);
98
pls.mtex("lv", 1.0, (0.95 - 0.1 * i), 1.0, text);
99
99
for( j = 0; j <= 9; j++ ) {
100
100
x[0] = 0.1 * j + 0.05;
101
101
y[0] = 0.95 - 0.1 * i;
103
103
// Display the symbols.
104
104
// N.B. plsym expects arrays so that is what we give it.
106
pls.plsym( x, y, base[l] + k );
106
pls.sym( x, y, base[l] + k );
111
pls.plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols");
111
pls.mtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols");