In a TimeSeries plot, using LogAxis, I am unable to get the minor tick marks to display correctly (Like LogarithmicAxis does, and I want only the major tick labels). In vers 1.0.12 I could not get them to display at all, and now in vers 1.0.13 only a single minor tick mark between a decade (see http://sol.spacenvironment.net:/~spacew ... t_3sec.png ).
I'm sure I'm doing something wrong, but after several hours I'm stumped as to what.
DateAxis domainXrt = new DateAxis( axslbl );
LogAxis rangeXrt = new LogAxis( "X-ray Flux" );
rangeXrt.setRange( 1.0E-9, 1.0E-3 );
rangeXrt.setNumberFormatOverride( new LogFormat( 10.0, " ", "E", true ) );
rangeXrt.setMinorTickCount( 9 );
XYItemRenderer rendererXrt = new XYLineAndShapeRenderer( true, false );
rendererXrt.setBaseSeriesVisibleInLegend( false );
rendererXrt.setSeriesPaint( 0, Color.red );
rendererXrt.setSeriesStroke( 0, new BasicStroke( 0.75f ) );
XYPlot plotXrt = new XYPlot( datasetXrt, domainXrt, rangeXrt, rendererXrt );
plotXrt.setDomainAxis( domainXrt );
plotXrt.setRangeAxis( rangeXrt );
JFreeChart jchart = new JFreeChart( topTitle, font, plotXrt, true );
LogAxis minor tick marks not showing
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: LogAxis minor tick marks not showing
Have you tried to call setMinorTickMarksVisible(true) on the LogAxis?
In 1.0.11, minor tick support was added for all ValueAxis subclasses, and maybe the default value of this flag was changed.
In 1.0.11, minor tick support was added for all ValueAxis subclasses, and maybe the default value of this flag was changed.
Re: LogAxis minor tick marks not showing
Bingo. It creates the tic marks on the side of the axis (would be nicer if they extended across the plot, but this helps). Thanks!
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: LogAxis minor tick marks not showing
Call setRangeMinorGridlinesVisible(true) on the XYPlotdaveb48 wrote: It creates the tic marks on the side of the axis (would be nicer if they extended across the plot, but this helps)

You can change the appearance of the minor gridlines by setRangeMinorGridlinesPaint(Paint) and setRangeMinorGridlinesStroke(Stroke). The same is possible for the domain axis.
Re: LogAxis minor tick marks not showing
Thanks for the suggestion, however, neither setRangeMinorGridlinesVisible(true) or setRangeMinorGridlinesPaint(true) worked. I did a get*() on both attributes, and they seem correct. I tried setWeight(int) and a few other methods as well, without effect. Could it be that LogAxis is "immune" to the some of the XYPlot attributes?
Re: LogAxis minor tick marks not showing
I have found something that did work: (LogAxis, see Axis API) setMinorTickMarkInsideLength( float );
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: LogAxis minor tick marks not showing
No. The XYPlot uses the ticks returned from the axisState to draw the grid lines (major and minor based on the tick type).daveb48 wrote:Could it be that LogAxis is "immune" to the some of the XYPlot attributes?
At least the 1.0.12 version of the LogAxis should workl correctly, because this is what I am using regularly.