Advertisement
OreganoHauch

Add circle to plot (inside of another plot)

Aug 2nd, 2020 (edited)
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. figsize=(40,20)
  2. fig = plt.figure(figsize=figsize)
  3. ax1 = fig.add_subplot(121)
  4.  
  5. # allows to plot only a specific location on the y-z current array (else plot each 'thinning'-squared-th IV curve):
  6. if coordinate != None:
  7. ax1.plot(voltages[A:B], pixelplotting_array[:,coordinate[0],coordinate[1]],linewidth = 0.2,color="blue")
  8.  
  9. # Create a set of inset Axes: these should fill the bounding box allocated to them.
  10. ax1_2 = plt.axes([0,0,1,1])
  11. # the best looking fontsize is about half of the width of the figsize
  12. fontsize = figsize[0]//2
  13.  
  14. ax1_2.imshow(current_array, interpolation='nearest', cmap=cm.afmhot, origin='lower')
  15.  
  16. # Manually set the position and relative size of the inset axes within ax1
  17. ip = InsetPosition(ax1, [0.2,0.2,0.3,0.3])
  18. ax1_2.set_axes_locator(ip)
  19. # Mark the region of the solar cell where the shown IV curve emanates from.
  20. circle = plt.Circle((0.5, 0.5), 0.4, color='blue')
  21. ax1_2.add_artist(circle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement