These are chat archives for sandialabs/toyplot

14th
Jul 2015
Timothy M. Shead
@tshead
Jul 14 2015 03:35
Gang: Toyplot 0.6.0 has been released! See all the gory details at http://toyplot.readthedocs.org/en/latest/release-notes.html
Gordon Fleetwood
@gfleetwood
Jul 14 2015 06:33

Hi,

I ran into a problem with mutiple plots. Here's the meat of my code:

x = np.linspace(1,100,100)
y1 = x**2*np.log10(x)
y2 = 2**x
y3 = 2**(2**x)
y4 = x**(np.log10(x))
y5 = x**2

axes = toyplot.Canvas(width=300,height=300).axes()
mark = axes.plot(x,y1,style={"stroke":"blue"})
mark = axes.plot(x,y2,style={"stroke":"red"})
mark = axes.plot(x,y3,style={"stroke":"yellow"})
mark = axes.plot(x,y4,style={"stroke":"black"})
mark = axes.plot(x,y5,style={"stroke":"green"})

The image produced was terrible. Did I miss something?

Maciek
@maciejgryka
Jul 14 2015 11:02
@tshead: sweet! :thumbsup: for py3 and tick locators especially :)
Maciek
@maciejgryka
Jul 14 2015 15:32
@gfleetwood: try axes = toyplot.Canvas(width=300,height=300).axes(yscale='log')
your yellow and red will still have too many tick labels - you'll probably need to modify them http://toyplot.readthedocs.org/en/latest/tick-locators.html
your yellow and red will still have too many tick labels - you'll probably need to modify them (http://toyplot.readthedocs.org/en/latest/tick-locators.html)
Timothy M. Shead
@tshead2
Jul 14 2015 16:15
@gfleetwood - You’re definitely asking this plot for a lot:
print y1[-1], y2[-1], y3[-1], y4[-1], y5[-1]
(20000.0, 1.2676506002282294e+30, inf, 10000.0, 10000.0)
Timothy M. Shead
@tshead2
Jul 14 2015 16:20
Since y3 goes to infinity, it’s hard to say what the plot should do with it. If you leave out y3 and switch to a log scale on the Y axis as @maciejgryka suggests, you’ll get a sensible-isn figure. It is fair to say that the log locator could be smarter - currently, it will create a tick for every order of magnitude, which can cause label overlap. The short-term workaround for this would be to use an Explicit locator to put ticks where you want them.
Gordon Fleetwood
@gfleetwood
Jul 14 2015 16:56
This message was deleted
Gordon Fleetwood
@gfleetwood
Jul 14 2015 17:42
@maciejgryka @tshead2 Thanks for the replies. I was just testing out the library's limits. For some reason I just assumed matplotlib could handle what I did, but it turns out that it "breaks" too, which is good. I really want to use toyplot as my visualization library and never have to see matplotlib again.
Timothy M. Shead
@tshead
Jul 14 2015 22:20
Best unsolicited testimonial ever … thank you!