Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
axes.plot(xarr1, yarr1, '-r', xarr2, yarr2,  '-g')

How to define subplot(s) with empty axes

Code Block
axes  = fig.add_subplot(111)        
axes.set_xlim((-50,1750))
axes.set_ylim((-50,1750))

...


or

Code Block
import matplotlib.gridspec as gridspec
gsaxes1   = gridspecfig.GridSpec(20, 20)
# Naive directionadd_subplot(211)        
axes2  [  Y= fig.add_subplot(212)    ,   X ]
axsa 

How to make figure with non-equal subplots

Code Block

axgr = fig.add_subplotaxes(gs[ 0.1:16,  0:14.64, 0.80, 0.35])
axsbaxhi = fig.add_subplotaxes(gs[ 0.1:16,  14:190.14, 0.35, 0.35])
axscaxti = fig.add_subplotaxes(gs[16:  ,  0:14[0.55, 0.14, 0.35, 0.35])

or even simplerusing grid:

Code Block
axgrimport = fig.add_axes([0.1,  0.64, 0.80, 0.35])
axhi = fig.add_axes([0.1,  0.14, 0.35, 0.35])
axtimatplotlib.gridspec as gridspec
gs   = gridspec.GridSpec(20, 20)
# Naive direction        [  Y   ,   X ]
axsa = fig.add_axessubplot(gs[0.55, 0.14, 0.35, 0.35] 1:16,  0:14])
axsb = fig.add_subplot(gs[ 1:16, 14:19])
axsc = fig.add_subplot(gs[16:  ,  0:14])

How to set axes limits

Code Block
    
axes.set_xlim((-50,50))
axes.set_ylim((-10,210))

How to draw line

Code Block
import matplotlib.lines  as lines
line = lines.Line2D(arrx, arry, linewidth=1, color='r')   
axes.add_artist(line)

...