From 82456d06f95ec7c99026f09401e1c2864040baf3 Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Wed, 10 Apr 2024 10:16:30 +0200 Subject: [PATCH] Make better use of xlim --- src/ControlPlots.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ControlPlots.jl b/src/ControlPlots.jl index 1a8a614..7374c7b 100644 --- a/src/ControlPlots.jl +++ b/src/ControlPlots.jl @@ -71,7 +71,8 @@ function plot(X, Y::AbstractVector{<:Number}; xlabel="", ylabel="", fig="", disp if xlabel != "" plt.xlabel(xlabel, fontsize=14); end - plt.ylabel(ylabel, fontsize=14); + plt.ylabel(ylabel, fontsize=14); + plt.xlim(X[begin], X[end]) plt.grid(true) plt.tight_layout() end @@ -100,7 +101,7 @@ function plotx(X, Y...; xlabel="time [s]", ylabels=nothing, fig="", title="", di lbl="" end plt.plot(X, y, label=lbl) - plt.xlim(0, X[end]) + plt.xlim(X[begin], X[end]) plt.ylabel(lbl, fontsize=14); plt.grid(true) if i < len