Skip to content

Plots

Overview

With pvgis-prototype we can generate plots : images that we can re-use or plot directly in the terminal for uninterrupted interactive work.

  • Plot


    • use the command series + subcommand plot

    • arbitrary single or multiple time series

    • user defined output filename

    • support for Tufte-styled output

    Cite

    The Visual Display of Quantitative Information Edward R. Tufte | 1983 / 2nd Edition 2001 197 Pages

  • Uniplot in the terminal !


    • Use the --uniplot flag

    • Support for single and multiple series

    • Dedicated --horizon-plot

    • Adjust output width via the --terminal-width-fraction flag

Time series

pvgis-prototype series plot \
era5_t2m_over_esti_jrc.nc \
8.628 45.812 \
--neighbor-lookup nearest \
--start-time '2001-01-01' \
--end-time '2020-01-31' \
--tufte-style \
--output-filename 'example_series_plot' \
--no-variable-name-as-suffix
/spacetime/pvgis/pvgis-prototype-public/pvgisprototype/api/series/plot.py:367: UserWarning: Glyph 169 (\N{COPYRIGHT SIGN}) missing from font(s) Noto Sans Math.
  plt.savefig(save_path / output_filename)
/spacetime/pvgis/pvgis-prototype-public/pvgisprototype/api/series/plot.py:367: UserWarning: Glyph 183 (\N{MIDDLE DOT}) missing from font(s) Noto Sans Math.
  plt.savefig(save_path / output_filename)
✓ Time series plot of 132193 values over (8.649999999999999, 45.85) exported in 'example_series_plot_20050101000000_20200131000000.png'

You can find the newly generated plot in your current working directory.

Example series plot
Example ERA5 Temperature at 2m time series plot

Uniplot

A day of power output

We can plot in the terminal the photovoltaic power for a single day

pvgis-prototype power broadband \
8.628 45.812 214 \
--start-time '2010-01-27' \
--end-time '2010-01-28' \
--uniplot
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,345.395,548.448,681.019,749.144,756.843,704.624,589.292,405.176,142.608,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
Uniplot
Power observed from (longitude, latitude) 0.15058700786207074, 0.7995702369236423
┌────────────────────────────────────────────────────────────────────────┐
│                                ▄▀▀▀▚▄                                  │
│                              ▄▀      ▀▖                                │
│                             ▞         ▝▚                               │
│                            ▞            ▚                              │
│                           ▞              ▚                             │
│                          ▞               ▝▖                            │ 500 W
│                         ▗▘                ▝▖                           │
│                         ▌                  ▚                           │
│                        ▞                    ▌                          │
│                       ▗▘                    ▐                          │
│                       ▐                      ▌                         │
│                       ▌                      ▐                         │
│                      ▐                        ▌                        │
│                      ▞                        ▐▖                       │
│                     ▗▘                         ▚                       │
│                     ▐                           ▚                      │
│▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▚▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄│ 0 W
└────────────────────────────────────────────────────────────────────────┘
2010-01-27                   2010-01-27T12:00                      2010-01-28
                    ██ ⌁ Simulated Photovoltaic Power

A year of power output

Use the --quiet option

Large time series will take some time to print in the command line. It's really useful to use the --quiet flag.

For a horizontally flat panel, we get

pvgis-prototype power broadband \
8.628 45.812 214 \
180 0.001 \
--start-time '2010-01-01' \
--end-time '2010-12-31' \
--quiet \
--uniplot
Uniplot
Power observed from (longitude, latitude) 0.15058700786207074, 0.7995702369236423
┌────────────────────────────────────────────────────────────────────────┐
│▄▟████████████▙▄▄▄▄▄▄▄▄▄▄▄▄▄                   ▗▄▄▄▄▄▄▄▄▄▄▟███████▄▄▄▄▄▄│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│ 500 W
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│ 0 W
└────────────────────────────────────────────────────────────────────────┘
2010-01        2010-04           2010-07           2010-10
                    ██ ⌁ Simulated Photovoltaic Power

Let's change the tilt to 30 degrees

pvgis-prototype power broadband \
8.628 45.812 214 \
180 30 \
--start-time '2010-01-01' \
--end-time '2010-12-31' \
--quiet \
--uniplot
Uniplot
Power observed from (longitude, latitude) 0.15058700786207074, 0.7995702369236423
┌────────────────────────────────────────────────────────────────────────┐
│               ▗▄▄▄██████████████▄▄▄▄▄▄███████▙▄▄▄▄▄▖                   │
│           ▄▟██████████████████████████████████████████▄▄▖              │ 750 W
│       ▗▄██████████████████████████████████████████████████▄▄           │
│    ▄▄████████████████████████████████████████████████████████▙▄▖       │
│▄▄████████████████████████████████████████████████████████████████▙▄▄▄▄▄│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│ 500 W
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│ 250 W
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│ 0 W
└────────────────────────────────────────────────────────────────────────┘
2010-01        2010-04           2010-07           2010-10
                    ██ ⌁ Simulated Photovoltaic Power

and then to 45 -- at the same time, we can ask for a simplification of the plot via the --resample-large-series option

pvgis-prototype power broadband \
8.628 45.812 214 \
180 45 \
--start-time '2010-01-01' \
--end-time '2010-12-31' \
--quiet \
--uniplot \
--resample-large-series
Uniplot
Power observed from (longitude, latitude) 0.15058700786207074, 0.7995702369236423
┌────────────────────────────────────────────────────────────────────────┐
│                ▗▄▞▀▀▄▄▄▄                    ▗▖                         │
│             ▄▄▀▘        ▀▀▀▄▄▄      ▗▄▄▄▄▀▀▀▘▝▀▀▀▀▀▚                   │ 260 W
│            ▞                  ▀▀▀▀▀▀▘               ▀▄                 │
│          ▗▀                                           ▚▖               │
│         ▗▘                                             ▝▚              │
│        ▞▘                                                ▀▖            │ 240 W
│       ▞                                                   ▝▖           │
│      ▛                                                     ▝▖          │
│     ▞                                                       ▐          │
│    ▞                                                         ▚         │ 220 W
│   ▐                                                           ▚        │
│  ▗▘                                                            ▚       │
│ ▗▘                                                              ▀▖     │
│ ▌                                                                ▝▄    │ 200 W
│▞                                                                   ▚▖  │
│                                                                     ▝▖ │
│                                                                      ▝▚│
└────────────────────────────────────────────────────────────────────────┘
          2010-04             2010-07             2010-10
                    ██ ⌁ Simulated Photovoltaic Power

A day of solar incidence angles

pvgis-prototype position overview \
8.628 45.812 \
--start-time '2010-01-17' \
--end-time '2010-01-18' \
-aou degrees \
--quiet \
--uniplot
Uniplot
Solar Position observed from (longitude, latitude) 8.628, 45.812000000000005
┌────────────────────────────────────────────────────────────────────────┐
▗▄▜▗▄▀▘ ▝▖▄▄▄▀▀▘     ▗▄▄▄▞▀▀▀             │ 250 Unitless
▄▄▄▞▀▀▀                  ▗▄▄▞▀▀                         ▄▄▞▀▘                               ▗▄▄▞▀▀                                    ▄▄▄▀▀▘                                         ▄▄▄▞▀▀▀                                               ▄▄▄▞▀▀▀                                                      ▝▖▗▄▞▀▀                                  ▗▄▄▀▖                      ▗▄▀▘                 ▗▀ ▀▀▀▄▄▄▖      ▄▄▄▞▀▀▘   ▝▖                     ▞▘                   ▗▄▄▄▄▞▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄▄▄▄▄  ▝▖                    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄▄▄▞▀▀▀▘▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▀▀▀▀▄▄▄▖▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀│ 0 Unitless
▗▄▄▄▞▀▀▀                                       ▝▀▀▀▄▄▄▄▄▄▄▞▀▀▀▘                                                      ▀▀▀▀▄▄▄▄▄▄└────────────────────────────────────────────────────────────────────────┘
2010-01-17                   2010-01-17T12:00                      2010-01-18
           ██ NA Incidence  (NA)   ██ Altitude ⦩   ██ Azimuth 󱦥

Reading external time series data

We can repeat the same task by using SARAH⅔ products for the global and direct horizontal irradiance components

pvgis-prototype power broadband \
8.628 45.812 214 180 35 \
--start-time '2010-01-27' \
--end-time '2010-01-28' \
--global-horizontal-irradiance sarah2_sis_over_esti_jrc.nc \
--direct-horizontal-irradiance sarah2_sid_over_esti_jrc.nc \
--neighbor-lookup nearest \
--uniplot
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,283.68,441.98,556.427,616.579,553.207,578.246,388.152,109.945,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
Uniplot
Power observed from (longitude, latitude) 0.15058700786207074, 0.7995702369236423
┌────────────────────────────────────────────────────────────────────────┐
│                               ▗▞▚▖                                     │
│                              ▞▘  ▝▄▄▄▀▖                                │
│                             ▞         ▐                                │
│                            ▞           ▌                               │ 500 W
│                           ▞            ▐                               │
│                          ▐              ▚                              │
│                         ▗▘              ▝▖                             │
│                         ▌                ▌                             │
│                        ▞                 ▐                             │
│                       ▗▘                  ▌                            │
│                       ▞                   ▐                            │
│                       ▌                   ▝▖                           │
│                      ▐                     ▚                           │
│                      ▞                     ▐                           │
│                     ▗▘                      ▚                          │
│                     ▐                        ▚                         │
│▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▚▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄│ 0 W
└────────────────────────────────────────────────────────────────────────┘
2010-01-27                   2010-01-27T12:00                      2010-01-28
                         ██ ⌁ Photovoltaic Power

or indeed use also ERA5 time series data for ambient temperature and wind speed

pvgis-prototype power broadband \
8.628 45.812 214 180 35 \
--start-time '2010-01-27' \
--end-time '2010-01-28' \
--global-horizontal-irradiance sarah2_sis_over_esti_jrc.nc \
--direct-horizontal-irradiance sarah2_sid_over_esti_jrc.nc \
--temperature-series era5_t2m_over_esti_jrc.nc \
--wind-speed-series era5_ws2m_over_esti_jrc.nc \
--neighbor-lookup nearest \
--uniplot
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,298.24,464.715,586.838,651.935,583.057,608.972,405.937,114.748,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
Uniplot
Power observed from (longitude, latitude) 0.15058700786207074, 0.7995702369236423
┌────────────────────────────────────────────────────────────────────────┐
│                               ▗▞▚▖                                     │
│                              ▄▘  ▝▄▄▄▞▖                                │ 600 W
│                             ▞      ▘  ▚                                │
│                            ▞           ▌                               │
│                           ▞            ▐                               │
│                          ▐              ▚                              │
│                         ▗▘              ▝▖                             │ 400 W
│                         ▌                ▌                             │
│                        ▞                 ▐                             │
│                       ▗▘                  ▌                            │
│                       ▞                   ▚                            │
│                       ▌                   ▝▖                           │ 200 W
│                      ▐                     ▌                           │
│                      ▞                     ▐                           │
│                     ▗▘                      ▚                          │
│                     ▐                        ▚                         │
│▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▚▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄│ 0 W
└────────────────────────────────────────────────────────────────────────┘
2010-01-27                   2010-01-27T12:00                      2010-01-28
                         ██ ⌁ Photovoltaic Power

Neighbor lookup ?

When reading data from external time series data, it is rather rare that the requested location coordinates truely exist as a data record. Most likely, we need to ask for the location in the data that is nearest to the coordinates of our interest. There are also other methods for inexact location lookups available through the --neighbor-lookup option.

Multi-year series

Or for 20 years

pvgis-prototype power broadband \
    8 45 214 \
    --start-time '2000-01-01' \
    --end-time '2020-12-31' \
    --quiet \
    --uniplot
Uniplot
Power observed from (longitude, latitude) 0.13962634015954636, 0.7853981633974483
┌────────────────────────────────────────────────────────────────────────┐
│▐▙▟▖█▄▌▐▌█▗█▟▌▟▄▙▐▙▟▖█▟▌▐▌█▗█▟▌▟▄▙▐▙▟▖█▟▌▐▌█▗█▟▌▟▄▙▐▙▟▖█▐▌▐▌█▗█▟▌█▄▙▐▙▟▖│
│▐██▙██████▟██▌███▐██▙██████▟██▌███▐██▙██████▟██▌███▐██▙██████▟██▌███▐██▌│ 750 W
│███████████████████████████████████████████████████████████████████████▙│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│ 500 W
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│ 250 W
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│
│████████████████████████████████████████████████████████████████████████│ 0 W
└────────────────────────────────────────────────────────────────────────┘
            2004          2008          2012         2016          2020
                    ██ ⌁ Simulated Photovoltaic Power

20 years of hourly time series!

Since we ask for 20 years of hourly time series, it is a good idea to use the --quiet flag! Otherwise, it is going to take quite some time to print such a large times series in the terminal.

The --uniplot will still work and this is the idea behind the --quiet flag.

Multiple series

uniplot will also handle multiple series. This is useful for example in the context of the broadband-multi command.

pvgis-prototype power broadband-multi \
    8 45 214 \
    --start-time '2010-01-27' \
    --end-time '2010-01-28' \
    --surface-orientation "180,180,100" \
    --surface-tilt "45,0.1,33" \
    --quiet \
    --uniplot
/spacetime/pvgis/pvgis-prototype-public/pvgisprototype/api/power/broadband_multiple_surfaces.py:527: RuntimeWarning: invalid value encountered in divide
  (total_spectral_effect / global_irradiance_series * 100)
Uniplot
             Photovoltaic power output from multiple surfaces
┌────────────────────────────────────────────────────────────────────────┐
▗▄▀▀▄▖▞▘    ▝▚                              ▗▘                           ▝▖                              │ 1,000 W
                ▝▖▗▘       ▄▄▄▄▄▄    ▝▖     ▄▀▀      ▀▀▄     ▄▀            ▀▄ ▗▘ ▄▄▞▀▚▄▄▖         ▀▖ ▞▀      ▝▚▄▖      ▝▄   ▗▄▀▀▘   ▀▄▀▀▄▖      ▄▛▘         ▚▖ ▝▀▄   ▗▘▗▄▀             ▝▚▖  ▀▄▖ ▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌▀▘▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▝▀▀▜▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄│ 0 W
└────────────────────────────────────────────────────────────────────────┘
2010-01-27                   2010-01-27T12:00                      2010-01-28
   ██ Sum of Photovoltaic Power   ██ Orientation, Tilt : 3.142°, 0.785°
                  ██ Orientation, Tilt : 3.142°, 0.002°
                  ██ Orientation, Tilt : 1.745°, 0.576°

Horizon plot

The horizon plot visualises in a polar plot the profile of the horizon height around the geographic location in question.

pvgis-prototype position overview \
8.610 45.815 \
--start-time 2010-01-01 \
--end-time "2010-12-31 23:00:00" \
--rounding-places 2 \
--quiet \
--horizon-profile horizon_profile_over_esti_jrc.nc \
--horizon-plot
┌─────────────────────────────────────────────┐
⢠⠊⢇ ⢀⡠⣀⡠⡀ ⡠⡀  ⡰⠣⡠⠢⡄                      │ 4
⢀⡎ ⠈⢆⡎   ⠙⢴⠁⠈⠉⠈⠚    ⠈⠒⢤⡀      ⢀⣀⣀ ⢀⡤⠒⠚⠒⢤⣀⡀⠒⠊⠁                     ⠈⠑⠒⢄⠴⠉⠉⠁  ⠉⠁      ⠈⠑│ 2
└─────────────────────────────────────────────┘
 0          100         200          300
               ⣿⣿ Horizon height
┌─────────────────────────────────────────────┐
⢀⣀⣀⡠⠤⠤⠒⠒⠒⠒⠒⠒⠒⠢⠤⢄⣀⣀⡀⢀⡠⣠⠔⠊⠉               ⠉⠒⠤⡀⢄⡀⡠⠔⠉                      ⠈⠑⠤⡀⡔⠊                            ⠈⠑⠤⡀     │ 1
⢀⡀                                 ⠈⢆⠐⠋                                    ⠈⠻⠄⢀⠎⣀⣄                                   ⣀⡀⣴⠿⠋⠁                                   ⠙⠻⣶⡄  ⣠⣶                                ⠠⣤⡀  ⠙⣆ ⢀⡾⠋  ⣠⡄                           ⢀⡀ ⠉⠻⣆ ⣠⢞⡏   ⣼⠟                        ⢀⡀ ⠘⢿⡄  ⠘⣷⣄│ 0
⠁⡼  ⣠⡾⠁  ⣼⠟                  ⢠⡄ ⠘⢿⡄  ⠹⣄  ⢸⡈⠇⠃⢀⡜⢡⠇  ⣴⠋  ⢰⡟  ⣸⡇    ⢰⡆  ⣿⡄ ⠘⣿  ⠈⢳⡀  ⣏⠳⡀  ⢀⡞⢹  ⢠⢾   ⡿⠁    ⠸⡇  ⠸⡇  ⢸⣆  ⢸⠹⡄  ⠁⢀⡇   ⢠⠏⢸  ⡼⢳  ⢰⢣  ⢰⢧  ⢰⢱⡀ ⢸⠘⣆  ⢹⡀⠘⡄⢨⠃ ⡇⢀⡇   ⢰⠃⢸  ⡏⠸⡀ ⡞⠘⡆     ⠸⡄⢀⡇⠈⠉  ⢧⣠⠇     ⡇⢸⠁    ⠸⣄⣸  ⠙⠚     │ -1
⠈⠢⢄    ⠈⠓⠃ ⠈⠳⠞⠁⠈⠣⠼⠁ ⠘⠒⠃   ⣀⠔⠊⠉⠒⠤⢄⣀              ⣀⡠⠔⠊⠉⠊⠁⠈⠉⠉⠉⠒⠒⠒⠢⠤⠒⠒⠒⠒⠊⠉⠉⠒⠉⠁└─────────────────────────────────────────────┘
        -1             0             1
    ⣿⣿ Horizontal plane   ⣿⣿ Horizon height
               ⣿⣿ Solar altitude