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] Scatter silently discards values from longer vector #4637

Closed
albheim opened this issue Jan 19, 2023 · 2 comments
Closed

[BUG] Scatter silently discards values from longer vector #4637

albheim opened this issue Jan 19, 2023 · 2 comments

Comments

@albheim
Copy link

albheim commented Jan 19, 2023

Details

The behaviour of scatter and plot when sending different length arguments differ. Scatter will silently discard the remaining elements from the longer vector, while plot will error.
Scatter will also scale the plot based on the all the elements, even the ones that aren't shown.

julia> scatter(1:5, 1:8) # 1-5 is plotted, but y is scaled 1-8
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

julia> plot(1:5, 1:8)
Error showing value of type Plots.Plot{Plots.GRBackend}:
ERROR: BoundsError: attempt to access 5-element UnitRange{Int64} at index [1:8]

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: v1.38.2
Backend version (]st -m <backend(s)>): GR v0.71.3
Output of versioninfo():

Julia Version 1.9.0-beta3
Commit 24204a73447 (2023-01-18 07:20 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores
@albheim albheim added the bug label Jan 19, 2023
@albheim albheim changed the title [BUG] [BUG] Scatter silently discards values from longer vector Jan 19, 2023
@BeastyBlacksmith
Copy link
Member

duplicate of #2980

@albheim
Copy link
Author

albheim commented Jan 27, 2023

Yeah, lazy by me to not check. Sorry for the noise!

@albheim albheim closed this as completed Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants