Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCChart3D for Java
 Z Axis labeling problem

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List

* Forum Code is ON
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]


T O P I C    R E V I E W
Peter Posted - 18 Jun 2009 : 12:27:48
I'm a noob with this plotting package so I could be missing something really obvious here...

I have 10 SimpleDatasets I'm plotting using SimpleBarPlots. I can't seem to get more than 5 (out of the 10 defined) z-axis labels to appear--the 5 that show up ("A" though "E" in the example below) are evenly spaced across the entire z-axis. The grid for the XZ_MINY_PLANE also only has 5 major tick lines for the z-axis (which coorespond to the 5 labels that are showing up).

Code relevant to z-axis configuration (mutated from some of the examples):

// Define the z-axis
LinearAxis zAxis = new LinearAxis( pTransform1, ChartConstants.Z_AXIS, 0, 1 );
zAxis.setColor( ChartColors.BLACK );
zAxis.setAxisIntercept( xAxis.getAxisMax() );
zAxis.setAxisIntercept2( 0.0 );
gWG.addChartObject( zAxis );

// Define the z-axis string labels
String[] zlabels = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" };
StringAxisLabels zAxisLab = new StringAxisLabels( zAxis );
zAxisLab.setColor( ChartColors.BLACK );
zAxisLab.setAxisLabels( theFont, 0, ChartConstants.AXIS_MIN, ChartConstants.LABEL_ALL, ChartColors.BLACK, zlabels, zlabels.length );
zAxisLab.setOverlapLabelMode( ChartConstants.OVERLAP_LABEL_DRAW );
gWG.addChartObject( zAxisLab );

// Define the z-axis grid for the XZ_MINY_PLANE
Grid zgrid2 = new Grid( xAxis, zAxis, ChartConstants.Z_AXIS, ChartConstants.GRID_MAJOR );
zgrid2.setColor( ChartColors.WHITE );
zgrid2.setLineStyle( ChartConstants.LS_SOLID );
zgrid2.setLineWidth( 1 );
zgrid2.setGridAxisPlane( ChartConstants.XZ_MINY_PLANE );
gWG.addChartObject( zgrid2 );

// Define the z-axis grid for the XZ_MINY_PLANE
Grid bottomxgrid = new Grid( xAxis, zAxis, ChartConstants.X_AXIS, ChartConstants.GRID_MAJOR );
bottomxgrid.setColor( ChartColors.WHITE );
bottomxgrid.setLineStyle( ChartConstants.LS_SOLID );
bottomxgrid.setLineWidth( 1 );
bottomxgrid.setGridAxisPlane( ChartConstants.XZ_MINY_PLANE );
gWG.addChartObject( bottomxgrid );

6   L A T E S T    R E P L I E S    (Newest First)
Peter Posted - 18 Jun 2009 : 14:18:17
No problem. I couldn't find anything obvious where the scaling in the z-axis was wrong.

No matter, under the current time pressure for this project, I simply rescaled z back to 0-1 and everything is behaving.

The plot/animation looks great! Thanks for your very timely assistance.
quinncurtis Posted - 18 Jun 2009 : 14:01:27
As we said in the previous post, if you had it setup correctly for a z-scale of 0-1, you should leave it at that, just correctly specify the tick mark spacing and setAxisMinorTicksPerMajor.

In order to troubleshoot your 0-10 z-axis scale, we would probably need to see the complete program, because one of your other values somewhere does not take into account the 0-10 range.
Peter Posted - 18 Jun 2009 : 13:49:50
Hmmmm after rescaling the z-axis from 0-1 to 0-10 as in my post above, the grids on the XY_MAXZ_PLANE are still being drawn at z=1.0. The back wall is being drawn in the correct spot so I assume the XY_MAXZ_PLANE is set correctly.

// transform
CartesianCoordinates pTransform1 = new CartesianCoordinates( 1930., 0., 0., 2040., 5000., 10. );

// Define the walls
ChartAttribute wallAttrib = new ChartAttribute( ChartColors.BEIGE, 1, ChartConstants.LS_SOLID, ChartColors.LIGHTBLUE );
Wall3D xyMaxZWall = new Wall3D( pTransform1, ChartConstants.XY_MAXZ_PLANE, 0.02, wallAttrib );
gWG.addChartObject( xyMaxZWall );

// Define the x-axis grid for the XY_MAXZ_PLANE
Grid xgrid = new Grid( xAxis, yAxis, ChartConstants.X_AXIS, ChartConstants.GRID_MAJOR );
xgrid.setColor( ChartColors.WHITE );
xgrid.setLineWidth( 1 );
xgrid.setLineStyle( ChartConstants.LS_SOLID );
xgrid.setGridAxisPlane( ChartConstants.XY_MAXZ_PLANE );
xgrid.setChartObjScale( pTransform1 );
gWG.addChartObject( xgrid );

// Define the y-axis grid for the XY_MAXZ_PLANE
Grid ygrid = new Grid( xAxis, yAxis, ChartConstants.Y_AXIS, ChartConstants.GRID_MAJOR );
ygrid.setColor( ChartColors.WHITE );
ygrid.setLineStyle( ChartConstants.LS_SOLID );
ygrid.setLineWidth( 1 );
ygrid.setGridAxisPlane( ChartConstants.XY_MAXZ_PLANE );
ygrid.setChartObjScale( pTransform1 );
gWG.addChartObject( ygrid );
quinncurtis Posted - 18 Jun 2009 : 13:14:04
There was no need to rescale your z-axis, if you had it scaled for (0-1 in your example) some particular reason. Just choose a tick mark spacing that places at least 10 tick marks on the z-axis. Then specify that every tick mark should be a major tick mark.
For a (0-1) range:

Peter Posted - 18 Jun 2009 : 13:01:17
I put in your code snippet, rescaled my z-axis from 0-1 to 0-10 and set the max-z argument for the Cartesian Coordinates constructor, it worked.


quinncurtis Posted - 18 Jun 2009 : 12:42:46
Unless otherwise specified, the software will choose default values for the number and spacing of tick marks. If you use custom string axis label, you need to override those values in order to place the strings correctly.

Assuming your z-axis range is (0-10), then you want a minor tick mark spacing of 1.0, and a major tick mark at every minor tick interval.

LinearAxis zAxis = new LinearAxis( pTransform1, ChartConstants.Z_AXIS, 0, 1 );
zAxis.setColor( ChartColors.BLACK );
zAxis.setAxisIntercept( xAxis.getAxisMax() );
zAxis.setAxisIntercept2( 0.0 );

zAxis.setAxisMinorTicksPerMajor( 1);

gWG.addChartObject( zAxis );

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07