本文整理汇总了Java中org.opensourcephysics.frames.PlotFrame类的典型用法代码示例。如果您正苦于以下问题:Java PlotFrame类的具体用法?Java PlotFrame怎么用?Java PlotFrame使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlotFrame类属于org.opensourcephysics.frames包,在下文中一共展示了PlotFrame类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VisualizationManager
import org.opensourcephysics.frames.PlotFrame; //导入依赖的package包/类
/******************
* Initialization *
******************/
public VisualizationManager(String modelName) {
// Instantiate plots
lattice = new LatticeFrame(modelName);
width_vs_time = new PlotFrame("ln t (t in steps)", "ln w", "ln w = b*ln t + C");
width_vs_time.setAutoscaleX(true);
width_vs_time.setAutoscaleY(true);
width_vs_length = new PlotFrame("ln L", "ln w_avg", "ln w = a*ln L + C (After Saturation)");
width_vs_length.setAutoscaleX(true);
width_vs_length.setAutoscaleY(true);
}
示例2: plotPointList
import org.opensourcephysics.frames.PlotFrame; //导入依赖的package包/类
/**
* Abstracts iteration and plotting for
* generic Data type.
* @param points
* @param graph
* @param plotter
*/
protected <Data> void plotPointList(
ArrayList<Data> points,
PlotFrame graph,
Plotter<Data> plotter
) {
for (int i = 0; i < points.size(); i++) {
Point p = plotter.getPoint(i, points.get(i));
graph.append(p.i, p.x, p.y);
}
}
示例3: plotBetaVsX
import org.opensourcephysics.frames.PlotFrame; //导入依赖的package包/类
/**
* Plots average beta values across all x.
* @param beta_avg
*/
public void plotBetaVsX(HashMap<Double, Average> beta_avg) {
// Create new plot
PlotFrame beta_vs_x = new PlotFrame(
"x", "beta", "Average beta values across all x"
);
beta_vs_x.setVisible(true);
// Plot averages
for (Double x: beta_avg.keySet()) {
beta_vs_x.append(0, x, beta_avg.get(x).val);
}
}
示例4: main
import org.opensourcephysics.frames.PlotFrame; //导入依赖的package包/类
public static void main(String[] args) {
PlotFrame frame = new PlotFrame("position", "amplitude", "First Plot"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
frame.setSize(400, 400);
for(double x = -10, dx = 0.1; x<10; x += dx) {
frame.append(0, x, Math.sin(x));
}
//frame.setAutoscaleX(false);
//frame.setAutoscaleY(false);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//DiagnosticsForThreads.aboutThreads();
}
示例5: getWidthVsTime
import org.opensourcephysics.frames.PlotFrame; //导入依赖的package包/类
public PlotFrame getWidthVsTime() {
return width_vs_time;
}
示例6: getWidthVsLength
import org.opensourcephysics.frames.PlotFrame; //导入依赖的package包/类
public PlotFrame getWidthVsLength() {
return width_vs_length;
}