Diagonal Line appearing in plot

I am using MATLAB R2016b on Windows10. Whenever I use (1)there appears a a diagonal line in the plot. I have already tried using the code (2)(to deal with the issue) mentioned in some other similar post but its not addressing the issue. Can somebody suggest a solution?
(1)
x = linspace(0,12);
y = linspace(0,12);
plot(x,y);
(2)
set(gcf, 'Renderer', 'painters')
set(gcf, 'Renderer', 'opengl')
opengl software

Antworten (1)

Image Analyst
Image Analyst am 7 Dez. 2017
Bearbeitet: Image Analyst am 20 Aug. 2021

0 Stimmen

I don't understand. So you make 100 points where x equals y exactly, and then plot them with
x = linspace(0,12);
y = linspace(0,12);
plot(x,y);
and you're surprised that you get a line where x=y. Why? What do you think it should look like? What else are you expecting other than a straight line at 45 degrees?

6 Kommentare

FC
FC am 23 Sep. 2018
What an incredibly rude response.
jonas
jonas am 23 Sep. 2018
In his defence, the question is incredibly senseless
Matt J
Matt J am 23 Sep. 2018
I am puzzled as well.
Raymundo del Campo Castro
Raymundo del Campo Castro am 1 Jun. 2020
this guy always answers very sarcastic, you must have really serious personal issues, maths are like your safe place, you are a shame to this comunity
Jacob Alappatt
Jacob Alappatt am 20 Aug. 2021
Yeah I was going to say the same. People use this forum to learn, not receive condescending answers. Ignore it if you think they can google an answer themselves, don't let 'MVP' get to you.
Image Analyst
Image Analyst am 20 Aug. 2021
Bearbeitet: Image Analyst am 20 Aug. 2021
Others in this thread were also just as confused as I was at the initial question - it's not just me (click the link above to show the older comments).
You can literally find over 33 thousand posts where I've helped people. Often they're appreciative as you can easily verify, for example this link
for just one of many, many such replies.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Graphics Performance finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 7 Dez. 2017

Bearbeitet:

am 20 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by