From tcaswell at gmail.com Mon Sep 2 12:50:52 2019 From: tcaswell at gmail.com (Thomas Caswell) Date: Mon, 2 Sep 2019 12:50:52 -0400 Subject: [Matplotlib-devel] Reschedule weekly call In-Reply-To: References: Message-ID: Folks, As no one has chimed in, we are going to re-schedule starting this week (2019-09-03). Anyone is welcome to join! Agenda / notes: https://paper.dropbox.com/doc/In-Matplotlib-2019-meeting-agenda--AkDHIkp3P9moHJIhgcIu9hTfAQ-aAmENlkgepgsMeDZtlsYu call coordinates: https://zoom.us/j/384435716 Tom On Mon, Aug 26, 2019 at 3:15 PM Thomas Caswell wrote: > Folks, > > Can we re-schedule the weekly call to Tuesdays 15:00 Eastern US time (UTC > -05:00). This is the name time, but shifted forward a day. > > This would go into effect next week (2019-09-03). > > Tom > > -- > Thomas Caswell > tcaswell at gmail.com > -- Thomas Caswell tcaswell at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From pi at berkeley.edu Wed Sep 11 15:31:03 2019 From: pi at berkeley.edu (Paul Ivanov) Date: Wed, 11 Sep 2019 12:31:03 -0700 Subject: [Matplotlib-devel] created v3.2.x branch Message-ID: Hi everyone, I created the 3.2.x branch and set up the bot to backport to PRs in the v3.2.0 milestone. onward and awkward, pi -- _ / \ A* \^ - ,./ _.`\\ / \ / ,--.S \/ \ / `"~,_ \ \ __o ? _ \<,_ /:\ --(_)/-(_)----.../ | \ --------------.......J Paul Ivanov https://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Wed Sep 11 17:34:17 2019 From: tcaswell at gmail.com (Thomas Caswell) Date: Wed, 11 Sep 2019 17:34:17 -0400 Subject: [Matplotlib-devel] created v3.2.x branch In-Reply-To: References: Message-ID: Thanks Paul! On Wed, Sep 11, 2019 at 3:31 PM Paul Ivanov wrote: > Hi everyone, > > I created the 3.2.x branch and set up the bot to backport to PRs in the > v3.2.0 milestone. > > onward and awkward, > pi > > -- > _ > / \ > A* \^ - > ,./ _.`\\ / \ > / ,--.S \/ \ > / `"~,_ \ \ > __o ? > _ \<,_ /:\ > --(_)/-(_)----.../ | \ > --------------.......J > Paul Ivanov > https://pirsquared.org | GPG/PGP key id: > 0x0F3E28F7 > _______________________________________________ > Matplotlib-devel mailing list > Matplotlib-devel at python.org > https://mail.python.org/mailman/listinfo/matplotlib-devel > -- Thomas Caswell tcaswell at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From anntzer.lee at gmail.com Mon Sep 23 05:56:25 2019 From: anntzer.lee at gmail.com (Antony Lee) Date: Mon, 23 Sep 2019 11:56:25 +0200 Subject: [Matplotlib-devel] ANN: mplcairo 0.2 release Message-ID: Dear all, I am pleased to announce the release of mplcairo 0.2. mplcairo is a Matplotlib backend based on the well-known cairo library, supporting output to both raster (including interactively) and vector formats. In other words, it provides the functionality of Matplotlib's {,qt5,gtk3,wx,tk,macos}{agg,cairo}, pdf, ps, and svg backends. Per Matplotlib's standard API, the backend can be selected by calling matplotlib.use("module://mplcairo.qt") or setting your MPLBACKEND environment variable to `module://mplcairo.qt` for Qt5, and similarly for other toolkits. mplcairo 0.2 adds support for cairo 1.17.2's high-precision floating point surfaces, simplifies the use of custom compositing operators (see `examples/operators.py`), a few other features listed in the changelog, as well as the usual bugfixes over 0.1. Enjoy, Antony Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From CBaumann at slb.com Mon Sep 23 13:12:26 2019 From: CBaumann at slb.com (Carlos Baumann) Date: Mon, 23 Sep 2019 17:12:26 +0000 Subject: [Matplotlib-devel] Masking in Matplotlib - Resetting the zorder of all pixels depending on their color value ? Message-ID: Hello Matplotlib Developers! 1) Matplotlib has a Clipping capability, but the "clipped" out areas use the same zorder, therefore rendering several overlapping polygonal shapes visible based on their zorder does not work in the areas where clipping was used to render one of them. 2) If it were possible to "reset" the zorder of a given pixel color (our background color) at any time while rendering, then we would have resolved the issue with clipping. We would not even need clipping as we could just use a given zorder value for the parts that define our desired mask areas, and a lower zorder for the part to be clipped, and after rendering the part in question, we change the zorder of all the "white" pixels to a low zorder value, and we have the masking capability working ! If this is not possible with the current version of Matplotlib, please can you help me giving me the code needed ? Example for illustration (see attached snapshot figure): '''Example of two overlapping squares having arbitrary openings in them. In this example the opening is just two smaller overlapping square, but it can be anything. We want to paint the green and red squares so that we see what is behind the opening(s)''' import matplotlib.pyplot as plt fig, ax = plt.subplots(figsize=(6, 6)) # This is to test if a well ordered polygon with slits (to define holes) can be rendered quad_small = [(-0.2, -0.2), (-0.2, 0.2), (0.2, 0.2), (0.2, -0.2), (-0.2, -0.2)] quad1x1 = [(-1, 1.), (-1, -1.), (1, -1.), (1., 1.), (-1, 1.)] #Fill quad1x1 with green x11 = [coord[0] for coord in quad1x1] y11 = [coord[1] for coord in quad1x1] plt.fill(x11, y11, facecolor='green', zorder=5) '''Now make one or more holes, possibly overlapping holes, NOTE: if we use clipping to define the holes, Matplotlib sets the same zorder over all the clippped areas which was used. Also clipping does not work well with overlapping small squares. Would only work with nonoverlapping squares.''' xsq = [coord[0] for coord in quad_small] ysq = [coord[1] for coord in quad_small] plt.fill(xsq, ysq, facecolor='white', zorder=5) xsq = [coord[0]+0.2 for coord in quad_small] ysq = [coord[1]+0.2 for coord in quad_small] plt.fill(xsq, ysq, facecolor='white', zorder=5) '''At this point green and white openings have the same zorder=5. We would need a call to change the zorder of all the 'white' pixels to a lower value, say 3''' '''Now we want to render another polygon (red) with holes, but ONLY on areas not covered by the previous rendering, we use a lower zorder so that we do not paint on the green part''' x11 = [coord[0]+0.3 for coord in quad1x1] y11 = [coord[1]+0.3 for coord in quad1x1] plt.fill(x11, y11, facecolor='red', zorder=4) xsq = [coord[0]+0.3 for coord in quad_small] ysq = [coord[1]+0.3 for coord in quad_small] plt.fill(xsq, ysq, facecolor='white', zorder=4) xsq = [coord[0]+0.5 for coord in quad_small] ysq = [coord[1]+0.5 for coord in quad_small] plt.fill(xsq, ysq, facecolor='white', zorder=4) '''The hole (white area) of the green square is not painted in red because the zorder of the white area is higher''' plt.show() Schlumberger-Private -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: squares.gif Type: image/gif Size: 6593 bytes Desc: squares.gif URL: From CBaumann at slb.com Mon Sep 23 14:05:46 2019 From: CBaumann at slb.com (Carlos Baumann) Date: Mon, 23 Sep 2019 18:05:46 +0000 Subject: [Matplotlib-devel] [Ext] Re: Masking in Matplotlib - Resetting the zorder of all pixels depending on their color value ? In-Reply-To: <6aaa0781-888e-4bcc-b15a-ff5169b95cb8@ruetz-online.de> References: <6aaa0781-888e-4bcc-b15a-ff5169b95cb8@ruetz-online.de> Message-ID: You used a single square to define the opening ! Try with the hole defined with "overlapping quads" as I used in my original example, and look at what happens in the area defined by the overlapping little quads. Schlumberger-Private From: Elan Ernest Sent: Monday, September 23, 2019 12:55 PM To: Carlos Baumann ; matplotlib-devel at python.org Subject: [Ext] Re: [Matplotlib-devel] Masking in Matplotlib - Resetting the zorder of all pixels depending on their color value ? Xref: https://stackoverflow.com/questions/58053011/matplotlib-masking-resetting-the-zorder-of-pixels-depending-on-their-current-c I gave an answer over there. Am 23.09.2019 um 19:12 schrieb Carlos Baumann via Matplotlib-devel: Hello Matplotlib Developers! 1) Matplotlib has a Clipping capability, but the "clipped" out areas use the same zorder, therefore rendering several overlapping polygonal shapes visible based on their zorder does not work in the areas where clipping was used to render one of them. 2) If it were possible to "reset" the zorder of a given pixel color (our background color) at any time while rendering, then we would have resolved the issue with clipping. We would not even need clipping as we could just use a given zorder value for the parts that define our desired mask areas, and a lower zorder for the part to be clipped, and after rendering the part in question, we change the zorder of all the "white" pixels to a low zorder value, and we have the masking capability working ! If this is not possible with the current version of Matplotlib, please can you help me giving me the code needed ? Example for illustration (see attached snapshot figure): '''Example of two overlapping squares having arbitrary openings in them. In this example the opening is just two smaller overlapping square, but it can be anything. We want to paint the green and red squares so that we see what is behind the opening(s)''' import matplotlib.pyplot as plt fig, ax = plt.subplots(figsize=(6, 6)) # This is to test if a well ordered polygon with slits (to define holes) can be rendered quad_small = [(-0.2, -0.2), (-0.2, 0.2), (0.2, 0.2), (0.2, -0.2), (-0.2, -0.2)] quad1x1 = [(-1, 1.), (-1, -1.), (1, -1.), (1., 1.), (-1, 1.)] #Fill quad1x1 with green x11 = [coord[0] for coord in quad1x1] y11 = [coord[1] for coord in quad1x1] plt.fill(x11, y11, facecolor='green', zorder=5) '''Now make one or more holes, possibly overlapping holes, NOTE: if we use clipping to define the holes, Matplotlib sets the same zorder over all the clippped areas which was used. Also clipping does not work well with overlapping small squares. Would only work with nonoverlapping squares.''' xsq = [coord[0] for coord in quad_small] ysq = [coord[1] for coord in quad_small] plt.fill(xsq, ysq, facecolor='white', zorder=5) xsq = [coord[0]+0.2 for coord in quad_small] ysq = [coord[1]+0.2 for coord in quad_small] plt.fill(xsq, ysq, facecolor='white', zorder=5) '''At this point green and white openings have the same zorder=5. We would need a call to change the zorder of all the 'white' pixels to a lower value, say 3''' '''Now we want to render another polygon (red) with holes, but ONLY on areas not covered by the previous rendering, we use a lower zorder so that we do not paint on the green part''' x11 = [coord[0]+0.3 for coord in quad1x1] y11 = [coord[1]+0.3 for coord in quad1x1] plt.fill(x11, y11, facecolor='red', zorder=4) xsq = [coord[0]+0.3 for coord in quad_small] ysq = [coord[1]+0.3 for coord in quad_small] plt.fill(xsq, ysq, facecolor='white', zorder=4) xsq = [coord[0]+0.5 for coord in quad_small] ysq = [coord[1]+0.5 for coord in quad_small] plt.fill(xsq, ysq, facecolor='white', zorder=4) '''The hole (white area) of the green square is not painted in red because the zorder of the white area is higher''' plt.show() Schlumberger-Private _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel at python.org https://mail.python.org/mailman/listinfo/matplotlib-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From elch.rz at ruetz-online.de Mon Sep 23 13:54:56 2019 From: elch.rz at ruetz-online.de (Elan Ernest) Date: Mon, 23 Sep 2019 19:54:56 +0200 Subject: [Matplotlib-devel] Masking in Matplotlib - Resetting the zorder of all pixels depending on their color value ? In-Reply-To: References: Message-ID: <6aaa0781-888e-4bcc-b15a-ff5169b95cb8@ruetz-online.de> Xref: https://stackoverflow.com/questions/58053011/matplotlib-masking-resetting-the-zorder-of-pixels-depending-on-their-current-c I gave an answer over there. Am 23.09.2019 um 19:12 schrieb Carlos Baumann via Matplotlib-devel: > > Hello Matplotlib Developers! > > 1) Matplotlib has a Clipping capability, but the "clipped" out areas > use the same zorder, > > therefore rendering several overlapping polygonal shapes visible based > on their zorder > > does not work in the areas where clipping was used to render one of them. > > 2) If it were possible to "reset" the zorder of a given pixel color > (our background color) at any time while rendering, then we would have > resolved > > the issue with clipping. We would not even need clipping as we could > just use a given zorder value for the parts that define our desired > mask areas, > > and a lower zorder for the part to be clipped, and after rendering the > part in question, we change the zorder of all the "white" pixels to a low > > zorder value, and we have the masking capability working ! > > If this is not possible with the current version of Matplotlib, please > can you help me giving me the code needed ? > > Example for illustration (see attached snapshot figure): > > '''Example of two overlapping squares having arbitrary openings in them. > > In this example the opening is just two smaller overlapping square, > but it can be anything. > > We want to paint the green and red squares so that we see what is > behind the opening(s)''' > > import matplotlib.pyplot as plt > > fig, ax = plt.subplots(figsize=(6, 6)) > > # This is to test if a well ordered polygon with slits (to define > holes) can be rendered > > quad_small = [(-0.2, -0.2), (-0.2, 0.2), (0.2, 0.2), (0.2, -0.2), > (-0.2, -0.2)] > > quad1x1 = [(-1, 1.), (-1, -1.), (1, -1.), (1., 1.), (-1, 1.)] > > #Fill quad1x1 with green > > x11 = [coord[0] for coord in quad1x1] > > y11 = [coord[1] for coord in quad1x1] > > plt.fill(x11, y11, facecolor='green', zorder=5) > > '''Now make one or more holes, possibly overlapping holes, > > NOTE: if we use clipping to define the holes, Matplotlib sets the same > zorder over all the clippped areas > > which was used. Also clipping does not work well with overlapping > small squares. Would only work with nonoverlapping > > squares.''' > > xsq = [coord[0] for coord in quad_small] > > ysq = [coord[1] for coord in quad_small] > > plt.fill(xsq, ysq, facecolor='white', zorder=5) > > xsq = [coord[0]+0.2 for coord in quad_small] > > ysq = [coord[1]+0.2 for coord in quad_small] > > plt.fill(xsq, ysq, facecolor='white', zorder=5) > > '''At this point green and white openings have the same zorder=5. > > We would need a call to change the zorder of all the 'white' pixels to > a lower value, say 3''' > > '''Now we want to render another polygon (red) with holes, but ONLY on > areas not covered by the previous rendering, > > we use a lower zorder so that we do not paint on the green part''' > > x11 = [coord[0]+0.3 for coord in quad1x1] > > y11 = [coord[1]+0.3 for coord in quad1x1] > > plt.fill(x11, y11, facecolor='red', zorder=4) > > xsq = [coord[0]+0.3 for coord in quad_small] > > ysq = [coord[1]+0.3 for coord in quad_small] > > plt.fill(xsq, ysq, facecolor='white', zorder=4) > > xsq = [coord[0]+0.5 for coord in quad_small] > > ysq = [coord[1]+0.5 for coord in quad_small] > > plt.fill(xsq, ysq, facecolor='white', zorder=4) > > '''The hole (white area) of the green square is not painted in red > because the zorder of the white area is higher''' > > plt.show() > > > Schlumberger-Private > > > _______________________________________________ > Matplotlib-devel mailing list > Matplotlib-devel at python.org > https://mail.python.org/mailman/listinfo/matplotlib-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From rob.a.mcdonald at gmail.com Mon Sep 23 23:56:22 2019 From: rob.a.mcdonald at gmail.com (Rob McDonald) Date: Mon, 23 Sep 2019 20:56:22 -0700 Subject: [Matplotlib-devel] What is draw_path's transform's destination? In-Reply-To: References: Message-ID: Tom, Sorry it has taken a while for me to come back to this, but better late than never. I've attached what I came up with. This is essentially my first foray into Python, so it likely has some warts beyond not being very Pythonic. I haven't been able to get a local matplotlib build environment working -- so these aren't properly integrated into patheffects.py and test_patheffects.py. I'm somewhat skeptical that you will want to introduce dependencies on scipy (1D interpolation) but I also didn't want to reinvent the wheel here. Perhaps matplotlib has a 1D interpolator buried someplace. Rob P.S. Nathan and Steph say hi. On Sat, Mar 30, 2019 at 9:12 PM Thomas Caswell wrote: > The transform is from whatever coordinates the path is in to pixels. > > From skimming the code on `Line2D` (and from the name) it looks like it is > only the affine part of the path transformation. > > Looking at the method `_offset_transform` in the base class also supports > the target coordinate system of the transform is pixels. > > That is a pretty nifty tool, is it going to end up someplace public when > you are done? > > Tom > > On Sat, Mar 30, 2019 at 6:44 PM Rob McDonald > wrote: > >> I'm implementing a custom path effect by inheriting from >> AbstractPathEffect and implementing draw_path as instructed here >> . >> That link references RenderBase.draw_path >> to >> define the required interface. Unfortunately, I can't find anywhere in the >> associated documentation that tells me what the transform argument really >> entails. >> >> I've also read the transforms tutorial >> , >> and while that explains the pipeline and all the intermediate >> transformations, it doesn't really settle what I have available to me in >> draw_path. It is clear that I can use it to transform coordinates from >> data to something -- but I don't know what to. >> >> For the big picture -- I am implementing a path effect to allow drawing >> hatched lines similar to this >> , >> which I did years ago in Matlab. Years before that, I've also done this in >> Java Graphics2D by implementing a custom stroke. (The Java approach is >> more applicable to the path effect approach, but I can't point to that code >> online anywhere.) >> >> Anyway, I have things mostly working -- and I am using the transform to >> go from data coordinates to something that looks orthogonal and reasonable >> on-screen. So, for minimum functionality, it works. However, I want to >> give the user the ability to control the length and spacing of the hatches >> -- which is in a coordinate system after the transformation is applied. >> So, in order to document this thing, I need to know what it is. Or, if >> there is a way to get intermediate stages of the transformation pipeline, >> that would work too. >> >> As for the user interface -- it seems to make the most sense to specify >> the hatch length and spacing in terms of something similar to a line width >> (typically points) or a marker size. I'm new to Python and matplotlib -- >> what is the Pythonic unit a user would expect to specify this in (and how >> do I achieve that with what is available in draw_path)? >> >> Thanks, >> >> Rob >> _______________________________________________ >> Matplotlib-devel mailing list >> Matplotlib-devel at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-devel >> > > > -- > Thomas Caswell > tcaswell at gmail.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tickedstroke.py Type: text/x-python-script Size: 5183 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test_tickedstroke.py Type: text/x-python-script Size: 1447 bytes Desc: not available URL: