【问题标题】:How to reset/delete Qcustomplot's axis ticker setting?如何重置/删除 Qcustomplot 的轴标记设置?
【发布时间】:2022-08-05 20:40:13
【问题描述】:

我有一个 QcustomPlot 小部件,我想重用它来绘制各种绘图。但是有一种情况,我需要将 xAxis 代码设置为 DateTime。所以我这样做了:

QSharedPointer<QCPAxisTickerDateTime> dateTicker(new QCPAxisTickerDateTime);
dateTicker->setDateTimeFormat(\"yyyy-MM-dd\");
customplot->xAxis->setTicker(dateTicker);

它永远改变了小部件 xAxis 代码。所以当我想把它切换到其他地块时。 xAxis 在每个刻度上始终是 1970-01-01。如何将轴标记设置重置为默认/正常数字设置?

我试过了:

customplot->clearPlottables();
customplot->xAxis->setRange(0,5);
customplot->replot;

但他们都没有工作。他们只清除了情节,但没有清除 x 轴刻度。有什么建议吗?

    标签: c++ qt plot qcustomplot


    【解决方案1】:

    你找到去除蜱虫的方法了吗?

    【讨论】:

      猜你喜欢
      • 2016-04-04
      • 2010-11-26
      • 1970-01-01
      • 1970-01-01
      • 2017-09-13
      • 1970-01-01
      • 2011-02-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多