带二进制数据的GnuPlot轴信息

时间:2017-04-24 17:08:10

标签: gnuplot

我目前正在使用一个C / C ++程序,它执行一些信号处理并将数据写入文件,并命令管道供GnuPlot进程摄取。基本上我的数据是一次性光谱和STFT光谱图。鉴于我的数据在内存中是连续的数组,我希望能够输出X轴信息,Y轴信息,然后是自己的数据,但是我似乎无法找到适当的命令格式GNUPLOT。另外,如果可能的话,我想保持我的数据是双精度的(主要是为了防止额外的数据转换,但是如果必要的话可以这样做)

以下是当前用于生成绘图的命令(不支持轴信息):

// Send command to the pipe to generate the plot
fprintf(commandPipe, "plot '%s' binary format=\"%%float64\" array=(%d,%d)  with image title \"Channel 2\" \n",  chan2_fileName, dataWidth , dataHeight  );

理想情况下可以遵循以下内容:

// Send X-Axis info to the data file
fwrite(xData, sizeof(double), dataWidth, dataFile);
// Send Y-Axis info to the data file
fwrite(yData, sizeof(double), dataHeight, dataFile);
// Send the spectrogram data
fwrite(spectrogram, sizeof(double), dataWidth * dataHeight, dataFile);

关于我如何能够做到这一点的任何想法/建议?

谢谢! TMII

0 个答案:

没有答案