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

Plotly backend: surface(X,Y,Z) has x-axis in wrong direction #872

Closed
dlfivefifty opened this issue May 28, 2017 · 12 comments
Closed

Plotly backend: surface(X,Y,Z) has x-axis in wrong direction #872

dlfivefifty opened this issue May 28, 2017 · 12 comments
Labels
enhancement improving existing functionality GR

Comments

@dlfivefifty
Copy link
Contributor

pyplot()
X=linspace(0.,1.,40).*ones(40)'
T=ones(40)*linspace(0.,1.,40)'
Y=T.*(1.-X)
Z = X
surface(X,Y,Z)

looks fine, while

plotly()
surface(X,Y,Z)

has the x-axis in the wrong direction, see attachment.

Untitled2.pdf

@mkborregaard
Copy link
Member

mkborregaard commented May 29, 2017

The input args X and Y in Plots are not mesh-grids / matrices; just Vectors. Do you mean something like

X=linspace(0.,1.,40)
Y = X .* (1-X)
Z = X .* ones(40)'
surface(X, Y, Z)

?

@dlfivefifty
Copy link
Contributor Author

dlfivefifty commented May 29, 2017 via email

@mkborregaard
Copy link
Member

Interesting. AFAIK this is undefined behaviour that just happens to work in pyplot, @tbreloff most likely knows this. If it's a small fix to get it working in plotly too that's definitely worth looking into.

@mkborregaard mkborregaard added the enhancement improving existing functionality label May 29, 2017
@dlfivefifty
Copy link
Contributor Author

@tbreloff added this behaviour after I requested it: #96

@mkborregaard
Copy link
Member

mkborregaard commented May 29, 2017

Ah! Thanks for pointer, and this

It will likely only work with PyPlot

also explains the current issue. I'll add it to the list of desirable enhancements for the other backends as well.

@dlfivefifty
Copy link
Contributor Author

dlfivefifty commented May 29, 2017 via email

@mkborregaard
Copy link
Member

Perhaps, I'm not sure. The pyplot functionality was added in ed7cc9b , it doesn't look awfully complicated.

@mkborregaard
Copy link
Member

mkborregaard commented May 29, 2017

Looks like it was added to plotly in response to #479 , there is a nice example of plotting on a sphere. I guess on a sphere noone'd notice if the x axis was off. I wonder if this is the cause of this issue as well: #643

@mkborregaard
Copy link
Member

This turned out to be a very long goose chase. You're just not viewing the planes from the same angle. Using your code:

Your first screenshot
skaermbillede 2017-05-29 kl 10 53 49
skaermbillede 2017-05-29 kl 10 53 57

Your second screenshot
skaermbillede 2017-05-29 kl 10 52 59
skaermbillede 2017-05-29 kl 10 53 08

I've had it with Plots issues for a few days now.

@mkborregaard
Copy link
Member

I have opened a new issue with an appropriate name and am closing this #875.

@dlfivefifty
Copy link
Contributor Author

OK, I think there is an issue here but it's not what I said: it's the plotly is putting the y-coordinate axis in the "wrong" direction:

x = linspace(-3.,3.,100)
y = linspace(0,3.,101)
surface(x,y,x' .+ y)  # axes are not consistent with gr()

@dlfivefifty
Copy link
Contributor Author

Ah I'm being stupid: it's just a different vantage point, like you said.

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

No branches or pull requests

2 participants