I have some 2d data which I plot using this code:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def f():
x=np.linspace(0,100,20000)
return x, np.sin(x)*np.exp(x)
#this is the plotting function
def symp(l,label,x_scale,y_scale):
linthresh=10e-32
for i in range(len(l)):
style=[':','dashed','dashdot','dotted']
dashes=[(5, 1),(3, 5),(3, 5, 1, 5), (1,1)]
col=['Red','Green','Orange','Blue']
csfont = {'fontname':'Leelawadee UI'}
line= plt.plot(l[i][0],l[i][1])
plt.xscale(x_scale)
plt.yscale(y_scale,linthreshy=linthresh)
plt.xticks(fontsize=10, fontweight='bold',**csfont)
plt.yticks(fontsize=10, fontweight='bold',**csfont)
plt.xlabel('x',fontsize=26, fontweight='bold',**csfont)
plt.ylabel(label,fontsize=26, fontweight='bold',**csfont)
plt.setp(line, linestyle=style[i],color=col[i],dashes=dashes[i])
plt.locator_params(axis='y')
plt.tight_layout()
# plt.savefig(str(label+'.eps'), format='eps')
plt.show()
symp([f()],r'${v}_{a}(x)$','log','symlog')
My goal is to plot only part of 1 array (for example f()[200:1000]) but linearly on the main plot. (In other words, I'm just zooming on my plot, I need it for my paper):
How can I do this properly?