-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve plot data handling #54
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #54 +/- ##
===========================================
+ Coverage 78.15% 81.18% +3.03%
===========================================
Files 100 102 +2
Lines 18568 20414 +1846
===========================================
+ Hits 14512 16574 +2062
+ Misses 4056 3840 -216
Continue to review full report at Codecov.
|
bba8020
to
f860093
Compare
c29c199
to
73f1ae0
Compare
279aafe
to
a702595
Compare
TODO:
|
03d45f5
to
47b82a2
Compare
e117e85
to
fd7008b
Compare
…r-prone plotting functions
…h implementation of legend_show_data_labels
…Useful for example if some data should be plotted in a negative direction)
…ial cases in the PlotData class Removed mask and __getitem__ from PlotData as they are not used and are also not really implemented completely. If they are needed they need to be redone anyway
…d by data form the PlotData instance
… in numpy but we can still use it for now
…it in ``key in source`` statements
concat does not overwrite an already existing column
A shallow copy will not copy the data attribute
Manual configuration with output_file/output_notebook is needed
fd7008b
to
d722bc9
Compare
Also see #26
This PR implements a way to provide data to the plotting functions in many different ways while keeping the plotting functions consistent and simple.
A class
PlotData
is added, which acts as a light wrapper around mappings of many kinds (dicts, dataframe, ColumnDataSources), which can be used to easily handle multiple datasets. Suppose we have a dictdata
with a keyx
andy1
andy2
and we want to plot they
keys both againstx
The above example will yield two items with x vs y1 and x vs. y2,
source
is the dictdata
in both cases. Notice that the chosen namesx
andy
are completely arbitrary. With the initialization we define how our data columns should be named.PlotData
also has some convenience methods for mutating/copying/getting information about the dataIn addition a function
process_data_arguments
is implemented, which can either take a mapping and kwargs to directly Initialize the PlotData as above. But it is also possible to provide only the kwargs with the wanted data in arrays/lists/series, which are then split up and put into dicts to initialize aPlotData
object