Hi,
I have posted a few times about displaying 2D histogram data using shapes scaled by the Z values, but the discussion never really went anywhere. Two dimensional histogram data can be displayed as a color chart, but the big problem there is that only one dataset is displayble at a time. Multiple plots would not work with this scheme as they would obscure each other.
So I found this very interesting class in JFreeChart for rendering of XYZ data:
http://www.jfree.org/jfreechart/api/jav ... derer.html
This looks like a good start for this, as multiple XYZ datasets could be display simultaneously using this class.
But now I'm wondering if there is any mechanism for generically drawing shapes at XY positions that are scaled to the Z data.
In other words, it would be nice if this was like XYLineAndShapeRenderer where one could set the shape, as I would like to use rectangles for the display of the data instead of ellipses (for instance).
I am going to start by using this renderer to see if I can get it working how I want and then I may move on to writing my own custom renderer based upon it that draws rectangles instead of ellipses.
Thanks for any suggestions on this.
--Jeremy
XYBubbleRenderer with other shapes
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: XYBubbleRenderer with other shapes
There is a very generalized approach described here, but that is probaly an overkill.
Instead of getting an existing renderer to work as desired, I would suggest to simply write a new one.
This nex renderer could be based on an XYBlockRenderer or an XYBubbleRenderer.
Regarding the XYBubbleRenderer: IMHO, its major drawback is that the the z values need to be in the same order of magnitaude than either the range of the range or the domain axis.
Instead of getting an existing renderer to work as desired, I would suggest to simply write a new one.
This nex renderer could be based on an XYBlockRenderer or an XYBubbleRenderer.
Regarding the XYBubbleRenderer: IMHO, its major drawback is that the the z values need to be in the same order of magnitaude than either the range of the range or the domain axis.
Re: XYBubbleRenderer with other shapes
Hi. Thanks for the feedback and the link.
Yes, after my initial post I realized that the bubble renderer is not appropriate here, because 2D histograms are binned and the boxes need to be constrained into fitting inside their respective bins. So I'm considering writing a renderer to display shapes that are proportional to the bin's value in terms of min and max for the whole dataset, as well as writing a dataset that would carry along with X,Y,Z values the X,Y bin dimensions. This would allow for variable bin sizes. Does this sound like the right idea? I don't really think this will work very well without the renderer and/or (?) the dataset carrying along some knowledge about the bin dimensions for each XY point.
I agree on the bubble renderer. I think the assumption is not a good one that the Z values are on the same scale as the range or domain axis. This is almost never the case, or if it is, this would be purely coincidental. I tried using it just as a test, and the bubbles were so huge that they basically made no sense. I would prefer if one could supply a maximum size constraint and then the bubbles or whatever shape could be constrained accordingly.
Yes, after my initial post I realized that the bubble renderer is not appropriate here, because 2D histograms are binned and the boxes need to be constrained into fitting inside their respective bins. So I'm considering writing a renderer to display shapes that are proportional to the bin's value in terms of min and max for the whole dataset, as well as writing a dataset that would carry along with X,Y,Z values the X,Y bin dimensions. This would allow for variable bin sizes. Does this sound like the right idea? I don't really think this will work very well without the renderer and/or (?) the dataset carrying along some knowledge about the bin dimensions for each XY point.
I agree on the bubble renderer. I think the assumption is not a good one that the Z values are on the same scale as the range or domain axis. This is almost never the case, or if it is, this would be purely coincidental. I tried using it just as a test, and the bubbles were so huge that they basically made no sense. I would prefer if one could supply a maximum size constraint and then the bubbles or whatever shape could be constrained accordingly.
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: XYBubbleRenderer with other shapes
If yoyu have a special dataset whose data need to be visualized in a special way, creating a new dataset implementation and a new renderer seems indeed the way to go.