On Wed, Nov 17, 2010 at 2:29 AM, Tim Åberg <qw...@hotmail.com> wrote: > Hello! > > I have now been tampering with a custom formatter and the more i think about > it the more i feel there must be a more easy soulution. I have a set of > values that are plotted over time (i use date2num, to get the conversion > from date to num), i also have a list with dates that corresponds to these > values; > ['2010-11-05 10:27:45.605000', '2010-11-05 10:27:50.576000', '2010-11-05 > 10:27:55.913000'], this to not have to do a conversion back, i imagine its > the most effective way to do it. > > Now to the question; > > The only two values in the datelist that is vital is the first and the last, > in between i really just want to have values that corresponds lineary. Thats > brings me to resoulution, if the values are far far in between, say weeks or > even moth the time (h:s:ms) isnt so important and vice versa. > > Is there any formatter that do this sort of things? eg. takes in two > values(dates) and format it by itself.
Take a look at this example http://matplotlib.sourceforge.net/examples/api/date_index_formatter.html It's trying to solve a different but related problem: in financial time series you only have data on Monday - Friday, and you don't want to plot the gaps on weekends. So you plot the data linearly with an index, and use a custom locator and formatter to set and format the ticks. JDH ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-sfdev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users