Comments (4)
Hey @sara-02!
You're the second person to ask for this functionality! 🙈 (#3)
If there I get 3 more people asking for it, I'll formalize it into a feature 🤓
For now you can work around with:
import gif
from matplotlib import pyplot as plt
x = list(range(100))
y = [10] * len(x)
@gif.frame
def plot(i):
plt.plot(x[:i], y[:i])
plt.xlim([0, max(x)])
plt.ylim([0, max(y) * 2])
if x[i] > 50 and x[i] < 70:
plt.axvspan(50, x[i-1], facecolor="Red", ls="--", lw=2.0, alpha=0.2)
if x[i] >= 70:
plt.axvspan(50, 70, facecolor="Red", ls="--", lw=2.0, alpha=0.2)
frames = []
for i in range(len(x)):
frame = plot(i)
frames.append(frame)
# IMPORTANT SAVE CODE HERE:
frames[0].save(
"dont_repeat.gif",
save_all=True,
append_images=frames[1:],
duration=70
)
Which will produce (for some reason macOS Preview doesn't support non-looping gifs? But the web does?):
Hope that helps!
from gif.
hey @maxhumber I tried a similar approach as you mentioned, still not able to stop the loop :/.
Can I share the gist code with you to have a look at?
from gif.
Sure! I'll take a look :)
from gif.
humble vote for the feature; noob here thanks for creating this package!
from gif.
Related Issues (9)
- More Examples 💪
- Duration parameter has no effect HOT 3
- AttributeError: partially initialized module 'gif' has no attribute 'options' (most likely due to a circular import) HOT 1
- Size optimization idea HOT 2
- Issues with decorated function arguments used for conditionals, and non-looping gifs HOT 5
- Could this work on generators instead of lists? HOT 5
- Consider using an image object HOT 1
- Compatibility with plotly HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gif.