Auxiliary function to format legend Usage ===== axv : numpy 1d array Flattened array of axes index : int Index of the axis where to place the legend
(axv,index)
| 1840 | |
| 1841 | |
| 1842 | def _format_legend(axv,index): |
| 1843 | """ |
| 1844 | Auxiliary function to format legend |
| 1845 | |
| 1846 | Usage |
| 1847 | ===== |
| 1848 | axv : numpy 1d array |
| 1849 | Flattened array of axes |
| 1850 | index : int |
| 1851 | Index of the axis where to place the legend |
| 1852 | """ |
| 1853 | all_handles = [] |
| 1854 | all_labels = [] |
| 1855 | # Check each axes and add new handle |
| 1856 | for axi in axv: |
| 1857 | handles, labels = axi.get_legend_handles_labels() |
| 1858 | for handle,label in zip(handles,labels): |
| 1859 | if not label in all_labels: |
| 1860 | all_labels.append(label) |
| 1861 | all_handles.append(handle) |
| 1862 | |
| 1863 | leg = axv[index].legend(all_handles,all_labels,loc='upper left',bbox_to_anchor=(1.05,1.0),fontsize=16) |
| 1864 | return leg |
| 1865 | |
| 1866 | |
| 1867 | def _format_time_axis(fig,ax, |
no outgoing calls
no test coverage detected