Programmer’s Reference¶
-
class
metaplot.aux.ValueDict¶ Like a normal dict, but iterates over values instead of keys. Example:
d = {3:1, 5:1} vd = ValueDict(d) [x for x in d] # returns [3, 5] [x for x in vd] # returns [1, 1] sum(d) # returns 8 sum(vd) # returns 2
Simlarly to how one can iterate over the values of a normal dict using .values(), one can iterate over the keys of a ValueDict using .keys().
-
metaplot.aux.capitalize(s)¶ Capitalize first letter in a string but leave the rest untouched (unlike the built-in capitalize which lower-cases them).
-
metaplot.aux.last(series)¶ Print the last value in series to terminal.
-
metaplot.aux.plain(series)¶ Removes any filters from series.
-
metaplot.api.decomment(file, exp='#')¶ Generator removing single line comments in iterable
file.expis the regex for the comment symbol(s).
- TODO:
Gets Unhashable type when doing something like ‘mpl pictetra.hst “V[0:3]”’
Use CSV package.
FILTER metadata. Could have values such as ExpAvg(2.5) which then eval’s user costomizable filter classes.
Some sort of option to include statistical error curves, e.g. min, mean, max. Should be based on evaluating expressions like everything else so min and max could be derived using e.g. StDev.
Arrays/subscripts in symbols. E.g. I[0], I[1] etc, or I_0, I_1, or even I[‘boom’], I[‘probe’]. This should allow evaluation such as sum(I).
Allow binding names to eval strings through kwargs.
Some mechanism for legends.
Tools for plotting convergence? Some mechanism for parameter sweeps. Perhaps some filtering tools, e.g. filtering rows where a given column is ‘CG1’.
Support loglog, semilogx, semilogy, automatic x-axis determination. Have a metaparameter of what variable to use for x axis for various fields.
LaTeX-ready font, size, etc. on figures.
Overload __add__ and other operators such that ‘name’ is meaningful even when not using the parse function (e.g I[0]+I[1]+I[2])
Allow plotting an array, e.g. if I is plotted, plot I[0], I[1], etc.
Let df.plot() have all the same arguments as plot()
Think of a way to plot only same units on same plot
Consider not wrapping Series values in np.array. It may inconvenience some things.
Customizable default-properties for Matplotlib (e.g. linewidth and grid or not)
When plotting multiple quantities in the same plot, e.g. kinetic and potential energy, one may be uJ while the other is mJ. The must be converted to the same prior to plotting.
When plotting quantity with unit m**(-3) part of the xlabel is cut away.
Make support for curve-fit
Make parser for reader that removes multiple delimiters? Make parser for reader that auto-inserts name tag on CSV header rows? Make pandas-based parser?
Make reader for other things than csv-files. E.g. dict_reader()? reader for 2D NumPy array with associated list of column names?
-
class
metaplot.core.DataFrame(arg)¶
-
class
metaplot.core.Series¶ CONSTRUCTOR-LIKE FUNCTIONALITY
-
metaplot.core.equalize_axis_units(ax, xunits=None, yunits=None)¶ Sets the units on the axes of all plots (Line2D) in pyplot. If None it will be scaled to fit all plots.