python Programming Glossary: plt.figure
How to add a second x-axis in matplotlib http://stackoverflow.com/questions/10514315/how-to-add-a-second-x-axis-in-matplotlib import numpy as np import matplotlib.pyplot as plt fig plt.figure ax1 fig.add_subplot 111 ax2 ax1.twiny X np.linspace 0 1 1000..
Python/matplotlib : plotting a 3d cube, a sphere and a vector? http://stackoverflow.com/questions/11140163/python-matplotlib-plotting-a-3d-cube-a-sphere-and-a-vector numpy as np from itertools import product combinations fig plt.figure ax fig.gca projection '3d' ax.set_aspect equal #draw cube r..
How do I convert (or scale) axis values and redefine the tick frequency in matplotlib? http://stackoverflow.com/questions/1143848/how-do-i-convert-or-scale-axis-values-and-redefine-the-tick-frequency-in-matpl 'figure.dpi' figsize thumb.size 0 dpi thumb.size 1 dpi fig plt.figure figsize figsize plt.imshow thumb origin 'lower' aspect 'equal'..
real-time plotting in while loop with matplotlib http://stackoverflow.com/questions/11874767/real-time-plotting-in-while-loop-with-matplotlib I've isolated the problem into this simple example fig plt.figure plt.axis 0 1000 0 1 i 0 x list y list while i 1000 temp_y np.random.random..
pylab.ion() in python 2, matplotlib 1.1.1 and updating of the plot while the program runs http://stackoverflow.com/questions/12822762/pylab-ion-in-python-2-matplotlib-1-1-1-and-updating-of-the-plot-while-the-pro import random import matplotlib.pyplot as plt dat 0 1 fig plt.figure ax fig.add_subplot 111 Ln ax.plot dat ax.set_xlim 0 20 plt.ion..
How to draw diagrams like this? http://stackoverflow.com/questions/14824893/how-to-draw-diagrams-like-this import matplotlib.pyplot as plt import numpy as np fig plt.figure ax fig.add_subplot 111 projection '3d' dim 10 X Y np.meshgrid..
How can I plot NaN values as a special color with imshow in matplotlib? http://stackoverflow.com/questions/2578752/how-can-i-plot-nan-values-as-a-special-color-with-imshow-in-matplotlib import numpy as np import matplotlib.pyplot as plt f plt.figure ax f.add_subplot 111 a np.arange 25 .reshape 5 5 .astype float..
Set Colorbar Range in matplotlib http://stackoverflow.com/questions/3373256/set-colorbar-range-in-matplotlib f data cmap cm vmin 4 vmax 4 plt.title title plt.colorbar plt.figure do_plot 1 lambda x x all do_plot 2 lambda x np.clip x 4 0 0..
How can I improve my paw detection? http://stackoverflow.com/questions/4087919/how-can-i-improve-my-paw-detection matplotlib we need # ion instead of show ... plt.ion fig plt.figure ax fig.add_subplot 111 fig.suptitle input_filename # Make an.. dat_slice 2 .start # Plot up a simple analysis fig plt.figure ax1 fig.add_subplot 2 1 1 annotate_paw_prints time data data_slices..
matplotlib Update a Plot http://stackoverflow.com/questions/4098131/matplotlib-update-a-plot you're embedding things in a tkinter plot... plt.ion fig plt.figure ax fig.add_subplot 111 line1 ax.plot x y 'r ' # Returns a tuple..
Is there a matplotlib equivalent of MATLAB's datacursormode? http://stackoverflow.com/questions/4652439/is-there-a-matplotlib-equivalent-of-matlabs-datacursormode self.annotation.set_visible True event.canvas.draw fig plt.figure line plt.plot range 10 'ro ' fig.canvas.mpl_connect 'pick_event'.. tiny bit at least . Basically you'd use it similar to this plt.figure plt.subplot 2 1 1 line1 plt.plot range 10 'ro ' plt.subplot.. if __name__ '__main__' import matplotlib.pyplot as plt plt.figure plt.subplot 2 1 1 line1 plt.plot range 10 'ro ' plt.subplot..
Secondary axis with twinx(): how to add to legend? http://stackoverflow.com/questions/5484922/secondary-axis-with-twinx-how-to-add-to-legend matplotlib import rc rc 'mathtext' default 'regular' fig plt.figure ax fig.add_subplot 111 ax.plot time Swdown ' ' label 'Swdown'.. 10 100 10 Rn np.random.random 10 100 10 fig plt.figure ax fig.add_subplot 111 lns1 ax.plot time Swdown ' ' label 'Swdown'..
Creating graph with date and time in axis labels with matplotlib http://stackoverflow.com/questions/5498510/creating-graph-with-date-and-time-in-axis-labels-with-matplotlib date format object hfmt dates.DateFormatter ' m d H M' fig plt.figure ax fig.add_subplot 111 ax.vlines fds y2 y1 ax.xaxis.set_major_locator..
Can i cycle through line styles in matplotlib http://stackoverflow.com/questions/7799156/can-i-cycle-through-line-styles-in-matplotlib from itertools import cycle lines . linecycler cycle lines plt.figure for i in range 10 x range i i 10 plt.plot range 10 x next linecycler..
Using Colormaps to set color of line in matplotlib http://stackoverflow.com/questions/8931268/using-colormaps-to-set-color-of-line-in-matplotlib text strings. Each of the arrays have the same length. fig plt.figure ax fig.add_subplot 111 jet colors.Colormap 'jet' cNorm colors.Normalize.. 20 for i in range NCURVES values range NCURVES fig plt.figure ax fig.add_subplot 111 # replace the next line #jet colors.Colormap..
|