javaswingchartsjzy3d

How to Customize jzy3d Chart


I'm using org.jzy3d package (v 0.9) to create Surface plots. Here's my code:

int stepsX = 6;
Range rX = new Range(1,6);
int stepsY = 7;
Range rY = new Range(0,6);

Mapper mapper = new Mapper(){
    @Override
    public double f(double x, double y) {
        return //My function to get z;
    }
};

org.jzy3d.plot3d.primitives.Shape surface = Builder.buildOrthonormal(new OrthonormalGrid(rX, stepsX, rY, stepsY), mapper);
surface.setColorMapper(new ColorMapper(new ColorMapRainbow(), surface.getBounds().getZmin(), surface.getBounds().getZmax(), new org.jzy3d.colors.Color(1, 1, 1, .5f)));
surface.setFaceDisplayed(true);
surface.setWireframeDisplayed(false);

org.jzy3d.chart.Chart chart = new org.jzy3d.chart.Chart(Quality.Advanced,"swing");
chart.getScene().getGraph().add(surface);

IAxeLayout l = chart.getAxeLayout();
l.setXAxeLabel("Observation");
l.setYAxeLabel("Week");
l.setZAxeLabel("Rate");
l.setMainColor(org.jzy3d.colors.Color.GRAY);

JPanel p = new JPanel(new BorderLayout()); //another panel will be added to this panel and aligned left (BorderLayout.WEST)
p.add((JPanel)chart.getCanvas(),BorderLayout.CENTER);

... and this is what I get:

enter image description here

I'd like to customize this chart further, but I really cannot figure out how.

In particular I'd like to:


Solution

  • I solved by myself 2 of the 3 above mentioned points. Here are the solution just in case someone is interested: