Skip to content

madhavgupta3205/GISGURUS_codebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This code provides a versatile solution for plotting time-series data with different Y-axis labels. By changing the filename and Y-axis label, you can easily generate three distinct graphs from a single codebase. This is particularly useful when dealing with datasets containing diverse variables.

Instructions:-

  1. Prepare Data:
  • Ensure that your data is in CSV format.
  • Place your data file ('data.csv') in the same directory as the code.
  1. Run the Code:
  • Execute the code in a Python environment.
  • Ensure that you have the required libraries installed.
  1. Generate Graphs:
  • You can generate three different graphs by making slight modifications to the code.
  • Change the filename and Y-axis label as follows:

Graph 1: Air Temperature data = pd.read_csv('data.csv', skiprows=9, names=['Month', 'Air Temperature'])

plt.plot(data['Air Temperature'], label='Air Temperature', color='red')

plt.ylabel('Temperature(°C)')

plt.title('Air Temperature Data', fontsize=20)

Graph 2:

Monthly Precipitation

data = pd.read_csv('data.csv', skiprows=9, names=['Month', 'mm per Day'])

plt.plot(data['mm per Day'], label='mm per Day', color='red')

plt.ylabel('mm per Day')

plt.title('Monthly Precipitation Data', fontsize=20)

Graph 3:

Surface Soil Moisture

data = pd.read_csv('data.csv', skiprows=9, names=['Month', 'kg per metre square'])

plt.plot(data['kg per metre square'], label='kg per metre square', color='red')

plt.ylabel('kg per metre square')

plt.title('Surface Soil Moisture Data', fontsize=20)

  1. View Graphs:
  • Run the modified code to generate and view the respective graphs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages