SunPy Plotting a Solar Image in Python

In this tutorial, we are going to learn how to plot a solar image using SunPy module.

Let's install the module using the following command.

pip install sunpy

Now, we have the module. Before going into writing the actual code, we have to download the data related to sample data for plotting the image. We can download the sample data using the following code.


# importing the data
# downloading the data

If you run the above code, then you will see downloading status of the sample data.

Let's create plot a solar image from the sample data downloaded.


# importing the image from sample data
from import AIA_171_IMAGE
# importing the map for solar image
# creating the Map with sample data
solar_image =
# plotting the image


If you run the above code, then you will get the image as follows.