<div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 25, 2018 at 2:19 PM Douglas Clowes <<a href="mailto:douglas.clowes@gmail.com">douglas.clowes@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>I had a program that seemed to work fine on Fedora 27 (matplotlib 2.0.0) but exhibits strange behaviour on Fedora 29 (matplotlib 2.2.3) and Rawhide (matplotlib 3.0.0). Behaviour is the same with either python 2 or 3.</div><div><br></div><div>The following "minimalist" program performs well where "y" is a list of floats and on 2.0.0 with either floats or strings. On later versions with strings:</div><div>* it plots a straight line</div><div>* has y-axis labels on every point</div><div>* has linear spacing of non-linear points on y-axis</div><div>* pressing "l" (lower-case L) yields a different scale and labels</div><div><br></div><div>With read data (not monotonic) it yields even stranger results.</div><div><br></div><div>Since it used to work, is it expected to work with strings or did I just get lucky?</div><div><br></div>#!/usr/bin/env python3<br>import csv<br>import sys<br>import matplotlib.pyplot as plt<br><br>x = range(11)<br>if "-s" in sys.argv:<br> y = [str(i*i) for i in x]<br> print("Strings")<br>else:<br> y = [i*i for i in x]<br> print("Floats")<br>plt.subplot(111)<br>plt.grid(True)<br>print("preplot")<br>plt.plot(x, y, "+-")<br>print("pretight")<br>plt.tight_layout()<br>print("presave")<br>plt.savefig("plot.svg")<br>print("preshow")<br>plt.show()<br></div></div>
</blockquote></div>