I am plotting some graphs using R. When I run the program the plot appears and then quickly disappears. How can I make the plot stay?`
I am running the following code found in Dynamic Time Warping in Python
import numpy as np
import rpy2.robjects.numpy2ri
from rpy2.robjects.packages import importr
# Set up our R namespaces
R = rpy2.robjects.r
DTW = importr('dtw')
# Generate our data
idx = np.linspace(0, 2*np.pi, 100)
template = np.cos(idx)
query = np.sin(idx) + np.array(R.runif(100))/10
# Calculate the alignment vector and corresponding distance
alignment = R.dtw(query, template, keep=True)4
plot(alignments)
dist = alignment.rx('distance')[0][0]
print(dist)
Basically the main file is in python, I have installed rpy2, i am remotely connecting into a unix machine. Now the plot shows up but immediately disappears. This only happens to R plots. When I run matplotlib plots they stay(not disappear). so I am wondering whether I have to put some line of code to make the plots "stay". For example like the matlab "holdon".