diff --git a/miniapp/miniapp.cpp b/miniapp/miniapp.cpp index d5890c05d936da3d5ec6cef99256ac43c4f2c245..dfff77fa544cb68be9f0454dec8380c99aa530f8 100644 --- a/miniapp/miniapp.cpp +++ b/miniapp/miniapp.cpp @@ -111,7 +111,7 @@ struct model { double value; }; std::string name; - std::string unit; + std::string units; index_type id; std::vector<sample_type> samples; }; @@ -140,9 +140,9 @@ struct model { }; mc::sampler make_simple_sampler( - index_type probe_gid, const std::string& name, const std::string& unit, index_type id, float dt) + index_type probe_gid, const std::string& name, const std::string& units, index_type id, float dt) { - traces.push_back(trace_data{name, unit, id}); + traces.push_back(trace_data{name, units, id}); return {probe_gid, simple_sampler_functor(traces, traces.size()-1, dt)}; } @@ -159,7 +159,7 @@ struct model { nlohmann::json jrep; jrep["name"] = trace.name; - jrep["units"] = trace.unit; + jrep["units"] = trace.units; jrep["id"] = trace.id; auto& jt = jrep["data"]["time"]; diff --git a/scripts/README.md b/scripts/README.md index 6002bc433e65ceb66db9ba86a24338b9a752db9f..a5ece4b4d2c2519d70cd70c530df6b8620ba55fa 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -30,6 +30,7 @@ treated specially: all included traces, or an object representing a mapping of trace names to their corresponding unit string. * `name` is taken as the title of the corresponding plot, if it is unambiguous. + * `label` is ignored: the _label_ for a trace is its name in the data object. ## Operation @@ -51,6 +52,9 @@ tsplot -g units,id data.json ... A subplot can comprise data with to two differint units, and will be plotted with two differing vertical axes. +Note that for the purposes of tsplot, the value of the key _label_ is the +propertu name of the trace in its json representation. + ### Restricting data The `-t` or `--trange` option exlcudes any points that have a time range outside