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

xtick odd behavior #1751

Closed
iwelch opened this issue Sep 17, 2018 · 2 comments
Closed

xtick odd behavior #1751

iwelch opened this issue Sep 17, 2018 · 2 comments

Comments

@iwelch
Copy link

iwelch commented Sep 17, 2018

using Plots; x=1 : 0.1 : 10; Y=[ sin.(x), cos.(x) ];
xloc= [3,5,7]; xlab= ["three", "five", "seven"];
plot( x, Y, xticks= (xloc,xlab) )

works as expected. BUT

plot!( x, Y, xticks= (3.0, "three") )

I am guessing that the three is interpreted as a character array, so only the 't' is put on the axis. It seems odd. not expected naively.

@tucker-chambers
Copy link

tucker-chambers commented Oct 4, 2018

Was able to reproduce. But bracketing the xticks() arguments as below seems to fix just fine.

plot!( x, Y, xticks= ([3.0],["three"]) )

@mkborregaard
Copy link
Member

Yes, it's not really an issue IMHO. I think this is unexpected for users from eg R and matlab where no distinction is made between scalar and vector arguments.

@t-bltg t-bltg closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants