matlab plot rendering problem

3 visualizzazioni (ultimi 30 giorni)
peter huang
peter huang il 3 Set 2022
Risposto: dpb il 3 Set 2022
Suppose my data has very low discreteness, as given in the attached file
y2_max is x
st20_1 and trend_parabolic are y
I would like to ask how can I draw to increase the contrast between the two Let viewers see the difference
clear all;
clc
clf
load y2_max.mat
load St20_1.mat
load trend_parabolic.mat
plot(y2_max , St20_1)
hold on
plot(y2_max , trend_parabolic)

Risposta accettata

dpb
dpb il 3 Set 2022
load https://www.mathworks.com/matlabcentral/answers/uploaded_files/1115780/y2_max.mat
Error using load
Unable to read file 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1115780/y2_max.mat'. If it is a Version 7 or earlier MAT-file, consider saving your data afresh in Version 7.3
MAT-files to access it from a remote location.
I dunno whassup w/ this last couple days -- too much grief download that many files; please combine them all into one .mat file and also use the -v7.3 switch so folks can read it here.
That aside, a couple suggestions of what you could do although your data are such that the quadratic fits very well so the overlaying of the fit versus the data is going to be present no matter what you do.
One alternative presentation might be
plot(y2_max,St20_1,'x') % plot the data itself as points only, no line
hold on
plot(y2_max,trend_parabolic) % then add the fitted line
yyaxis right % and subsequently, add the residual on RH axis
resid=max,St20_1-trend_parabolic; % residuals/differences
plot(y2_max,resid) % then add the fitted line
Salt to suit...

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by