Can matplotlib Python code be used to draw graphs in RStudio?
eg. below the matplotlib python code:
import numpy as np import matplotlib.pyplot as plt n = 256 X = np.linspace(-np.pi,np.pi,n,endpoint=True) Y = np.sin(2*X) plt.plot (X, Y+1, color='blue', alpha=1.00) plt.plot (X, Y-1, color='blue', alpha=1.00) plt.show()
The output schedule will be:

Then I need to write an R markdown to enable this code and automatically generate a graph after clicking a button.
matplotlib rstudio
beetlej
source share