https://github.com/andrewzhoumq123/sci_graph_api
Generates different types of detailed plots for scientific data
https://github.com/andrewzhoumq123/sci_graph_api
fastapi h5py json matplotlib numpy pandas scipy
Last synced: about 1 month ago
JSON representation
Generates different types of detailed plots for scientific data
- Host: GitHub
- URL: https://github.com/andrewzhoumq123/sci_graph_api
- Owner: AndrewZhouMQ123
- Created: 2025-02-11T01:55:39.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-04T07:46:11.000Z (2 months ago)
- Last Synced: 2025-04-05T19:35:59.759Z (about 1 month ago)
- Topics: fastapi, h5py, json, matplotlib, numpy, pandas, scipy
- Language: Python
- Homepage:
- Size: 108 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SCIENTIFIC GRAPH API
- Generates data graphs and best fits plots by calling API endpoints with data files and parameters
- Plots and fits are available as downloadable pdfs (best format for latex)
- Hosted on Heroku, URL: https://sci-graph-api-5df4e4bebbdd.herokuapp.com/
- Web version hosted on Vercel, URL: https://web-goodies.vercel.app/## General Guidelines
- Acceptable data formats: csv, npy, npz, HDF5, JSON
- First row of csv should be the headers (x labels, y labels etc)
- Size Option: Single Column Plot (3.375 inches * 3 inches), Double Column Plot (7 inches * 3 inches)
- Try to not have duplicate headers, Pandas automatically appends numbers to duplicate colummns, so if that is not what you want, try to have unique column headers# Plot API
## Scatter Plot
- **Endpoint:** `/plot/scatter`
- **Format:** `x : y`
- **Example Data:**
## Errorbar Plot
- **Endpoints:**
- `/plot/errorbar1x` → `x : y : error x`
- `/plot/errorbar1y` → `x : y : error y`
- `/plot/errorbar2xy` → `x : y : error x : error y`## Bar Graph
- **Endpoint:** `/plot/bar`
- **Format:**
- Column 1: Data
- Column 2: Labels## Pie Chart
- **Endpoint:** `/plot/pie`
- **Format:**
- Column 1: Category
- Column 2: Percentage## Boxplot
- **Endpoint:** `/plot/boxplot`
- **Format:**
- Column 1: Category
- Column 2: Value## Single Histogram
- **Endpoints:**
- `/plot/eqhistogram`
- `/plot/varyhistogram`
- **Formats:**
- Single file → Data → Counts/Frequencies
- Two files → Data, Weights → Counts/Frequencies : Bins
- **Other Parameters:**
- `bins`:
- Integer (e.g., `bins=10`): Automatically bins data into evenly spaced intervals.
- List (e.g., `bins=[1, 2, 5]`): Uses exact numbers for bin spacings.## Heatmap and Contour Map (CSV Format)
- **Endpoints:**
- `/plot/imshowhmap`
- `/plot/pmeshhmap`
- `/plot/pmeshfunchmap`
- `/plot/imshowhmap`
- `/plot/contour`
- **Data Format:**
- Matrices must have a single header value `"m"` to distinguish them from ordinary data.
- **Example Data:**

- **Normalization:**
- `"minmax"` or `"zscore"`
- **Missing Values Handling:**
- `"mean"`, `"median"`, or `0`
- **Colormap Selection:**
- Choose from: [Matplotlib Colormaps](https://matplotlib.org/stable/users/explain/colors/colormaps.html)
- **Contour Levels:**
- Integer (e.g., `levels=10`): Automatically generates evenly spaced contour levels.
- List (e.g., `levels=[-1, 0, 1]`): Uses exact numbers as contour levels.## Best Fit API
###