Using copyobj to copy lines plotted with datetime xdata
Mostra commenti meno recenti
Matlab returns a warning "Error updating Line. Value must be a vector of numeric type" when I use copyobj to copy a line object in which the XData are datetimes, not numeric. Is there a way to prepare the new axes to receive lines plotted with datetime? Is there a datetime-tolerant version of copyobj?
1 Commento
Xiaoyi Zhao
il 20 Nov 2020
I had similar issue for a longtime, and I was "solving" them by simply plot timeserise with "datenum" (i.e., the MATLAB serieal time) not "datetime". But, the simple/real solution should be this:
For the traget figure
set(gca, 'XAxis', matlab.graphics.axis.decorator.DatetimeRuler);
Then, you could do the copyobj which the XData are datetime.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Dates and Time in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!