
Nowhere does it say "even a call like get_xlim() can cause a transform to become stale," (let alone the foregoing warning). NOTE: All of the examples in the transform tutorial discuss setter/explict plot-changing calls to illustrate when transforms can become stale. I.e., your statement that " In general if you want to know anything about screen space, do () to make sure everything has been resolved." should be in the docs in big bold letters.

In general if you want to know anything about screen space, do () to make sure everything has been resolved.

#AXES TRANSDATA UPDATE#
Similarly if you are using any of tight_layout or constrained_layout, we don't update the position of anything until draw time. In this case, you were triggering the auto-scaling by calling get_xlim() which resolves the "stale" limits and then pushes the updated information down into the transforms.įor performance reasons we accept storing information in two places so that we do not have to query the view limits every time we use it. In this case, when you have not explicitly set the limits, we defer computing the auto-limits until we must (so if you add 5k lines we only compute the limits once instead of 5k times). On one hand people want us to be as fast as possible, which means we have been trying to defer doing work until as late as possible. We recently tried to make the warnings a bit more glaring (see / ). Print('inv tr_x',inv(tr_x)) //<- AND HERE
#AXES TRANSDATA INSTALL#
Pip3 install -U -upgrade-strategy eager -r requirements.txt Installed via the following command, with requirements.txt containing "matplotlib" However, when passing the transAxes output to transData.inverted().transform() we get back 10957 - 14610.Įxpected: We should have translated back to ~18449. On the "ax" line we also see that the xlim is ~18449. Inverting that transform using transData.inverted().transform() goes back to ~11123 and ~14388 on x, and 0 on y.Īs you can see the on the transAxes output lines, x=1.0 is pixel = 1800. Tr_x input ġ pixel data width 2.356774193547608 Īs you can see on the tr_x lines, transforming x's in the 18449 xlim range maps to ~320 and ~1706 pixel space, and 9000.0 on y to 110 in pixel space.

autofmt_xdate( rotation = 45) # image_memory_file = io. #bar_width = (bar_duration*(fig_width_inch*plot_width_perc_of_fig) / plot_width_sec) / 72.0 #reading online it appears bar_width is unitless and represents "the size of one bar" = 1.0 fig. Print( 'aa bb', aa, bb, date2num( aa), date2num( bb)) Plot_width_sec = float(( quotes_x - quotes_x). subplots( figsize =( fig_width_inch, fig_width_inch * aspect), dpi = dpi) Ppi = 72.0 #standard dpi = 200 ppd = ppi / float( dpi)Īspect = 0.5 plot_width_perc_of_fig = 0.8 #standard matplot value fig_width_inch = 10 fig_width_dot = dpi * fig_width_inch fig, ax = plt. python_version())īar_duration = 60 start = datetime( year = 2020, month = 7, day = 6, hour = 6) dates import date2num from datetime import datetime, timedelta import io import matplotlib print( 'VERSION INFO')
