Spaces:
Build error
Build error
Download plot_app.py from Shivraj8615/textile_analysis: direct link, hf CLI and curl.
- Browser
- Download file 1.69 kB
-
https://huggingface.co/spaces/Shivraj8615/textile_analysis/resolve/main/plot_app.py
- Command line
-
hf download hf://spaces/Shivraj8615/textile_analysis/plot_app.py
-
curl -L -o plot_app.py https://huggingface.co/spaces/Shivraj8615/textile_analysis/resolve/main/plot_app.py
1.69 kB
| import matplotlib.pyplot as plt | |
| class Plot: | |
| def plot_steam_load(self, time, steam_consumption): | |
| """ | |
| Plots the variation of steam load with respect to time. | |
| :param time: List of time values. | |
| :param steam_consumption: List of steam consumption values. | |
| :return: Matplotlib figure object. | |
| """ | |
| fig, ax = plt.subplots() | |
| ax.plot(time, steam_consumption, marker='o', linestyle='-', color='b', label='Steam Consumption') | |
| ax.set_xlabel("Time") | |
| ax.set_ylabel("Steam Consumption") | |
| ax.set_title("Steam Load Variation Over Time") | |
| ax.legend() | |
| ax.grid() | |
| return fig | |
| def plot_temperature_curve(self, time, initial_temp, final_temp, temp_gradient): | |
| """ | |
| Plots the temperature variation over time. | |
| :param time: List of time values. | |
| :param initial_temp: List of initial temperatures at each time point. | |
| :param final_temp: List of final temperatures at each time point. | |
| :param temp_gradient: List of temperature gradients. | |
| :return: Matplotlib figure object. | |
| """ | |
| fig, ax = plt.subplots() | |
| ax.plot(time, initial_temp, marker='s', linestyle='--', color='r', label='Initial Temperature') | |
| ax.plot(time, final_temp, marker='^', linestyle='-', color='g', label='Final Temperature') | |
| ax.plot(time, temp_gradient, marker='d', linestyle=':', color='m', label='Temperature Gradient') | |
| ax.set_xlabel("Time") | |
| ax.set_ylabel("Temperature") | |
| ax.set_title("Temperature Variation Over Time") | |
| ax.legend() | |
| ax.grid() | |
| return fig | |