You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(33) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(7) |
Feb
(44) |
Mar
(51) |
Apr
(43) |
May
(43) |
Jun
(36) |
Jul
(61) |
Aug
(44) |
Sep
(25) |
Oct
(82) |
Nov
(97) |
Dec
(47) |
2005 |
Jan
(77) |
Feb
(143) |
Mar
(42) |
Apr
(31) |
May
(93) |
Jun
(93) |
Jul
(35) |
Aug
(78) |
Sep
(56) |
Oct
(44) |
Nov
(72) |
Dec
(75) |
2006 |
Jan
(116) |
Feb
(99) |
Mar
(181) |
Apr
(171) |
May
(112) |
Jun
(86) |
Jul
(91) |
Aug
(111) |
Sep
(77) |
Oct
(72) |
Nov
(57) |
Dec
(51) |
2007 |
Jan
(64) |
Feb
(116) |
Mar
(70) |
Apr
(74) |
May
(53) |
Jun
(40) |
Jul
(519) |
Aug
(151) |
Sep
(132) |
Oct
(74) |
Nov
(282) |
Dec
(190) |
2008 |
Jan
(141) |
Feb
(67) |
Mar
(69) |
Apr
(96) |
May
(227) |
Jun
(404) |
Jul
(399) |
Aug
(96) |
Sep
(120) |
Oct
(205) |
Nov
(126) |
Dec
(261) |
2009 |
Jan
(136) |
Feb
(136) |
Mar
(119) |
Apr
(124) |
May
(155) |
Jun
(98) |
Jul
(136) |
Aug
(292) |
Sep
(174) |
Oct
(126) |
Nov
(126) |
Dec
(79) |
2010 |
Jan
(109) |
Feb
(83) |
Mar
(139) |
Apr
(91) |
May
(79) |
Jun
(164) |
Jul
(184) |
Aug
(146) |
Sep
(163) |
Oct
(128) |
Nov
(70) |
Dec
(73) |
2011 |
Jan
(235) |
Feb
(165) |
Mar
(147) |
Apr
(86) |
May
(74) |
Jun
(118) |
Jul
(65) |
Aug
(75) |
Sep
(162) |
Oct
(94) |
Nov
(48) |
Dec
(44) |
2012 |
Jan
(49) |
Feb
(40) |
Mar
(88) |
Apr
(35) |
May
(52) |
Jun
(69) |
Jul
(90) |
Aug
(123) |
Sep
(112) |
Oct
(120) |
Nov
(105) |
Dec
(116) |
2013 |
Jan
(76) |
Feb
(26) |
Mar
(78) |
Apr
(43) |
May
(61) |
Jun
(53) |
Jul
(147) |
Aug
(85) |
Sep
(83) |
Oct
(122) |
Nov
(18) |
Dec
(27) |
2014 |
Jan
(58) |
Feb
(25) |
Mar
(49) |
Apr
(17) |
May
(29) |
Jun
(39) |
Jul
(53) |
Aug
(52) |
Sep
(35) |
Oct
(47) |
Nov
(110) |
Dec
(27) |
2015 |
Jan
(50) |
Feb
(93) |
Mar
(96) |
Apr
(30) |
May
(55) |
Jun
(83) |
Jul
(44) |
Aug
(8) |
Sep
(5) |
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(1) |
Oct
(3) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(7) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
1
(1) |
2
|
3
|
4
|
5
|
6
(3) |
7
(2) |
8
(13) |
9
(4) |
10
|
11
|
12
|
13
(1) |
14
|
15
|
16
|
17
(3) |
18
(1) |
19
|
20
(4) |
21
(9) |
22
|
23
(1) |
24
|
25
|
26
(2) |
27
(6) |
28
|
29
|
30
|
31
|
Hi Tony, This is awesome. Great work! I was wondering, is there an easy way to cycle through all available styles for a given plot? For instance, clicking on the top left plot displays a maximized image of the "bmh" style. It would be great if one could press arrow-down (say) to cycle through the other styles "dark_background", "fivethirtyeight", etc. for a quick comparison. Cheers, Max 2015年01月06日 4:42 GMT+00:00 Tony Yu <ts...@gm...>: > I've been playing around with learning Javascript lately. As part of the > process, I created a Flask app to build a gallery for matplotlib style > sheets: > > https://github.com/tonysyu/matplotlib-style-gallery > > If you run that locally, you can actually input styles, either with a URL > to a *.mplstyle file or with matplotlibrc commands. Here's a static version > without the custom inputs: > > http://tonysyu.github.io/raw_content/matplotlib-style-gallery/gallery.html > > Ideally, I'd get this into a form that could be submitted as a PR for the > matplotlib website, but I'll need a bit more spare time to learn some more > web development (sessions, client storage, etc). > > Cheers! > -Tony > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > >
Hi Nathaniel, > > Basically, it allows you to pick the start/end color of a colormap from > two > > cross sections in CIELab space and interpolates those colors linearly > (see > > the README file for more details). > > There's a downside to this approach for the kinds of colormaps we've > been talking about in this thread, where we want both a large > lightness range plus a colorful result. The problem is that the way > color space is shaped, you can't simultaneously have both high > saturation (colorfulness) *and* high/low lightness. So if you pick > your extreme points to be near black and white, then they can only > have a slight tinting of color, and then if you linearly interpolate > between these, then you end up with slightly tinted greyscale. > You raise an excellent point here. It explains nicely what I have experienced while playing with my GUI. Indeed, I found that a simple linear interpolation did not result in totally satisfactory colormaps (see my previous reply to Federico). I couldn't quite explain why, but your explanation makes this clear. One exception I encountered is an interpolation between dark blue and yellow as in the attached screenshot (which I hope makes it through to the mailing list) - probably because it mostly avoids the low-saturation (grey-ish) region of the color space. But I agree with you that using a curved, rather than linear, interpolation can probably yield better results. It sounds like you have a good deal of experience with various color spaces and colormaps. Do you have an idea for a good "recipe" how to pick a curve in a given colorspace that leads to a satisfactory colormap? My first idea was to change the interpolating line to a circular arc passing through an "intermediate" color, but it's not clear to me whether there is any preferred "direction" for nudging the line into an arc. Also, most other colormaps, such as the examples "YlGnBu" and "cubehelix" which you mentioned, use more complicated curves than mere circular arcs (btw, kudos for your script - it's a great way of visualising these colormaps). I don't have enough knowledge yet to decide whether either approach is better. I've started toying with curved interpolations in my code but this is not quite ready to be pushed to Github yet. Anyway, if you have any suggestions I'd love to hear them. I also found a few more blog posts and papers which I hadn't seen before and which look extremely useful: (i) "Subtleties of color" http://earthobservatory.nasa.gov/blogs/elegantfigures/2013/08/05/subtleties-of-color-part-1-of-6/ A series of six blog posts with an excellent introduction to color theory and the issues around choosing colormaps. Well worth a read! It also suggests that CIE L*c*h* space (which uses the three variables lightness, chroma (saturation) and hue), may be a better choice than CIE L*a*b*, which I have been using so far. (ii) "How To Avoid Equidistant HSV Colors" http://vis4.net/blog/posts/avoid-equidistant-hsv-colors/ Blog post with some interactive tools to visualise sections of CIE L*a*b* space and HCL (Hue-Chroma-Lightness) space. Here is a nice standalone version of the second tool: http://tristen.ca/hcl-picker/#/hlc/6/1/1B2531/E5FC74 (iii) "Generating Color Palettes using Intuitive Parameters" http://magnaview.nl/documents/MagnaView-M_Wijffelaars-Generating_color_palettes_using_intuitive_parameters.pdf Excellent-looking paper on the subject. I haven't read it in full yet but it looks like a great resource which might answer some of my questions above. At this stage I'm wondering how best to proceed. There seems to be huge number of resources and information, but we don't really have a clear path forward. I agree with Phil Elson's assessment when I talked to him at the Open Source Day: what we need is for someone to make a suggestion for a colormap and list a number of reasons why this particular one should be chosen. Then we have a basis for discussion and can argue about it. If anybody has such a suggestion yet, it would be great to hear about it (even if it is not perfect). Otherwise I'll try to make one once I have explored various options a bit more (although it may take a little while as my spare time is rather limited at the moment). Best wishes, Max
Hi Federico, Thanks for trying it out and for the feedback! Indeed, I started out writing a simple IPython notebook along the lines you suggested, with just a couple of sliders and plots, but it quickly became too slow and unwieldy for quick explorations, hence the slightly more elaborate GUI. I agree that the reason for the 3D plot on the right may not be obvious at the moment. Personally, I find it useful to get a feel for what the representable colors in CIELab space (and the cross sections for L=const) look like, but when simply using a linear interpolation between two colors (as I'm doing at the moment) it may not be needed to visualise it in 3D. The reason I added it is that while playing around with the GUI I got the impression that my initial suggestion of using a simple linear interpolation between two colors may not result in the best-looking colormaps (this is confirmed by Nathaniel's reply). I'm currently toying with the option to use curved interpolations, and for thee it would be very useful IMHO to see what they look like in 3D. Btw, I have refactored my code a bit and it should be easy to write a simpler UI (e.g. in an IPython notebook) which doesn't need the other dependencies (also, I could drop the wxpython dependency because some conflict with Vispy which I had experienced seems to have disappeared). If you like, feel free to give it a shot to write a UI the way you imagine it. It's always good to have more options for exploration. :) Best wishes, Max 2015年01月08日 17:44 GMT+00:00 Federico Ariza <ari...@gm...>: > Nice job. > > I find your GUI a little bit confusing (new to colormap stuff) but I > like the idea, basically I find it overkill, I would replace the gui > by a plot and a couple of slider widgets something simpler to > integrate without new dependencies. > Do you really need the third 3d plot on the right? > > On Mon, Jan 5, 2015 at 9:37 PM, Maximilian Albert > <max...@gm...> wrote: > > Happy new year everyone! > > > > Apologies for the long silence. I was snowed in with work before > Christmas > > and then mostly cut off from the internet for the past two weeks. > > Fortunately, I had a chance over the holidays to flesh out the GUI which > I > > mentioned in my previous email. You can find it here: > > > > https://github.com/maxalbert/colormap-selector > > > > Basically, it allows you to pick the start/end color of a colormap from > two > > cross sections in CIELab space and interpolates those colors linearly > (see > > the README file for more details). Currently there is one scatterplot to > > illustrate the resulting colormap but it can be trivially extended to > show > > more interesting sample plots. There are still a few things missing that > I'd > > like to add but at least it's in a state where it can be used and I'd be > > grateful for feedback, especially with regard to the colormaps generated > > with it (I do have some opinions myself but it would be interesting to > hear > > others' first). > > > > Regarding our ongoing discussion, I had a very useful chat with two > > colleagues before Christmas which spurred more thoughts. But I guess it's > > best to discuss them in a separate email when I'm less tired. ;) > > > > Best wishes, > > Max > > > > > ------------------------------------------------------------------------------ > > Dive into the World of Parallel Programming! The Go Parallel Website, > > sponsored by Intel and developed in partnership with Slashdot Media, is > your > > hub for all things parallel software development, from weekly thought > > leadership blogs to news, videos, case studies, tutorials and more. Take > a > > look and join the conversation now. http://goparallel.sourceforge.net > > _______________________________________________ > > Matplotlib-devel mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > > > > > -- > Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > > -- Antonio Alducin -- >
Let's say we want a time zone aware date time converter. The basic goal is to convert some input type (datetime) to the MPL internal type (float days past Jan 0, 0001). We also need to tell MPL how to format the axis (default formatter, locator, limits, label). - The convert() method takes the input type (datetime) and the xunits (or yunits) keyword argument and converts it to the MPL type. The axis input can be used to change the results depending on the plot type (polar plots always require radians for example). For the TZ converter, would take the input value (datetime), convert it to the time zone requested by the units input, then convert that to a float using dates.date2num(). Note that the input can be a sequence or a single value so the converter has to handle both cases. - The axisinfo() method is used to provide the default axis locator and formatter objects when the user creates a plot with this type. The axis input is useful here to handle the result differently for a polar plot. For the TZ converter, this would be exactly the same as the web docs - return the default locator and formatter for dates. Most of the time this method can just return standard MPL formatters and locators (for either dates or numbers). - The default_units() method provides a default value for the xunits or yunits keyword argument if one isn't specified. The default in this case might be "UTC". Hope that helps some, if you have more specific questions feel free to send them to me. Ted ________________________________ From: Thomas Caswell [tca...@gm...] Sent: Thursday, January 08, 2015 11:14 AM To: Drain, Theodore R (392P); mat...@li... Subject: Re: [matplotlib-devel] Date overhaul? I was hoping for something a bit more extensive of the intenals. I have tried to understand the units code a couple of times now and always hit a brick wall. On Thu Jan 08 2015 at 2:07:02 PM Drain, Theodore R (392P) <the...@jp...<mailto:the...@jp...>> wrote: Google search "matplotlib units" yields: http://matplotlib.org/api/units_api.html So it sounds like the update is to make MPL's internal date system higher resolution which would be great. We would just need to update our converters to convert to that format instead of the current floating point format. Our custom classes are not public (and can't really be made public) but they aren't very complicated so we can certainly talk about the implementation if that helps. ________________________________ From: Thomas Caswell [tca...@gm...<mailto:tca...@gm...>] Sent: Thursday, January 08, 2015 10:57 AM To: Drain, Theodore R (392P); mat...@li...<mailto:mat...@li...> Subject: Re: [matplotlib-devel] Date overhaul? One of the other driving factors to over-haul the default date handling is that floats do not have enough precision to deal with nano-second resolution data (which is what I think drove pandas to use datetime64). It sounds like the correct solution Is the unit framework documented anywhere and are those custom classes public? Tom On Thu Jan 08 2015 at 12:59:17 PM Drain, Theodore R (392P) <the...@jp...<mailto:the...@jp...>> wrote: I agree w/ the original poster that it would help to have a MEP to clearly define what the goals of the overhaul are Something else to keep in mind: we at least don't normally plot dates in "earth" based time systems. ~10 years ago we contracted with John Hunter to add the arbitrary unit system to MPL. This allows users to plot in their own data types and define a converter to handle the conversion to MPL types and labeling. We have our own "date time" like class which handles relativistic time scales (TDB, TT, TAI, GPS, Mars time, etc) at extremely high precision. We register a unit converter w/ MPL which allows our users to plot these types natively and use the xunits keyword (or yunits) to control how the plot looks. So we can do this: plot( x, y, xunits="GPS", yunits="km/s" ) plot( x, y, xunits="PST", yunits="mph" ) It would also be pretty easy to add a time zone aware unit converter with the existing MPL code which would allow you to do things w/ datetime like this: plot( x, y, xunits="UTC+8" ) plot( x, y, xunits="EST" ) I guess the point of this is to remind folks that not everyone plots dates in time zone based systems... Ted ________________________________ From: Chris Barker [chr...@no...<mailto:chr...@no...>] Sent: Thursday, January 08, 2015 9:00 AM To: mat...@li...<mailto:mat...@li...> Subject: Re: [matplotlib-devel] Date overhaul? On Thu, Jan 8, 2015 at 7:04 AM, Skip Montanaro <sk...@po...<mailto:sk...@po...>> wrote: I'm real naive about this stuff, but I have always wondered why matplotlib didn't just use datetime objects, or at least use timezone-aware datetime objects as an "interchange" format to get the timezone stuff right. Time zone handling is a pain in the %}€* And the definitions keep changing. So you need a complex DB and library that needs frequent updating. This is why neither the standard library nor numpy support time zone handling out of the box. But the datetime object does support a hook to add timezone info. The numpy datetime64 may implementation _may_ provide a similar hook in the future. There is the pytz package, which MPL could choose to depend on. But even that is a bit ugly--e.g. from the pytz docs: """Unfortunately using the tzinfo argument of the standard datetime constructors ‘’does not work’’ with pytz for many timezones.""" So my suggestion is that MPL punts, and stick with leaving time zone handling up to the user, I.e only use datetimes that are timezone "naive". What this means is that MPL would always a assume all datetimes interacting with each other are in the same time zone (including same DST status). Anyway, I'm being a bit lazy here, so I may be wrong, but I think the issue at hand is that MPL currently uses a float array to store and manipulate datetimes, and the thought is that it may be better to use numpy datetime64 arrays -- that would give us more consistent precision, and less code to convert to/from various datetime formats. I'm a bit on the fence about whether it's time to do it, as datetime64 does have issues with the locale timezone, but as any implementation would want to work with not-just-the-latest numpy anyway, it may make sense to start now. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...<mailto:Chr...@no...> ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net_______________________________________________ Matplotlib-devel mailing list Mat...@li...<mailto:Mat...@li...> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net_______________________________________________ Matplotlib-devel mailing list Mat...@li...<mailto:Mat...@li...> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
I was hoping for something a bit more extensive of the intenals. I have tried to understand the units code a couple of times now and always hit a brick wall. On Thu Jan 08 2015 at 2:07:02 PM Drain, Theodore R (392P) < the...@jp...> wrote: > Google search "matplotlib units" yields: > http://matplotlib.org/api/units_api.html > > > > So it sounds like the update is to make MPL's internal date system higher > resolution which would be great. We would just need to update our > converters to convert to that format instead of the current floating point > format. Our custom classes are not public (and can't really be made > public) but they aren't very complicated so we can certainly talk about the > implementation if that helps. > > > ------------------------------ > *From:* Thomas Caswell [tca...@gm...] > *Sent:* Thursday, January 08, 2015 10:57 AM > *To:* Drain, Theodore R (392P); mat...@li... > > *Subject:* Re: [matplotlib-devel] Date overhaul? > One of the other driving factors to over-haul the default date handling > is that floats do not have enough precision to deal with nano-second > resolution data (which is what I think drove pandas to use datetime64). > > It sounds like the correct solution > > Is the unit framework documented anywhere and are those custom classes > public? > > Tom > > On Thu Jan 08 2015 at 12:59:17 PM Drain, Theodore R (392P) < > the...@jp...> wrote: > >> I agree w/ the original poster that it would help to have a MEP to >> clearly define what the goals of the overhaul are >> >> >> >> Something else to keep in mind: we at least don't normally plot dates in >> "earth" based time systems. ~10 years ago we contracted with John Hunter >> to add the arbitrary unit system to MPL. This allows users to plot in >> their own data types and define a converter to handle the conversion to MPL >> types and labeling. We have our own "date time" like class which handles >> relativistic time scales (TDB, TT, TAI, GPS, Mars time, etc) at extremely >> high precision. We register a unit converter w/ MPL which allows our users >> to plot these types natively and use the xunits keyword (or yunits) to >> control how the plot looks. So we can do this: >> >> >> >> plot( x, y, xunits="GPS", yunits="km/s" ) >> >> plot( x, y, xunits="PST", yunits="mph" ) >> >> >> >> It would also be pretty easy to add a time zone aware unit converter with >> the existing MPL code which would allow you to do things w/ datetime like >> this: >> >> >> >> plot( x, y, xunits="UTC+8" ) >> >> plot( x, y, xunits="EST" ) >> >> >> >> I guess the point of this is to remind folks that not everyone plots >> dates in time zone based systems... >> >> >> >> Ted >> >> >> ------------------------------ >> *From:* Chris Barker [chr...@no...] >> *Sent:* Thursday, January 08, 2015 9:00 AM >> *To:* mat...@li... >> *Subject:* Re: [matplotlib-devel] Date overhaul? >> >> On Thu, Jan 8, 2015 at 7:04 AM, Skip Montanaro <sk...@po...> >> wrote: >> >>> I'm real naive about this stuff, but I have always wondered why >>> matplotlib didn't just use datetime objects, or at least use >>> timezone-aware datetime objects as an "interchange" format to get the >>> timezone stuff right. >>> >> >> Time zone handling is a pain in the %}€* >> >> And the definitions keep changing. >> >> So you need a complex DB and library that needs frequent updating. >> >> This is why neither the standard library nor numpy support time zone >> handling out of the box. >> >> But the datetime object does support a hook to add timezone info. >> >> The numpy datetime64 may implementation _may_ provide a similar hook >> in the future. >> >> There is the pytz package, which MPL could choose to depend on. >> >> But even that is a bit ugly--e.g. from the pytz docs: >> >> """Unfortunately using the tzinfo argument of the standard datetime >> constructors ‘’does not work’’ with pytz for many timezones.""" >> >> So my suggestion is that MPL punts, and stick with leaving time zone >> handling up to the user, I.e only use datetimes that are timezone "naive". >> What this means is that MPL would always a assume all datetimes interacting >> with each other are in the same time zone (including same DST status). >> >> Anyway, I'm being a bit lazy here, so I may be wrong, but I think the >> issue at hand is that MPL currently uses a float array to store and >> manipulate datetimes, and the thought is that it may be better to use >> numpy datetime64 arrays -- that would give us more consistent precision, >> and less code to convert to/from various datetime formats. >> I'm a bit on the fence about whether it's time to do it, as datetime64 >> does have issues with the locale timezone, but as any implementation would >> want to work with not-just-the-latest numpy anyway, it may make sense to >> start now. >> >> -Chris >> >> >> >> >> >> >> -- >> >> Christopher Barker, Ph.D. >> Oceanographer >> >> Emergency Response Division >> NOAA/NOS/OR&R (206) 526-6959 voice >> 7600 Sand Point Way NE (206) 526-6329 fax >> Seattle, WA 98115 (206) 526-6317 main reception >> >> Chr...@no... >> ------------------------------------------------------------ >> ------------------ >> Dive into the World of Parallel Programming! The Go Parallel Website, >> sponsored by Intel and developed in partnership with Slashdot Media, is >> your >> hub for all things parallel software development, from weekly thought >> leadership blogs to news, videos, case studies, tutorials and more. Take a >> look and join the conversation now. http://goparallel.sourceforge.net >> _______________________________________________ >> Matplotlib-devel mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >> > ------------------------------------------------------------ > ------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >
Google search "matplotlib units" yields: http://matplotlib.org/api/units_api.html So it sounds like the update is to make MPL's internal date system higher resolution which would be great. We would just need to update our converters to convert to that format instead of the current floating point format. Our custom classes are not public (and can't really be made public) but they aren't very complicated so we can certainly talk about the implementation if that helps. ________________________________ From: Thomas Caswell [tca...@gm...] Sent: Thursday, January 08, 2015 10:57 AM To: Drain, Theodore R (392P); mat...@li... Subject: Re: [matplotlib-devel] Date overhaul? One of the other driving factors to over-haul the default date handling is that floats do not have enough precision to deal with nano-second resolution data (which is what I think drove pandas to use datetime64). It sounds like the correct solution Is the unit framework documented anywhere and are those custom classes public? Tom On Thu Jan 08 2015 at 12:59:17 PM Drain, Theodore R (392P) <the...@jp...<mailto:the...@jp...>> wrote: I agree w/ the original poster that it would help to have a MEP to clearly define what the goals of the overhaul are Something else to keep in mind: we at least don't normally plot dates in "earth" based time systems. ~10 years ago we contracted with John Hunter to add the arbitrary unit system to MPL. This allows users to plot in their own data types and define a converter to handle the conversion to MPL types and labeling. We have our own "date time" like class which handles relativistic time scales (TDB, TT, TAI, GPS, Mars time, etc) at extremely high precision. We register a unit converter w/ MPL which allows our users to plot these types natively and use the xunits keyword (or yunits) to control how the plot looks. So we can do this: plot( x, y, xunits="GPS", yunits="km/s" ) plot( x, y, xunits="PST", yunits="mph" ) It would also be pretty easy to add a time zone aware unit converter with the existing MPL code which would allow you to do things w/ datetime like this: plot( x, y, xunits="UTC+8" ) plot( x, y, xunits="EST" ) I guess the point of this is to remind folks that not everyone plots dates in time zone based systems... Ted ________________________________ From: Chris Barker [chr...@no...<mailto:chr...@no...>] Sent: Thursday, January 08, 2015 9:00 AM To: mat...@li...<mailto:mat...@li...> Subject: Re: [matplotlib-devel] Date overhaul? On Thu, Jan 8, 2015 at 7:04 AM, Skip Montanaro <sk...@po...<mailto:sk...@po...>> wrote: I'm real naive about this stuff, but I have always wondered why matplotlib didn't just use datetime objects, or at least use timezone-aware datetime objects as an "interchange" format to get the timezone stuff right. Time zone handling is a pain in the %}€* And the definitions keep changing. So you need a complex DB and library that needs frequent updating. This is why neither the standard library nor numpy support time zone handling out of the box. But the datetime object does support a hook to add timezone info. The numpy datetime64 may implementation _may_ provide a similar hook in the future. There is the pytz package, which MPL could choose to depend on. But even that is a bit ugly--e.g. from the pytz docs: """Unfortunately using the tzinfo argument of the standard datetime constructors ‘’does not work’’ with pytz for many timezones.""" So my suggestion is that MPL punts, and stick with leaving time zone handling up to the user, I.e only use datetimes that are timezone "naive". What this means is that MPL would always a assume all datetimes interacting with each other are in the same time zone (including same DST status). Anyway, I'm being a bit lazy here, so I may be wrong, but I think the issue at hand is that MPL currently uses a float array to store and manipulate datetimes, and the thought is that it may be better to use numpy datetime64 arrays -- that would give us more consistent precision, and less code to convert to/from various datetime formats. I'm a bit on the fence about whether it's time to do it, as datetime64 does have issues with the locale timezone, but as any implementation would want to work with not-just-the-latest numpy anyway, it may make sense to start now. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...<mailto:Chr...@no...> ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net_______________________________________________ Matplotlib-devel mailing list Mat...@li...<mailto:Mat...@li...> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
One of the other driving factors to over-haul the default date handling is that floats do not have enough precision to deal with nano-second resolution data (which is what I think drove pandas to use datetime64). It sounds like the correct solution Is the unit framework documented anywhere and are those custom classes public? Tom On Thu Jan 08 2015 at 12:59:17 PM Drain, Theodore R (392P) < the...@jp...> wrote: > I agree w/ the original poster that it would help to have a MEP to > clearly define what the goals of the overhaul are > > > > Something else to keep in mind: we at least don't normally plot dates in > "earth" based time systems. ~10 years ago we contracted with John Hunter > to add the arbitrary unit system to MPL. This allows users to plot in > their own data types and define a converter to handle the conversion to MPL > types and labeling. We have our own "date time" like class which handles > relativistic time scales (TDB, TT, TAI, GPS, Mars time, etc) at extremely > high precision. We register a unit converter w/ MPL which allows our users > to plot these types natively and use the xunits keyword (or yunits) to > control how the plot looks. So we can do this: > > > > plot( x, y, xunits="GPS", yunits="km/s" ) > > plot( x, y, xunits="PST", yunits="mph" ) > > > > It would also be pretty easy to add a time zone aware unit converter with > the existing MPL code which would allow you to do things w/ datetime like > this: > > > > plot( x, y, xunits="UTC+8" ) > > plot( x, y, xunits="EST" ) > > > > I guess the point of this is to remind folks that not everyone plots dates > in time zone based systems... > > > > Ted > > > ------------------------------ > *From:* Chris Barker [chr...@no...] > *Sent:* Thursday, January 08, 2015 9:00 AM > *To:* mat...@li... > *Subject:* Re: [matplotlib-devel] Date overhaul? > > On Thu, Jan 8, 2015 at 7:04 AM, Skip Montanaro <sk...@po...> wrote: > >> I'm real naive about this stuff, but I have always wondered why >> matplotlib didn't just use datetime objects, or at least use >> timezone-aware datetime objects as an "interchange" format to get the >> timezone stuff right. >> > > Time zone handling is a pain in the %}€* > > And the definitions keep changing. > > So you need a complex DB and library that needs frequent updating. > > This is why neither the standard library nor numpy support time zone > handling out of the box. > > But the datetime object does support a hook to add timezone info. > > The numpy datetime64 may implementation _may_ provide a similar hook > in the future. > > There is the pytz package, which MPL could choose to depend on. > > But even that is a bit ugly--e.g. from the pytz docs: > > """Unfortunately using the tzinfo argument of the standard datetime > constructors ‘’does not work’’ with pytz for many timezones.""" > > So my suggestion is that MPL punts, and stick with leaving time zone > handling up to the user, I.e only use datetimes that are timezone "naive". > What this means is that MPL would always a assume all datetimes interacting > with each other are in the same time zone (including same DST status). > > Anyway, I'm being a bit lazy here, so I may be wrong, but I think the > issue at hand is that MPL currently uses a float array to store and > manipulate datetimes, and the thought is that it may be better to use > numpy datetime64 arrays -- that would give us more consistent precision, > and less code to convert to/from various datetime formats. > I'm a bit on the fence about whether it's time to do it, as datetime64 > does have issues with the locale timezone, but as any implementation would > want to work with not-just-the-latest numpy anyway, it may make sense to > start now. > > -Chris > > > > > > > -- > > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chr...@no... > ------------------------------------------------------------ > ------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >
I agree w/ the original poster that it would help to have a MEP to clearly define what the goals of the overhaul are Something else to keep in mind: we at least don't normally plot dates in "earth" based time systems. ~10 years ago we contracted with John Hunter to add the arbitrary unit system to MPL. This allows users to plot in their own data types and define a converter to handle the conversion to MPL types and labeling. We have our own "date time" like class which handles relativistic time scales (TDB, TT, TAI, GPS, Mars time, etc) at extremely high precision. We register a unit converter w/ MPL which allows our users to plot these types natively and use the xunits keyword (or yunits) to control how the plot looks. So we can do this: plot( x, y, xunits="GPS", yunits="km/s" ) plot( x, y, xunits="PST", yunits="mph" ) It would also be pretty easy to add a time zone aware unit converter with the existing MPL code which would allow you to do things w/ datetime like this: plot( x, y, xunits="UTC+8" ) plot( x, y, xunits="EST" ) I guess the point of this is to remind folks that not everyone plots dates in time zone based systems... Ted ________________________________ From: Chris Barker [chr...@no...] Sent: Thursday, January 08, 2015 9:00 AM To: mat...@li... Subject: Re: [matplotlib-devel] Date overhaul? On Thu, Jan 8, 2015 at 7:04 AM, Skip Montanaro <sk...@po...<mailto:sk...@po...>> wrote: I'm real naive about this stuff, but I have always wondered why matplotlib didn't just use datetime objects, or at least use timezone-aware datetime objects as an "interchange" format to get the timezone stuff right. Time zone handling is a pain in the %}€* And the definitions keep changing. So you need a complex DB and library that needs frequent updating. This is why neither the standard library nor numpy support time zone handling out of the box. But the datetime object does support a hook to add timezone info. The numpy datetime64 may implementation _may_ provide a similar hook in the future. There is the pytz package, which MPL could choose to depend on. But even that is a bit ugly--e.g. from the pytz docs: """Unfortunately using the tzinfo argument of the standard datetime constructors ‘’does not work’’ with pytz for many timezones.""" So my suggestion is that MPL punts, and stick with leaving time zone handling up to the user, I.e only use datetimes that are timezone "naive". What this means is that MPL would always a assume all datetimes interacting with each other are in the same time zone (including same DST status). Anyway, I'm being a bit lazy here, so I may be wrong, but I think the issue at hand is that MPL currently uses a float array to store and manipulate datetimes, and the thought is that it may be better to use numpy datetime64 arrays -- that would give us more consistent precision, and less code to convert to/from various datetime formats. I'm a bit on the fence about whether it's time to do it, as datetime64 does have issues with the locale timezone, but as any implementation would want to work with not-just-the-latest numpy anyway, it may make sense to start now. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...<mailto:Chr...@no...>
On Tue, Jan 6, 2015 at 2:37 AM, Maximilian Albert <max...@gm...> wrote: > Happy new year everyone! > > Apologies for the long silence. I was snowed in with work before Christmas > and then mostly cut off from the internet for the past two weeks. > Fortunately, I had a chance over the holidays to flesh out the GUI which I > mentioned in my previous email. You can find it here: > > https://github.com/maxalbert/colormap-selector > > Basically, it allows you to pick the start/end color of a colormap from two > cross sections in CIELab space and interpolates those colors linearly (see > the README file for more details). There's a downside to this approach for the kinds of colormaps we've been talking about in this thread, where we want both a large lightness range plus a colorful result. The problem is that the way color space is shaped, you can't simultaneously have both high saturation (colorfulness) *and* high/low lightness. So if you pick your extreme points to be near black and white, then they can only have a slight tinting of color, and then if you linearly interpolate between these, then you end up with slightly tinted greyscale. Colormaps like YlGnBu or cubehelix or parula are designed to start out with low saturation, then as they move into the middle of the lightness scale they arc outwards, then arc back in again. This is a lot easier to visualize (e.g. by playing with the script I posted upthread) than it is to explain in text :-). Like, if you do viscm(YlGnBu_r) and look at the plot in the lower-right then it's clear that it's not a simple straight line in (J'/K, a', b') space (which is a higher-tech analogue to L* a* b* space). -- Nathaniel J. Smith Postdoctoral researcher - Informatics - University of Edinburgh http://vorpus.org
Nice job. I find your GUI a little bit confusing (new to colormap stuff) but I like the idea, basically I find it overkill, I would replace the gui by a plot and a couple of slider widgets something simpler to integrate without new dependencies. Do you really need the third 3d plot on the right? On Mon, Jan 5, 2015 at 9:37 PM, Maximilian Albert <max...@gm...> wrote: > Happy new year everyone! > > Apologies for the long silence. I was snowed in with work before Christmas > and then mostly cut off from the internet for the past two weeks. > Fortunately, I had a chance over the holidays to flesh out the GUI which I > mentioned in my previous email. You can find it here: > > https://github.com/maxalbert/colormap-selector > > Basically, it allows you to pick the start/end color of a colormap from two > cross sections in CIELab space and interpolates those colors linearly (see > the README file for more details). Currently there is one scatterplot to > illustrate the resulting colormap but it can be trivially extended to show > more interesting sample plots. There are still a few things missing that I'd > like to add but at least it's in a state where it can be used and I'd be > grateful for feedback, especially with regard to the colormaps generated > with it (I do have some opinions myself but it would be interesting to hear > others' first). > > Regarding our ongoing discussion, I had a very useful chat with two > colleagues before Christmas which spurred more thoughts. But I guess it's > best to discuss them in a separate email when I'm less tired. ;) > > Best wishes, > Max > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > -- Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? -- Antonio Alducin --
On Thu, Jan 8, 2015 at 7:04 AM, Skip Montanaro <sk...@po...> wrote: > I'm real naive about this stuff, but I have always wondered why > matplotlib didn't just use datetime objects, or at least use > timezone-aware datetime objects as an "interchange" format to get the > timezone stuff right. > Time zone handling is a pain in the %}€* And the definitions keep changing. So you need a complex DB and library that needs frequent updating. This is why neither the standard library nor numpy support time zone handling out of the box. But the datetime object does support a hook to add timezone info. The numpy datetime64 may implementation _may_ provide a similar hook in the future. There is the pytz package, which MPL could choose to depend on. But even that is a bit ugly--e.g. from the pytz docs: """Unfortunately using the tzinfo argument of the standard datetime constructors ‘’does not work’’ with pytz for many timezones.""" So my suggestion is that MPL punts, and stick with leaving time zone handling up to the user, I.e only use datetimes that are timezone "naive". What this means is that MPL would always a assume all datetimes interacting with each other are in the same time zone (including same DST status). Anyway, I'm being a bit lazy here, so I may be wrong, but I think the issue at hand is that MPL currently uses a float array to store and manipulate datetimes, and the thought is that it may be better to use numpy datetime64 arrays -- that would give us more consistent precision, and less code to convert to/from various datetime formats. I'm a bit on the fence about whether it's time to do it, as datetime64 does have issues with the locale timezone, but as any implementation would want to work with not-just-the-latest numpy anyway, it may make sense to start now. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
I'm real naive about this stuff, but I have always wondered why matplotlib didn't just use datetime objects, or at least use timezone-aware datetime objects as an "interchange" format to get the timezone stuff right. Skip
On Wed, Jan 7, 2015 at 2:10 PM, Eric Firing <ef...@ha...> wrote: > One thing that has held this up is that datetime64 > came into numpy half-baked, and has remained experimental with known > problems that need to be fixed. It looks like the core of datetime64, > ignoring timezone problems, isn't going to change, so it should be > possible to work with that in matplotlib. > you can do some googling, but the issue with timezones in datetime64 is that is _always_ uses the system timezone to translate when parsing iso strings (and bare datetime.datetime objects) without a timezone, and I'm pretty sure does somethign like that when formatting string output, too. It can be worked around if you are careful to always make it think you are working in UTC. This should change in a release or two (and I'm sorry to say that I've held that up by stalling on getting proposals properly written up), but Eric's right, the internals should stay close enough that it's worth using. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...