Giter Club home page Giter Club logo

Comments (13)

mkborregaard avatar mkborregaard commented on May 22, 2024 2

The Plots syntax is yflip = true

from makie.jl.

ssfrr avatar ssfrr commented on May 22, 2024 1

I find that less clear - you have to know what the default is to understand what yflip will do

from makie.jl.

mkborregaard avatar mkborregaard commented on May 22, 2024

It's also a lot more general - it's not restricted to heatmaps, which is just another seriestype for plot, rather than some specific plotting function with bespoke arguments to learn. The y axis has the lowest value in the bottom on all plots, so there's nothing to remember. If you want the y axis to have the lowest value on top, you use yflip = true. It's also not restricted to the y axis, you can xflip and zflip as well (they of course also by default have the lowest values at the origin).

That's the key point of Plots and I believe a central component of its success: generality.

(That said it would be easy to have the flip keywords accept :origin_top and :origin_bottom arguments as well for those who'd like that - accepting both Bool and Symbol is a classic strategy in Plots for clarity)

from makie.jl.

ssfrr avatar ssfrr commented on May 22, 2024

Yeah, if the convention is that the origin is in the lower-left for everything than I can see how yflip is good and consistent. In that case the default for heatmap should be flipped from what it is now (the origin is currently in the top-left), and `yflip=true would flip it back, right?

from makie.jl.

mkborregaard avatar mkborregaard commented on May 22, 2024

Yes 👍

from makie.jl.

SimonDanisch avatar SimonDanisch commented on May 22, 2024

I'm planning to have each visual be accompanied by a rich transformation attribute - which will support padding, placement, flipping and maybe even arbitrary transformation functions, if I figure opengl transpilation out fast enough.
This will get implemented for all plotting types and it will be possible to inherit those from the parent scene (so that you can transform the whole scene).

from makie.jl.

mkborregaard avatar mkborregaard commented on May 22, 2024

That sounds awesome.

from makie.jl.

asinghvi17 avatar asinghvi17 commented on May 22, 2024

scale! should do this.

from makie.jl.

xaviergonzalez avatar xaviergonzalez commented on May 22, 2024

Wait so how do we actually flip the y-axis for a heatmap in Makie?

from makie.jl.

jkrumbiegel avatar jkrumbiegel commented on May 22, 2024

ax.yreversed = true

from makie.jl.

xaviergonzalez avatar xaviergonzalez commented on May 22, 2024

ax.yreversed = true

But what if I'm not using an ax atttribute, i.e. I'm just doing something like

CairoMakie.heatmap(mat, yflip=true)

This code produces the heatmap, just not with the y-axis flipped.

from makie.jl.

asinghvi17 avatar asinghvi17 commented on May 22, 2024

You would have to do CairoMakie.heatmap(mat, axis = (yflip=true,)).

from makie.jl.

jkrumbiegel avatar jkrumbiegel commented on May 22, 2024

It's yreversed if I'm not wrong

from makie.jl.

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.