Opened 10 years ago

Closed 10 years ago

#464 closed defect (fixed)

Add option for using histogram x values in plots instead of starting at zero

Reported by: Kevin Milner Owned by:
Priority: major Milestone: OpenSHA 1.4
Component: commons Version:
Keywords: Cc:

Description

JFreeChart uses 0 as the basis for all ticks. This can look weird for histograms where the first bin is at, for example, 1. There should be an option to center tick labels at histogram bin centers.

Change History (2)

comment:1 Changed 10 years ago by Kevin Milner

Added new CustomOffsetNumberAxis? instance of NumberAxis? in [10704], and new setGriddedFuncAxesTicks(boolean) method to GraphPanel?, GraphWidget?, and GraphWindow?. If enabled, tick's will be aligned with the first instance of EvenlyDiscretizedFunc? encountered in the plot.

In short, just call setGriddedFuncAxesTicks(true) and it will take care of things for you.

Leaving ticket open until I figure out issue with tick unit size for fractional function deltas.

comment:2 Changed 10 years ago by Kevin Milner

Resolution: fixed
Status: newclosed

I fixed the issue with tick unit size estimation for fractional deltas in [10705]. closing ticket. I had to override the NumberAxis?.estimateMaximumTickLabelWidth method which was previously using the plot range and not actual tick locations in its estimation.

Note: See TracTickets for help on using tickets.