Unregistered
07-18-2006, 12:15 PM
I'm trying to print a 3-D graph using JMSL 4.0.
When I select File, Print from the drop-down menu. I get a gray box on the paper that prints. Please let me know if I can fix this somehow?
Here is my code:
public class SimpleSurface extends JFrameChart3D
{
double[] x;
double[] y;
double[][] z;
int length;
public void graphing()
{
Font font = new Font("Serif", Font.PLAIN, 16);
Chart3D chart = getChart3D();
chart.getBackground().setFillColor("lightyellow");
chart.setFont(font);
chart.setTitle("Title");
chart.setLineColor(Color.cyan);
chart.setMarkerColor(Color.MAGENTA);
AxisXYZ axis = new AxisXYZ(chart);
axis.setFont(font);
axis.setTitle("Total Objective Value vs Epochs");
axis.setAxisTitlePosition(axis.AXIS_TITLE_PARALLEL );
axis.getAxisX().getAxisTitle().setTitle("P ID");
axis.getAxisY().getAxisTitle().setTitle("E ID");
axis.getAxisZ().getAxisTitle().setTitle("Total Objective Value");
axis.getAxisX().getAxisLine().setLineColor(Color.b lue);
axis.getAxisY().getAxisLine().setLineColor(Color.r ed);
axis.getAxisZ().getAxisLine().setLineColor(Color.b lue);
Surface surface = new Surface(axis, x, y, z);
surface.setTextColor("red");
surface.setLineColor("green");
surface.setTitle("Results");
surface.setFillColor("blue");
surface.setLightColor("white");
surface.setLineWidth(1);
surface.setSurfaceType(Surface.SURFACE_TYPE_NICEST | Surface.SURFACE_TYPE_MESH);
setSize(800, 800);
render();
}
}
When I select File, Print from the drop-down menu. I get a gray box on the paper that prints. Please let me know if I can fix this somehow?
Here is my code:
public class SimpleSurface extends JFrameChart3D
{
double[] x;
double[] y;
double[][] z;
int length;
public void graphing()
{
Font font = new Font("Serif", Font.PLAIN, 16);
Chart3D chart = getChart3D();
chart.getBackground().setFillColor("lightyellow");
chart.setFont(font);
chart.setTitle("Title");
chart.setLineColor(Color.cyan);
chart.setMarkerColor(Color.MAGENTA);
AxisXYZ axis = new AxisXYZ(chart);
axis.setFont(font);
axis.setTitle("Total Objective Value vs Epochs");
axis.setAxisTitlePosition(axis.AXIS_TITLE_PARALLEL );
axis.getAxisX().getAxisTitle().setTitle("P ID");
axis.getAxisY().getAxisTitle().setTitle("E ID");
axis.getAxisZ().getAxisTitle().setTitle("Total Objective Value");
axis.getAxisX().getAxisLine().setLineColor(Color.b lue);
axis.getAxisY().getAxisLine().setLineColor(Color.r ed);
axis.getAxisZ().getAxisLine().setLineColor(Color.b lue);
Surface surface = new Surface(axis, x, y, z);
surface.setTextColor("red");
surface.setLineColor("green");
surface.setTitle("Results");
surface.setFillColor("blue");
surface.setLightColor("white");
surface.setLineWidth(1);
surface.setSurfaceType(Surface.SURFACE_TYPE_NICEST | Surface.SURFACE_TYPE_MESH);
setSize(800, 800);
render();
}
}