Skip to content

Instantly share code, notes, and snippets.

View arnaldorusso's full-sized avatar

Arnaldo Russo arnaldorusso

View GitHub Profile
# -*- coding: utf-8 -*-
# -*- mode: python -*-
# Adapted from mpl_toolkits.axes_grid2
# LICENSE: Python Software Foundation (http://docs.python.org/license.html)
from matplotlib.offsetbox import AnchoredOffsetbox
class AnchoredScaleBar(AnchoredOffsetbox):
def __init__(self, transform, sizex=0, sizey=0, labelx=None, labely=None, loc=4,
pad=0.1, borderpad=0.1, sep=2, prop=None, **kwargs):
"""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# -*- coding: utf-8 -*-
# -*- mode: python -*-
# Adapted from mpl_toolkits.axes_grid2
# LICENSE: Python Software Foundation (http://docs.python.org/license.html)
from matplotlib.offsetbox import AnchoredOffsetbox
class AnchoredScaleBar(AnchoredOffsetbox):
def __init__(self, transform, size=0, label=None, horizontal = True, style = 'dark', loc=4,
pad=0.1, borderpad=0.1, sep=2, prop=None, **kwargs):
"""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# script to merge several individual Tiffs (bands) into one multiband GeoTiff
# and potentially do calculations like NDVI, albedo, etc...
# from: http://archive.publiclaboratory.org/peru/2011-01-18-lima-peru-morflex/misc/NDVI.py
# import the GDAL and numpy libraries
from osgeo import gdal
from numpy import *
# ***************************************************************
# ok lets load in the first 4 bands of Landsat imagery into their own numpy arrays
@arnaldorusso
arnaldorusso / Help_arial_seaborn_tex.py
Created January 20, 2015 15:54
Help Arial font Seaborn using Tex
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
import seaborn as sns
# This line is a patch to Seaborn deal with mpl last version.
# sns.set_context(rc={'lines.markeredgewidth': 0.1}) # deal with mpl markers
xs = np.arange(200)
@arnaldorusso
arnaldorusso / table_mpl_Arial.py
Last active August 29, 2015 14:14
Render table inside figure area
############################################################
## Fig 1
## Latex is ploting wrong font but including \hline on table
############################################################
import matplotlib.pyplot as plt
import matplotlib as mpl
simple_latex = {
"text.latex.unicode" : True,

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

On master:

> git co -b temp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.