Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] twinx() bugs #4987

Open
co1emi11er2 opened this issue Sep 11, 2024 · 0 comments
Open

[BUG] twinx() bugs #4987

co1emi11er2 opened this issue Sep 11, 2024 · 0 comments
Labels

Comments

@co1emi11er2
Copy link

Details

Issue 1

Unitful integration works great but not with twinx().

I originally tried it with different units along the y axis. However, it does not work with the same units either. It would be great if different units along the y worked as well. Here is a mwe you can try:

using Unitful, Plots
const ft = u"ft"
plot([1, 2, 3, 4]ft, [10, 20, 30, 40]ft)
plot!(twinx(), [1, 2, 3, 4]ft, [1000, 2000, 3000, 4000]ft; right_y=true)

Issue 2

The other issue I came across was when putting twinx() plots with one needing aspect_ratio set to equal and the other not set. Here is a plot where it happens to work out and the ratios align.
image

However, if I have ratios that conflict, the two plots do not align properly anymore. You can see the red and blue plot now goes outside it's x_values that were correct in the first plot.
image

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pythonplot x
plotlyjs x
pgfplotsx x
unicodeplots x
inspectdr x
gaston x

Versions

Plots.jl version: 1.40.8
Backend version (]st -m <backend(s)>):
Output of versioninfo():
Julia Version 1.10.5
Commit 6f3fdf7b36 (2024-08-27 14:19 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 16 × 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant