1
votes

I am using plotyy() to plot both precipitation data (bar plot) and flow data (line plot). When I add both datasets as line plots, everything looks fine (top image, see link). When I add the precipitation data as a bar plot, it messes up the smoothness of the line plot (bottom image, see link). I do not have this issue with all of my datasets, but two are giving me this problem. I have tried loading the data from a different source and plotting the data individually. The bar plot always messes up my line plot. I cannot figure out what might be causing this. Any ideas? Thanks in advance!

Files for Minimum Example

Data

Matlab File

Click here to see figures

1
Can you try to create a minimal reproducible example, emphasis on minimum - Ander Biguri
Can you include the mat file with some test Date, Precip, M1, M2, M3 and M4 too? - MarcinKonowalczyk
I added a simplified MATLAB file and dataset for testing the problem. Thanks for your interest. - J. Eisma
When I was testing for a minimal example, I noticed that the issue only occurs once the 601st data point is added, regardless of its location within the dataset. - J. Eisma
I am unable to recreate the error in your example, even when I add data points - Brendan Frick

1 Answers

0
votes

I copied the figure and pasted it into a Word document. As ridiculous as this sounds, it looks perfectly normal in the Word document but is still messed up in the MATLAB figure window and in the .png I saved. The error is definitely caused by a bug. At least I know to try pasting the figure into Word first next time.

Thanks to everyone who read through my question and provided feedback.