Issue with ylim on property inspector Matlab 2018b

Has anyone else had problems using the YLIM setting under the "Ruler" tab in the 2018b property inspector? Whenever I plot a figure and adjust the limits on the y-axis it'll only allow me to use the initial auto setting it picks or interger values. When I try to set the lower or upper limit to anything but an interger I get the error "Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be Inf" in a pop-up window.

6 Comments

Can you attach a screenshot, and some simple code to make the graph?
Here is a screenshot of the error when I try to adjust the upper ylimit from 0.03 to 0.04. Interestingly enough, I can use ylim in the command window to adjust the limits without a problem. It just seems to be the property inspector gui that is the issue. The code for the plot is simply plot(t,x) where x is a function of t. The error happens anytime I try to adjust an arbitrary plot regardless of what is plotted.
CaptureError.PNG
Did you call the ylim() function in your code? Just after you plot this, if you put a breakpoint there and type ylim onto the command line, what does it say?
Since you won't share code, give me a little bit of time to create code to reproduce this. Expect some delay.
I'm not able to reproduce. When I click the property tool button and go to the rulers section, and type in something new for the ylim values, it works fine.
numPoints = 30;
t = linspace(1, 1.5, numPoints);
period = 0.2;
y = 0.025 * sin(2 * pi * t / period);
plot(t, y, 'b*-', 'LineWidth', 2);
grid on;
ylim([-0.03, 0.03]);
Hey have you tried to regenerate your prefdir?

Sign in to comment.

Answers (1)

I was having the same issue. It seems to be a bug in this version of Matlab. I restarted Matlab and the issue went away.

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Asked:

on 18 Nov 2018

Commented:

on 10 Oct 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!