IntensityGraph with XY trace data [message #1259736] |
Fri, 28 February 2014 18:49  |
Eclipse User |
|
|
|
I am interested in displaying an IntensityGraph with XY traces and data points. The goal is to reduce the visual complexity of a scatter plot by only displaying outlying data points while representing the remaining data points (hundreds to tens of thousands) with a density/intensity gradient.
Here is an example of what I am trying to achieve and my current progress with an XYGraph:

Does IntensityGraph or XYGraph support this type of visualization? How feasible is it to display an intensity gradient as a background of an XYGraph? What sort of development effort is required to achieve this effect?
|
|
|
|
Re: IntensityGraph with XY trace data [message #1269361 is a reply to message #1265489] |
Tue, 11 March 2014 19:22   |
Eclipse User |
|
|
|
@Xihui, I think Option 2 is the best short term solution. My hope is to directly use the figure returned by IntensityGraphFigure.getGraphArea() as the "image from intensity graph". Do you have any suggestions on how to draw the intensity graph area in the XYGraph plot area before the trace, grid, or annotations are drawn?
|
|
|
Re: IntensityGraph with XY trace data [message #1270194 is a reply to message #1269361] |
Wed, 12 March 2014 16:47  |
Eclipse User |
|
|
|
Here is a snippet on how one can implement Option 1, overlay an XYGraph and IntensityGraphFigure on top of one another.
In addition to not being able to zoom, you cannot have a graph title, legend, or intensity ramp so that the plot areas align. Resizing also must be done manually (not implemented).
I want a title, so I will have to move onto Option 2. You can also use the legend with this option.
public RamachandranPlot(Canvas parent) {
m_parent = parent;
// configure the plot
Range axisRange = new Range(MIN_RANGE, MAX_RANGE);
m_plot = new XYGraph();
// m_plot.setTitle(DEFAULT_TITLE);
m_plot.setShowLegend(false);
m_plot.setTransparent(true);
m_plot.primaryXAxis.setTitle(PHI);
m_plot.primaryYAxis.setTitle(PSI);
m_plot.primaryXAxis.setMinorTicksVisible(false);
m_plot.primaryYAxis.setMinorTicksVisible(false);
m_plot.primaryXAxis.setRange(axisRange);
m_plot.primaryYAxis.setRange(axisRange);
// configure the heat map
int dataLength = MAX_RANGE - MIN_RANGE;
m_heatmap = new IntensityGraphFigure(false);
m_heatmap.setMax(INTENSITY_MAX);
m_heatmap.getXAxis().setTitle("");
m_heatmap.getYAxis().setTitle("");
m_heatmap.getXAxis().setMinorTicksVisible(false);
m_heatmap.getYAxis().setMinorTicksVisible(false);
m_heatmap.getXAxis().setRange(axisRange);
m_heatmap.getYAxis().setRange(axisRange);
m_heatmap.setColorMap(new ColorMap( PredefinedColorMap.Cool, true,
true ));
m_heatmap.setShowRamp(false);
m_heatmap.setDataHeight(dataLength);
m_heatmap.setDataWidth(dataLength);
// load data... (not shown)
// overlay the graphs
org.eclipse.swt.graphics.Rectangle client = m_parent.getClientArea();
Rectangle constraint = new Rectangle(0, 0, client.width,
client.height);
m_container = new Figure();
m_container.setLayoutManager(new XYLayout());
m_container.add(m_heatmap, constraint);
m_container.add(m_plot, constraint);
// put graph in canvas
m_lws = new LightweightSystem(m_parent);
m_lws.setContents(m_container);
}
|
|
|
Powered by
FUDForum. Page generated in 0.02859 seconds