BC, LC: Fix axes scale for none time data.

mesh
Pierre-Antoine Rouby 2023-08-11 09:57:08 +02:00
parent 35ee6617ac
commit bb56c92938
2 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,8 @@
# -*- coding: utf-8 -*-
import logging
from datetime import datetime
from tools import timer, trace
@ -29,6 +31,8 @@ from View.BoundaryCondition.Edit.translate import *
_translate = QCoreApplication.translate
logger = logging.getLogger()
class Plot(APlot):
def __init__(self, canvas=None, data=None,
mode = "time", toolbar=None):
@ -41,6 +45,9 @@ class Plot(APlot):
self._mode = mode
def custom_ticks(self):
if self.data.header[0] != "time":
return
t0 = datetime.fromtimestamp(0)
nb = len(self.data.data)
mod = int(nb / 5)

View File

@ -41,6 +41,9 @@ class Plot(APlot):
self._mode = mode
def custom_ticks(self):
if self.data.header[0] != "time":
return
t0 = datetime.fromtimestamp(0)
nb = len(self.data.data)
mod = int(nb / 5)