Git Product home page Git Product logo

graphics's People

Contributors

jobar8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

graphics's Issues

lightsource shade bug

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!

shade bug report.zip

imshow_hs crashes with matplotlib2.0

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.