GithubHelp home page GithubHelp logo

Comments (2)

jarthurgross avatar jarthurgross commented on June 16, 2024

The error is being thrown because the way norm is being called in this example causes it to set its vmin and vmax to the same value (11). This causes it to return NaN since there are divisions by vmax - vmin when called on data, which is what the error is all about.

In color_boxplot, norm is called on a set of data rather than a single point, so unless the data are identical a different vmin and vmax are set and you don't get this error. In your example, you can also manually set vmin and vmax when you define norm

linlog_trans = 11
vmin = 0
vmax = 20
norm = pygsti.report.plotting.LinLogNorm(vmin=vmin, vmax=vmax, trans=linlog_trans)

and you won't experience any errors.

For our purposes, the defaults of splice_cmap are set up so you shouldn't have to mess with them. LinLogNorm is designed to linearly map all values below trans to the interval [0, 0.5], and logarithmically map all values above trans to the interval [0.5, 1]. This means that when you have vmin and vmax set sensibly, norm(linlog_trans) will always be 0.5. splice_cmaps is set to default to assigning the different cmaps to equal intervals, so when joining two cmaps the transition from one to the other will occur at 0.5, matching the behavior of LinLogNorm.

from pygsti.

Travis-S avatar Travis-S commented on June 16, 2024

This makes sense, and for now, we should rely on this default behavior. In the future, if we mess around more with the colormaps, we may need to revisit this.

Closing the issue for now.

from pygsti.

Related Issues (20)

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.