|
|
|
Re: IntensityGraph with XY trace data [message #1270194 is a reply to message #1269361] |
Wed, 12 March 2014 16:47 |
Steven Darnell Messages: 19 Registered: November 2010 |
Junior Member |
|
|
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.03793 seconds