UNKNOWN
Project description
# python_plot_wrappers A wrapper for making polished multi-line plots with matplotlib. I wrote this as an easy-to-access interface to make cleaner looking plot code, and not have to retype pyplot syntax over and over. Allows for passing data in as nested dictionaries. All lines are created using a single x-axis data set - essentially a setup to visualize parametric sweeps.
See sample images by following links below:
Pre-requisites: python + matplotlib, numpy, scipy, latex + texlive-fonts-extra, (and maybe texlive-full)
Usage:
plot_wrapper(plot_data, keys, labels, save_folder)
Instructions:
plot_data : Dictionary (level 1) that contains multiple (level 2) dictionaries. Each level 2 dictionary corresponds to a line in the figure(s), and must have the following key/value pairs:
data[‘x’] = x # list of x-axis values to be plotted
data[‘xlbl’] = ‘X axis label’ # string defining x-axis label
data[‘lstyle’] = ‘-’ # line style. can be ‘–’, ‘-’, ‘-.’ or ‘:’. Recommend first 2
data[‘mtype’] = ‘s’ # Marker type for line. Recommend ‘s’,’o’,’^’ or ‘’ for none
data[‘keyname’]= y # data to be plotted on the y axis
data[‘lcolor’] = ‘r’ # line color. Can be ‘r’, ‘b’, ‘k’, ‘m’,….
keys : list of data keys in the level-2 dictionaries that need to be plotted. If multiple level-2 dictionaries havedata under the same key name, these data sets are plotted on the same figure.
labels : y-axis labels (list of strings) that are applied to the y-axis label for each figure, corresponding to entries in the list “keys”. If keys and labels are of different lengths, the shorter list is used to generate figures since I used the zip function.
save_folder : path where you want to save all images. Right now uses png format.
Feel free to modify/add.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for python_plot_wrapper-0.1beta.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 396d3e5938afb06775c36d4a5bf1d32fcbaff8b449103f4e81fd53a813d89d3d |
|
MD5 | 8781722a849517a489d52137edcd2bdf |
|
BLAKE2b-256 | 9d2c76748ba726d0c86751003b46811fdfadd3a4ab0dc74a1d3fb0ea5ddc32e6 |
Hashes for python_plot_wrapper-0.1beta.linux-x86_64.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | a91ff7ce9b2cee1d9c0e4c21d89ad299669bd9127b618d1737a807c7ea6bdebc |
|
MD5 | 7e71bc545b9bbf04fd9123b029e8f507 |
|
BLAKE2b-256 | 6f8035577bf36b3f75c579ffd3840a0d45fb2ca9004c33270d00e2dbed95e196 |