python - matplotlib: How to make arrow size independent of line width? -
Using matplotlib annotated
I want to scale the line width with some parameters, but For example not to end:
import matplotlib.pyplot as matplotlib import patch plt.figure to plt (1, fig = (3,3)) ax = plt.subplot (111) ) Width = [1. , 4.] For i, LW in calculation (width): N1 = patch. Connection patch (0.2, 0.2 + i * 0.1), (0.8,0.8 + i * 0.1), 'data', 'data', arrowstyle = "| - |, widthA = 1., WidthB = 1.", Lw = LW) ax.add_patch (ann1) plt.savefig ('arrow.png')
Lines both:
I would like only the width of the connecting line varies, but not the caps on both ends.
Edit :
My work is to use two overlapping lines: one with a thick hat without a thin cap:
LW in calculation (width) for plt.figure (1, fig = (3,3)) ax = plt.subplot (111) width = [1., 4.] Ann1 = patches.ConnectionPatch ((0.2, 0.2 + i * 0.1), (0.8,0.8 + i * 0.1), 'data', 'data', arrow style = "| - |, width = 1., width B = 1, "lw = 1.) Ann2 = patches.ConnectionPatch ((0.2, 0.2 + i * 0.1), (0.8,0.8 + i * 0.1), 'data', 'data', arrowstyle =" - ", lw = Lw) ax.add_patch (ann1) Ax.add_patch (ann2) plt.savefig ('arrow.png')
Which I did Trying to do something creates something:
< / P>
Comments
Post a Comment