jobar8 / graphics Goto Github PK
View Code? Open in Web Editor NEWCollection of functions for creating and manipulating graphics, colormaps and plots with Python and matplotlib.
Collection of functions for creating and manipulating graphics, colormaps and plots with Python and matplotlib.
Would you please consider licensing this project to an Open Software Initiative or Free Software Foundation approved license that fits the motivations of this project?
Personally, I think a CC0
License fits this project well but this is very much a decision for the original authors.
I'd like to use this.
Hi @jobar8
I am trying to use your (fantastic) graphics.py
, but I've been facing a strange behavior that I cannot explain or, worse, solve.
I tried imshow_hs
with 3 different data sets, but there is one that always crashes the code when hs=True
, i.e. shading is on.
At some point, I believed that it was a matplotlib
issue, so I started a Jupyter Notebook to do a bug report. Turns out that I don't know now the origin of the problem, so I thought to ask your help.
Below is the code that works with your dataset (mag4017) and then crashes with mine. Same input parameters.
Dataset that works โ mag4017
Dataset that does not work โ my_data
import numpy as np
import matplotlib.pyplot as plt
import graphics
data_good = np.load('mag4017.npy')
fig,ax = plt.subplots(figsize=(12,6))
graphics.imshow_hs(data_good,ax,cmap=plt.cm.gist_earth,cmap_norm='equalize',hs=True,zf=2,levels=32,colorbar=False,
cb_ticks='stats',nSigma=2,azdeg=45,altdeg=45,blend_mode='overlay',alpha=0.7,
extent=extent, origin='lower')
data_bad = np.load('my_data.npy')
fig,ax = plt.subplots(figsize=(12,6))
graphics.imshow_hs(data_bad,ax,cmap=plt.cm.gist_earth,cmap_norm='equalize',hs=True,zf=2,levels=32,colorbar=False,
cb_ticks='stats',nSigma=2,azdeg=45,altdeg=45,blend_mode='overlay',alpha=0.7,
extent=extent, origin='lower')
It doesn't matter if you choose blend_mode=alpha
or whatever.
In the file attached, there is a Jupyter Notebook that also shows a function that I did to try to "mimic" the problem, but it runs well where graphics.py
crashes.
To sum up, I am waaayyyyy lost!
I've been using your fantastic imshow_hs function. I recently upgraded to matplotlib2.0 and now when I run a script using imshow_hs it crashes python. I've reverted back to matplotlib 1.5.3 which fixes the problem. Have you tried this one matplotlib2.0?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.