¡@

Home 

python Programming Glossary: ax2

How to add a second x-axis in matplotlib

http://stackoverflow.com/questions/10514315/how-to-add-a-second-x-axis-in-matplotlib

as plt fig plt.figure ax1 fig.add_subplot 111 ax2 ax1.twiny X np.linspace 0 1 1000 Y np.cos X 20 ax1.plot X Y.. .5 .9 def tick_function X V 1 1 X return .3f z for z in V ax2.set_xticks new_tick_locations ax2.set_xticklabels tick_function.. return .3f z for z in V ax2.set_xticks new_tick_locations ax2.set_xticklabels tick_function new_tick_locations ax2.set_xlabel..

2D and 3D Scatter Histograms from arrays in Python

http://stackoverflow.com/questions/14002480/2d-and-3d-scatter-histograms-from-arrays-in-python

import Axes3D ax1 np.histogram2d x_data y_data bins bins ax2 np.histogram2d x_data z_data bins bins ax3 np.histogram2d z_data.. ax1 0 if v1 0 continue for k2 v2 in enumerate ax2 0 i1 v3 ax3 0 k2 j1 if v1 0 or v2 0 or v3 0 continue num min..

matplotlib: combine different figures and put them in a single subplot sharing a common legend

http://stackoverflow.com/questions/16748577/matplotlib-combine-different-figures-and-put-them-in-a-single-subplot-sharing-a

label 'mode 01' # mode 01 from other case fig2 plt.figure ax2 fig2.add_subplot 111 ax2.plot x y2 label 'mode 01' EDIT the.. from other case fig2 plt.figure ax2 fig2.add_subplot 111 ax2.plot x y2 label 'mode 01' EDIT the method suggested by @nordev.. Now it would be really convenient to pass the ax1 and ax2 objects to the new figure since they have much more information...

plotting results of hierarchical clustering ontop of a matrix of data in python

http://stackoverflow.com/questions/2982929/plotting-results-of-hierarchical-clustering-ontop-of-a-matrix-of-data-in-python

ax1.set_yticks # Compute and plot second dendrogram. ax2 fig.add_axes 0.3 0.71 0.6 0.2 Y sch.linkage D method 'single'.. 0.2 Y sch.linkage D method 'single' Z2 sch.dendrogram Y ax2.set_xticks ax2.set_yticks # Plot distance matrix. axmatrix fig.add_axes.. D method 'single' Z2 sch.dendrogram Y ax2.set_xticks ax2.set_yticks # Plot distance matrix. axmatrix fig.add_axes 0.3..

fitting exponential decay with no initial guessing

http://stackoverflow.com/questions/3938042/fitting-exponential-decay-with-no-initial-guessing

num 0.5 fig plt.figure ax1 fig.add_subplot 2 1 1 ax2 fig.add_subplot 2 1 2 # Non linear Fit A K C fit_exp_nonlinear.. A K fit_exp_linear t y C0 fit_y model_func t A K C0 plot ax2 t y noisy_y fit_y A0 K0 C0 A K 0 ax2.set_title 'Linear Fit'.. t A K C0 plot ax2 t y noisy_y fit_y A0 K0 C0 A K 0 ax2.set_title 'Linear Fit' plt.show def model_func t A K C return..

How can I improve my paw detection?

http://stackoverflow.com/questions/4087919/how-can-i-improve-my-paw-detection

2 1 1 annotate_paw_prints time data data_slices ax ax1 ax2 fig.add_subplot 2 1 2 plot_paw_impacts time data_slices ax ax2.. fig.add_subplot 2 1 2 plot_paw_impacts time data_slices ax ax2 fig.suptitle infile def plot_paw_impacts time data_slices ax..

Secondary axis with twinx(): how to add to legend?

http://stackoverflow.com/questions/5484922/secondary-axis-with-twinx-how-to-add-to-legend

Swdown ' ' label 'Swdown' ax.plot time Rn ' ' label 'Rn' ax2 ax.twinx ax2.plot time temp ' r' label 'temp' ax.legend loc.. label 'Swdown' ax.plot time Rn ' ' label 'Rn' ax2 ax.twinx ax2.plot time temp ' r' label 'temp' ax.legend loc 0 ax.grid ax.set_xlabel.. Time h ax.set_ylabel r Radiation MJ m^ 2 d^ 1 ax2.set_ylabel r Temperature ^ circ C ax2.set_ylim 0 35 ax.set_ylim..

Python/Matplotlib - Is there a way to make a discontinuous axis?

http://stackoverflow.com/questions/5656798/python-matplotlib-is-there-a-way-to-make-a-discontinuous-axis

same spacing. x np.r_ 0 1 0.1 9 10 0.1 y np.sin x fig ax ax2 plt.subplots 1 2 sharey True # plot the same data on both axes.. True # plot the same data on both axes ax.plot x y 'bo' ax2.plot x y 'bo' # zoom in limit the view to different portions.. portions of the data ax.set_xlim 0 1 # most of the data ax2.set_xlim 9 10 # outliers only # hide the spines between ax and..

Matplotlib overlapping annotations

http://stackoverflow.com/questions/8850142/matplotlib-overlapping-annotations

random_integers 10 50 100 #GOOD PLOT fig2 plt.figure ax2 fig2.add_subplot 111 ax2.bar x_data y_data width 0.00001 #set.. 50 100 #GOOD PLOT fig2 plt.figure ax2 fig2.add_subplot 111 ax2.bar x_data y_data width 0.00001 #set the bbox for the text... txt_height text_plotter x_data y_data text_positions ax2 txt_width txt_height plt.ylim 0 max text_positions 2 txt_height..

why is plotting with Matplotlib so slow?

http://stackoverflow.com/questions/8955869/why-is-plotting-with-matplotlib-so-slow

import import time ion fig figure ax1 fig.add_subplot 611 ax2 fig.add_subplot 612 ax3 fig.add_subplot 613 ax4 fig.add_subplot.. x arange 0 2 pi 0.01 y sin x line1 ax1.plot x y 'r ' line2 ax2.plot x y 'g ' line3 ax3.plot x y 'y ' line4 ax4.plot x y 'm..