SourceForge logo
SourceForge logo
Menu

matplotlib-devel — matplotlib developers

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

Showing 4 results of 4

From: Eric F. <ef...@ha...> - 2015年01月09日 20:01:20
On 2015年01月09日 9:54 AM, Paul Ganssle wrote:
> Thanks for the responses. If no one minds, I'm take a look at how to
> best implement datetime64 this weekend and the degree to which it might
> be useful, then maybe I can start an MEP for it.
Paul,
I think everyone will be delighted to have you do this--preferably all 
the way to a PR.
>
> I agree with Chris's sentiment that it's likely not a bad idea to start
> on it now, since there will almost certainly be a significant lag in
> raising the Numpy dependency version anyway, so if it can be implemented
> in some reasonable way now, we might as well, otherwise it may be some
> years before we get to it.
>
Yes, by all means.
Eric
From: Paul G. <pga...@gm...> - 2015年01月09日 19:54:54
Thanks for the responses. If no one minds, I'm take a look at how to best
implement datetime64 this weekend and the degree to which it might be
useful, then maybe I can start an MEP for it.
I agree with Chris's sentiment that it's likely not a bad idea to start on
it now, since there will almost certainly be a significant lag in raising
the Numpy dependency version anyway, so if it can be implemented in some
reasonable way now, we might as well, otherwise it may be some years before
we get to it.
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...> 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
>
------------------------------------------------------------------------------
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
From: Tony Yu <ts...@gm...> - 2015年01月09日 02:11:22
Thanks Max!
I was planning to add a more interactive interface, really similar to what
you're suggesting. I haven't gotten around to it, but hopefully, I'll have
some time to play around with that.
On Thu, Jan 8, 2015 at 4:56 PM, Maximilian Albert <
max...@gm...> wrote:
> 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
>>
>>
>
From: Nathaniel S. <nj...@po...> - 2015年01月09日 01:17:29
On Thu, Jan 8, 2015 at 10:30 PM, Maximilian Albert
<max...@gm...> wrote:
> 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.
I guess this probably also has to do with another weird feature of how
the colorspace is shaped. You'll often see pictures in books that
illustrate it like two cones:
 http://www.tvtechnology.com/BE_Files/uploads/2013/05/ColorTopCones-305be18.jpg
which does capture the general idea that your range of saturations is
widest when lightness is in the middle, and narrows down when you move
towards black or white. But it's actually a bit more complicated than
that -- the actual shape is sorta lumpy, more like the picture here:
 http://www.gamutvision.com/
In particular, you can have pretty-saturated blues even at very low
lightnesses, and pretty-saturated yellows even at high lightnesses.
E.g. there literally does not exist a dark red that's as intense as
the most intense dark blue.
So this makes dark-blue-to-light-yellow the obvious way to go if you
want a dark-to-light colormap that is also colorful.
I don't think it's a coincidence that parula does exactly this :-)
There is an obvious degree of freedom here though -- the color wheel
is, like, a wheel, so if you want to go from blue to yellow you can do
that either clockwise or counterclockwise, i.e., you can go through
green or you can go through red. Parula goes via green (and so does
matplotlib's YlGnBu, for that matter). If we want to have a
distinctive colormap that people won't confuse with Matlab(R)(TM) then
maybe we should make a blue-purple-red-yellow one.
And in fact, this is probably theoretically optimal! As another weird
quirk of how color works, the 4 focal colors (red/green/blue/yellow)
are not actually at right angles to each other on the hue circle --
see the lower diagram on this figure:
 https://books.google.co.uk/books?id=MZ-TM0f2twAC&lpg=PA323&ots=XB_jHt0wz1&dq=%22the%20cie%20colour%20appearance%20model%22%20hunt%20and%20pointer&pg=PA307#v=onepage&q&f=false
>From yellow-to-blue via red is a ~213 degree angle, while
yellow-to-blue-via-green is only a ~147 degree angle (in a space where
we define our "hue angle" based on perceptual
just-noticeable-differences). So a blue-purple-red-yellow colormap
should theoretically have higher perceptual resolution than a
blue-green-yellow colormap.
> 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?
I haven't tried it yet, but my first idea would be to say that I want
a linear ramp in lightness (CIECAM02's "J"), and a linear ramp in hue
(CIECAM02's "h"), that starts at blue and ends at yellow, and then run
an optimizer to try and find a set of colorfulness values (CIECAM02's
"M") that maximize some criteria, i.e.:
 -- need to stay within the sRGB gamut
 -- the points should be as close to equidistant as possible
(measured in CAM02-UCS space)
 -- the total arc should be as long as possible (measured in
CAM02-UCS space) (this forces it to use the large colorfulness values
when available)
 -- and maybe some sort of wiggliness penalty (integral of squared
third derivative or something?) to smooth it out a bit
Then it just becomes an optimization problem -- given any proposed set
of JMh values we can convert into sRGB to check the gamut, convert in
CAM02-UCS to check the distances, etc., and compute an objective
function.
> 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.
They're kinda the same thing -- c*h* is just the polar coordinates
version of a*b*, so you can switch back and forth depending on which
way of thinking about things feels more natural for a given task. Of
course if you do linear interpolation in polar coordinates you get
some sort of funky curve, so I guess it would make a difference that
way :-). (And the Mh that I talk about above are also conceptually
just a polar coordinates version of a and b -- the CIECAM02
calculations literally have intermediate values called a and b that
play the same role as CIEL*a*b*'s a* and b*.)
-n
-- 
Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
http://vorpus.org

Showing 4 results of 4

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /