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

Plot recipes for backwards timespans not working? #300

Closed
jlperla opened this issue May 27, 2018 · 2 comments
Closed

Plot recipes for backwards timespans not working? #300

jlperla opened this issue May 27, 2018 · 2 comments

Comments

@jlperla
Copy link

jlperla commented May 27, 2018

I don't think that plot recepies are working with backwards timespans. See the following code

using DifferentialEquations
function f(du,u,p,t)
    L = [1.0 0.0; 0.0 1.0]
    A_mul_B!(du,L,u)
end
tspan = (0.0, 1.0)
u_0 = [0.5; 1.0]
prob = ODEProblem(f, u_0, tspan)
sol = solve(prob)
using Plots
plot(sol)

That all works fine. Now go backwards

tspan = (1.0, 0.0)
u_T = [0.5; 1.0]
prob = ODEProblem(f, u_T, tspan)
sol = solve(prob)
using Plots
plot(sol)

It displays the right range and labels, but no data. Is there a workaround, or am I missing something?

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented May 28, 2018

Axis limits are off. It's plotting on [2.0,1.0] for some reason.

plot(sol,xlims=[0.0,1.0])

@ChrisRackauckas
Copy link
Member

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