Created
November 6, 2018 18:33
-
-
Save smillies/2575831ddfa5731b8d04d08d0f1bdad1 to your computer and use it in GitHub Desktop.
SSCE for StackOverflow https://stackoverflow.com/questions/53163438/permissionerror-errno-13-permission-denied-when-saving-holomap-to-gif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import matplotlib | |
matplotlib.use('agg') # avoid use of tkinter (not preinstalled on Linux) | |
# GIF support requires ImageMagick which is installed by default on many Linux installations | |
import holoviews as hv | |
hv.extension('matplotlib') | |
# create a series of 5 x 5 heatmaps | |
numHeatMaps = 2 | |
measurements = [[(i + 1, j + 1, k * 100 + i * 10 + j) for i in range(5) for j in range(5)] for k in range(numHeatMaps)] | |
heatMapDict = {k:hv.HeatMap(measurements[k]) for k in range(len(measurements))} | |
holo = hv.HoloMap(heatMapDict, kdims='index') | |
# render the heatmaps as an animated GIF | |
renderer = hv.renderer('matplotlib') | |
renderer.fps = 5 | |
renderer.save(holo, 'holo', fmt='gif') # broken in Python 3.7 under Windows 10 for any value of numHeatMaps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment