Plots.jl: yflip breaks xlink?

Created on 22 Feb 2018  路  5Comments  路  Source: JuliaPlots/Plots.jl

Tested with GR and Plotly.

This:

p1 = spy(randn(100,100), legend=false)

p2 = plot(randn(50))

plot(p1, p2, xlink=true, layout=(2,1))

Produces this:
screen shot 2018-02-22 at 7 20 37 am

  • If you replace spy with heatmap, all is well.
  • If you add yflip=true to heatmap, I get the above behavior. I haven't had time to dig deeper yet, but it looks like yflip is the culprit.
  • Similar behavior to above also occurs with xflip = true, but breaking something is to be expected there.

Most helpful comment

I'm not sure I follow. Do you mean plot(p1, p2, xlink=true, layout=(2,1)) should natively give a plot with a big square spy subplot above a smaller (not as high) line plot?

All 5 comments

I think the issue is that the spy recipe sets aspect_ratio := 1
We could replace that with aspect_ratio --> 1 and then you could do plot(p1, p2, xlink=true, layout=(2,1), aspect_ratio = :auto), which should give the same as replacing spy with heatmap and adding yflip = true in your code.
EDIT: plot(p1, p2, xlink=true, layout=(2,1), aspect_ratio = :none)

In principle, I guess aspect_ratio shouldn't break xlink?

I'm not sure I follow. Do you mean plot(p1, p2, xlink=true, layout=(2,1)) should natively give a plot with a big square spy subplot above a smaller (not as high) line plot?

Yes, don't you?

That would be the nicest default behaviour, but that's probably not that easy to achieve. I've never really looked that much into the layout code ...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tbenst picture tbenst  路  3Comments

cortner picture cortner  路  4Comments

ereday picture ereday  路  3Comments

mkborregaard picture mkborregaard  路  3Comments

Cody-G picture Cody-G  路  4Comments