本文整理汇总了C++中epsplot::DATA::Plot方法的典型用法代码示例。如果您正苦于以下问题:C++ DATA::Plot方法的具体用法?C++ DATA::Plot怎么用?C++ DATA::Plot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类epsplot::DATA
的用法示例。
在下文中一共展示了DATA::Plot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Plot
void Plot(epsplot::PAGE_PARAMETERS & i_cPlot_Parameters, epsplot::DATA &i_cPlot, const char * i_lpszFilename_Format, const char * i_lpszOutput_File_Prefix, const ES::Spectrum & i_cTarget, const ES::Spectrum & i_cFit, const double & i_dTarget_Normalization_Flux, const double & i_dFit_Normalization_Flux,const double &i_dPlot_Min_WL, const double & i_dPlot_Max_WL, unsigned int i_uiX_Axis, unsigned int i_uiY_Axis)
{
// Make sure that both spectra are within the desired plot range, otherwise don't bother plotting.
if (((i_cTarget.wl(0) >= i_dPlot_Min_WL && i_cTarget.wl(0) <= i_dPlot_Max_WL) ||
(i_cTarget.wl(i_cTarget.size() - 1)>= i_dPlot_Min_WL && i_cTarget.wl(i_cTarget.size() - 1) <= i_dPlot_Max_WL) ||
(i_cTarget.wl(0) <= i_dPlot_Min_WL && i_cTarget.wl(i_cTarget.size() - 1) >= i_dPlot_Max_WL)) &&
((i_cFit.wl(0) >= i_dPlot_Min_WL && i_cFit.wl(0) <= i_dPlot_Max_WL) ||
(i_cFit.wl(i_cFit.size() - 1)>= i_dPlot_Min_WL && i_cFit.wl(i_cFit.size() - 1) <= i_dPlot_Max_WL) ||
(i_cFit.wl(0) <= i_dPlot_Min_WL && i_cFit.wl(i_cFit.size() - 1) >= i_dPlot_Max_WL)))
{
double * lpdTarget_WL = NULL, *lpdTarget_Flux = NULL, *lpdFit_WL = NULL, *lpdFit_Flux = NULL;
unsigned int uiNum_Points_Target, uiNum_Points_Fit;
char lpszFilename[256];
// Get spectral data in the desired range
Get_Spectra_Data(i_cTarget, lpdTarget_WL, lpdTarget_Flux, uiNum_Points_Target, i_dPlot_Min_WL, i_dPlot_Max_WL);
Get_Spectra_Data(i_cFit, lpdFit_WL, lpdFit_Flux, uiNum_Points_Fit, i_dPlot_Min_WL, i_dPlot_Max_WL);
// normalize spectra
// printf("%.2e\t%.2e\n",i_dTarget_Normalization_Flux,i_dFit_Normalization_Flux);
Normalize(lpdTarget_Flux, uiNum_Points_Target,i_dTarget_Normalization_Flux);
Normalize(lpdFit_Flux, uiNum_Points_Fit, i_dFit_Normalization_Flux);
sprintf(lpszFilename,i_lpszFilename_Format,i_lpszOutput_File_Prefix);
i_cPlot.Set_Plot_Filename(lpszFilename);
i_cPlot.Set_Plot_Data(lpdTarget_WL, lpdTarget_Flux, uiNum_Points_Target, epsplot::BLACK, epsplot::SOLID, i_uiX_Axis, i_uiY_Axis, -1.0);
i_cPlot.Set_Plot_Data(lpdFit_WL, lpdFit_Flux, uiNum_Points_Fit, epsplot::RED, epsplot::SOLID, i_uiX_Axis, i_uiY_Axis, -1.0);
i_cPlot.Plot(i_cPlot_Parameters);
delete [] lpdTarget_WL;
delete [] lpdTarget_Flux;
delete [] lpdFit_WL;
delete [] lpdFit_Flux;
}
else
{
printf("No plot: %.1f %.1f %.1f %.1f %.1f %.1f\n",i_dPlot_Min_WL, i_dPlot_Max_WL,i_cTarget.wl(0),i_cTarget.wl(i_cTarget.size() - 1), i_cFit.wl(0),i_cFit.wl(i_cFit.size() - 1));
}
}