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

Column vs. row vector #29

Closed
1oly opened this issue Jan 5, 2014 · 2 comments
Closed

Column vs. row vector #29

1oly opened this issue Jan 5, 2014 · 2 comments

Comments

@1oly
Copy link

1oly commented Jan 5, 2014

Hi there,
It seems that I get an empty plot when I try to plot row vectors. Do others see this behavior or is it maybe on purpose?

: Produce correct plot:
x = [1.0:10.0];
y = x.*x;
plot(x,y)

: Produce empty plot:
x = [1.0:10.0]';
y = x.*x;
plot(x,y)

Versioninfo:
Julia Version 0.2.0
Commit 05c6461 (2013-11-16 23:44 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin12.5.0)
WORD_SIZE: 64
BLAS: libgfortblas
LAPACK: liblapack
LIBM: libopenlibm

I'm using PyPlot 1.0.12+ (master)

Best,
Oliver

@stevengj
Copy link
Member

stevengj commented Jan 5, 2014

Matplotlib treats each column of the data as a separate data series. So, if you give it row vectors, it is treated as a set of single-point datasets. For example, compare the output of

plot([1,2,3], [1,4,9], "o-")

with

plot([1,2,3]', [1,4,9]', "o-")

@stevengj stevengj closed this as completed Jan 5, 2014
@1oly
Copy link
Author

1oly commented Jan 6, 2014

Thanks Steven!

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

2 participants