MATLAB: How to troubleshoot if a plot line doesn’t show up on a figure

MATLAB: How to troubleshoot if a plot line doesn’t show up on a figure

plot

Due to the nature of the problem requiring a large sum of data, I can’t provide an example code beyond this.
plot([0 7],[meet4060 meet4060],’:k’)
Where meet4060=55.
It worked in the original code I was working on and it worked in a separate figure on its own, but it is not showing up in the recent code. When this happens, what should I be looking for to begin solving the trouble?

Best Answer

  • It plots a horizontal dotted line at 55 from 0 to 7.
    If it works independently, then there are several possibilities, some of which are that the plot limits are such that it is there, however is either too short to be seen clearly, or outside of the plot limits (xlim, ylim) entirely, or is being overplotted by something else.
    One option would be to plot it temporarily as:
    plot([0 7],[meet4060 meet4060],':k', 'LineWidth'10)
    to see if it becomes visible.
    We would need to see relevant parts of the current code to be certain.
  • Add a Comment

    Your email address will not be published. Required fields are marked *