开发者

Manually specifying tick marks on a logarithmic axis in JFreeChart

开发者 https://www.devze.com 2023-02-16 13:58 出处:网络
Using JFreeChart I have a plot with a LogAxis with tick marks on the domain axis of an XYPlot that are determined automatically based on the width of the graph. My domain values are 0.01, 0.05, 0.1, 0

Using JFreeChart I have a plot with a LogAxis with tick marks on the domain axis of an XYPlot that are determined automatically based on the width of the graph. My domain values are 0.01, 0.05, 0.1, 0.5, 1, 5, and 10; so, the tick marks do not line up with the domain values I have. Is there a way to manually specify an axis'开发者_如何学Pythons tick marks rather than them being automatically calculated? I tried the SimpleAxis class but that seem to only supply linear-type axes, not logarithmic.


try this:

final LogAxis logAxis = new LogAxis(axisX);
logAxis.setStandardTickUnits(LogAxis.createLogTickUnits(Locale.ENGLISH));

logAxis.setRange(0.01, 10.0); plot.setDomainAxis(logAxis);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号