Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
I think that is a matplotlib characteristic, when one draw a plot
importnumpyasnpimportmatplotlib.pyplotaspltx=np.linspace(0,10,500)dashes= [10,5,100,5]# 10 points on, 5 off, 100 on, 5 offfig,ax=plt.subplots()line1,=ax.plot(x,np.sin(x),'--',linewidth=2,label='Dashes set retroactively')line1.set_dashes(dashes)line2,=ax.plot(x,-1*np.sin(x),dashes=[30,5,10,5],label='Dashes set proactively')plt.xlim(1,9)ax.legend(loc='lower right')plt.savefig('test1.eps',dpi=1000)
set the xlim will force the X-axis within 1-9, the line segment outside 1-9 hide, but it just hide not be clipped,I don't know how can i actually clip elements with axes extent.
I use Adobe Illustrator to open eps file.
You see it is fine,
But actually it is,
In sometimes, this characteristic is very useful, for example, if one useplt.show()
to use the interactive mode, one can drag the canvas to left or to right to see the whole line in the range 0-10.
But in eps file, i do not think this characteristic reasonably, it typically increases the eps file size.
Is it a method to change this behavior ?
Matplotlib:1.5.X
or2.0.X
OS:Windows 10
orCentOS