0
votes

I'm using (Clojure's) Incanter's heat-map to show the pivot value of (x, y), where x, and y represents some products and applications respectively. In terms heat-map use xyplot to do the work. I use Symbolaxis to show the products and applications, on the x-axis, and y-axis respectively.

With the default setting (auto range of the value axis is set to true), the labels on the value axis are not complete, depends on the size of the Java window, some lebels are shown, while some others are omitted. It seems the rule is that show one, then hid a fixed number of labels, then show another, repeating,.... Maybe, it's to save the relestate to avoid the label text collide with each other.

But I'd want to show all the labels, I would like to enlarge the heat-map size in order to show them all.

Could you please teach me how to: 1) Force to show all the labels of Symbolaxis, or 2) Enlarge the heat-map size to accomodte all tick labels. 3) Reduce the size of the tick laebl's font size also to save more space for more labels.

It seems to me that JFreechart does not have detailed documentation for such nuance. I was not able to locate the spot of source code to figure out yet.

Here is an sample of my heat-map: heat-map that I wish to have all tick labels on the value axis

In the diagram attcahed, only a quarter of the labels are shown. With partial labels, the heat-map does make much sense.

Note: I tried to setAutoRange to false, but it's worse, only the first row starting from the bottom is shown.

Thanks a lot for your help!

1

1 Answers

1
votes

1) To force all the labels to display, you would need to modify the refreshTicksHorizontal() and refreshTicksVertical() methods in the SymbolAxis class (note that you can click through to the source code via the Javadocs, just click on the method name). Inside those methods, search for the comment // don't draw this tick label and you'll see the code that needs changing.

2) JFreeChart always adapts the chart drawing to fit the size specified externally (either by the ChartPanel which gets its size from a Swing layout manager, or by some caller asking JFreeChart to generate an image, SVG, PDF etc at a specific size).

3) SymbolAxis inherits the setTickLabelFont() method from the Axis base class, so you can use this to make the labels use a smaller font.