Skip to content

Instantly share code, notes, and snippets.

@gazzar
gazzar / rebin.py
Created April 9, 2014 08:22 — forked from zonca/rebin.py
import numpy as np
def rebin(a, new_shape):
"""
Resizes a 2d array by averaging or repeating elements,
new dimensions must be integral factors of original dimensions
Parameters
----------
a : array_like
@gazzar
gazzar / cubehelix_colormap.ipynb
Last active August 29, 2015 14:00
IPython notebook demonstrating the cubehelix colormap in matplotlib
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gazzar
gazzar / mpl_colormaps
Last active August 29, 2015 14:00
Playing with Colo(u)rmaps
This file has been truncated, but you can view the full file.
{
"metadata": {
"name": "",
"signature": "sha256:c94d0761ba047cfd77267c1d2e8b1d694c8fb3c18b19f8007e5c90777da3bfd5"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@gazzar
gazzar / mpl_colormaps-gpl
Created April 30, 2014 05:06
Geissbuehler & Lasser colourblind-friendly colourmaps
{
"metadata": {
"name": "",
"signature": "sha256:7c13bb28fce5c55dc995a8b5578f104452c534755021b94f1727f67984199872"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@gazzar
gazzar / Abundances_Human_wordcloud
Created November 10, 2014 23:23
Detectable elemental abundance in human by mass with rev C Maia
{
"metadata": {
"name": "",
"signature": "sha256:0a60a5b27e96dc522f5afeefd5a64d68ccbba9a8de9cbbde76fc531a18120e2f"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@gazzar
gazzar / fitpack.pyf
Created September 12, 2012 00:08
Python f2py wrapper for interpolating tensioned splines Fortran routines in Alan K Cline's fitpack avalaible from netlib.org
! -*- f90 -*-
! f2py wrapper for interpolating tensioned splines
! This file was auto-generated with f2py (version:2).
! See http://cens.ioc.ee/projects/f2py2e/
! Modified by Gary Ruben 2012-09-03
! This wraps the curv1() and curv2() functions in Alan K Cline's fitpack http://www.netlib.org/fitpack
! Also requires the fitpack functions ceez(), intrvl(), snhcsh(), and terms().
! fitpack.f contains both high and low precision versions of snhcsh(). I used the higher precision version.
! The low precision version in fitpack.f must be commented out prior to running f2py as follows to create the wrapper:
! f2py -c fitpack.pyf fitpack.f
@gazzar
gazzar / arrayplotter.py
Created October 17, 2012 05:13
Chaco FunctionImageData test
#!/usr/bin/env python
"""
Demonstrates use of the FunctionImageData that depends on an external range
and returns different data depending on that range.
"""
# Major library imports
from numpy import pi, linspace, meshgrid, sin
# Enthought library imports
@gazzar
gazzar / barchart.ipynb
Created November 14, 2012 06:07
barchart.ipynb ipython notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gazzar
gazzar / pies.ipynb
Created November 14, 2012 06:37
Another pie chart/wind rose thingy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gazzar
gazzar / app.py
Created December 6, 2012 06:52
Code attempting to update icons on TreeEditor nodes in a TraitsUI TreeEditor
import os
#from traits.etsconfig.api import ETSConfig
#ETSConfig.toolkit = 'qt4'
import numpy as np
from enable.api import ComponentEditor
from traits.api import Str, Bool, Enum, List, Dict, Any, \
HasTraits, Instance, Button, on_trait_change
from traitsui.api import View, Group, HGroup, VGroup, HSplit, \
Item, UItem, TreeEditor, TreeNode, TreeNodeObject, Menu
from traitsui.key_bindings import KeyBinding, KeyBindings