From luca72.bertolotti at gmail.com Mon Nov 2 08:02:08 2020 From: luca72.bertolotti at gmail.com (Luca Bertolotti) Date: Mon, 2 Nov 2020 14:02:08 +0100 Subject: [Matplotlib-users] Arc drawing Message-ID: Hello i have to draw an arc with matplotlib, i have the following data: {'handle': '39D', 'owner': '1F', 'layer': 'AM_0', 'center': Vector(1000.0, -1256.595067376733, 0.0), 'radius': 2100.0, 'start_angle': 67.75727639121727, 'end_angle': 112.2427236087827} basically i have : Center of the arc Starting angle end angle. Do you have any suggestion Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Mon Nov 2 11:07:33 2020 From: pmhobson at gmail.com (Paul Hobson) Date: Mon, 2 Nov 2020 08:07:33 -0800 Subject: [Matplotlib-users] Arc drawing In-Reply-To: References: Message-ID: Hey Luca, Matplotllib has an Arc artist: https://matplotlib.org/3.3.2/api/_as_gen/matplotlib.patches.Arc.html -Paul On Mon, Nov 2, 2020 at 5:02 AM Luca Bertolotti wrote: > Hello i have to draw an arc with matplotlib, i have the following data: > > {'handle': '39D', 'owner': '1F', 'layer': 'AM_0', 'center': Vector(1000.0, > -1256.595067376733, 0.0), 'radius': 2100.0, 'start_angle': > 67.75727639121727, 'end_angle': 112.2427236087827} > basically i have : > Center of the arc > Starting angle > end angle. > Do you have any suggestion > > Regards > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Mon Nov 2 11:46:56 2020 From: pmhobson at gmail.com (Paul Hobson) Date: Mon, 2 Nov 2020 08:46:56 -0800 Subject: [Matplotlib-users] Arc drawing In-Reply-To: References: Message-ID: Hey Luca, You're referencing some variables in your snippet that you haven't defined, so I can't really help you troubleshoot that. Here's a basic example to get you started: from matplotlib import pyplot from matplotlib import patches fig, ax = pyplot.subplots() arc = patches.Arc( xy=(2, 3), width=5, height=5, angle=0, theta1=45, theta2=180, ) ax.add_patch(arc) ax.set_aspect('equal') ax.autoscale() On Mon, Nov 2, 2020 at 8:36 AM Luca Bertolotti wrote: > Hy Paul > I heve read it but i'm not able to draw it: > The data that i have are: > {'handle': '39D', 'owner': '1F', 'layer': 'AM_0', 'center': Vector(1000.0, > -1256.595067376733, 0.0), 'radius': 2100.0, 'start_angle': > 67.75727639121727, 'end_angle': 112.2427236087827} > > h= float(2* entity.dxf.radius) > > I have try this: > b = Arc((float(xr), float(yr)), (h, h),0, float(entity.dxf.end_angle), > float(entity.dxf.end_angle) , color='red', lw=1) > ax.add_patch(b) > > But i get: > Exception "unhandled TypeError" > can't multiply sequence by non-int of type 'float' > File: > c:\users\luca\appdata\local\programs\python\python38\lib\site-packages\matplotlib\patches.py, > Line: 1427 > > Can you help me > > Bets Regards > > Il giorno lun 2 nov 2020 alle ore 17:07 Paul Hobson > ha scritto: > >> Hey Luca, >> >> Matplotllib has an Arc artist: >> https://matplotlib.org/3.3.2/api/_as_gen/matplotlib.patches.Arc.html >> >> -Paul >> >> On Mon, Nov 2, 2020 at 5:02 AM Luca Bertolotti < >> luca72.bertolotti at gmail.com> wrote: >> >>> Hello i have to draw an arc with matplotlib, i have the following data: >>> >>> {'handle': '39D', 'owner': '1F', 'layer': 'AM_0', 'center': >>> Vector(1000.0, -1256.595067376733, 0.0), 'radius': 2100.0, 'start_angle': >>> 67.75727639121727, 'end_angle': 112.2427236087827} >>> basically i have : >>> Center of the arc >>> Starting angle >>> end angle. >>> Do you have any suggestion >>> >>> Regards >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From ndbecker2 at gmail.com Thu Nov 12 07:31:29 2020 From: ndbecker2 at gmail.com (Neal Becker) Date: Thu, 12 Nov 2020 07:31:29 -0500 Subject: [Matplotlib-users] prohibited to create memoryview without Py_buffer Message-ID: fedora-33 mplcairo-0.3 rpm -qa python3-matplotlib-* python3-matplotlib-tk-3.3.2-1.fc33.x86_64 python3-matplotlib-qt4-3.3.2-1.fc33.x86_64 python3-matplotlib-data-3.3.2-1.fc33.noarch python3-matplotlib-data-fonts-3.3.2-1.fc33.noarch python3-matplotlib-qt5-3.3.2-1.fc33.x86_64 This happened when I tried so save a plot to pdf using the gui. I got a dialog error box with the message: prohibited to create memoryview without Py_buffer -- *Those who don't understand recursion are doomed to repeat it* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ndbecker2 at gmail.com Thu Nov 12 07:40:44 2020 From: ndbecker2 at gmail.com (Neal Becker) Date: Thu, 12 Nov 2020 07:40:44 -0500 Subject: [Matplotlib-users] prohibited to create memoryview without Py_buffer In-Reply-To: References: Message-ID: 4 things: 1. this is python3.9 2. it is mplcairo. Selecting default backend save to pdf succeeds. 3. the message is coming from pybind11. 4. occurs when saving to pdf and svg, but not png (others not tested) On Thu, Nov 12, 2020 at 7:31 AM Neal Becker wrote: > fedora-33 > mplcairo-0.3 > rpm -qa python3-matplotlib-* > python3-matplotlib-tk-3.3.2-1.fc33.x86_64 > python3-matplotlib-qt4-3.3.2-1.fc33.x86_64 > python3-matplotlib-data-3.3.2-1.fc33.noarch > python3-matplotlib-data-fonts-3.3.2-1.fc33.noarch > python3-matplotlib-qt5-3.3.2-1.fc33.x86_64 > > This happened when I tried so save a plot to pdf using the gui. I got a > dialog error box with the message: > prohibited to create memoryview without Py_buffer > -- > *Those who don't understand recursion are doomed to repeat it* > -- *Those who don't understand recursion are doomed to repeat it* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ndbecker2 at gmail.com Thu Nov 12 08:16:18 2020 From: ndbecker2 at gmail.com (Neal Becker) Date: Thu, 12 Nov 2020 08:16:18 -0500 Subject: [Matplotlib-users] prohibited to create memoryview without Py_buffer In-Reply-To: References: Message-ID: Thanks for the quick response! I didn't realize mplcairo was packaged for fedora and have been using the local pip installed version. The fixed version is not yet pip installable? On Thu, Nov 12, 2020 at 8:09 AM Antony Lee wrote: > Thanks for the report. > I am aware of the issue and it has been fixed in mplcairo master (at > ddbc01c to be precise). This arose because a backwards-incompatible change > in the latest pybind11 (2.6.0) broke mplcairo. I am somewhat puzzled, > though, by how mplcairo managed to pass Fedora's CI (things broke locally > as well). > In any case mplcairo should be repackaged for Fedora 33 (attn. Elliott, I > guess :-) also, do you have an idea wrt. how mplcairo managed to pass the > tests on Fedora's CI?) using the current HEAD (or backporting just the > relevant commit, although that may not apply cleanly...) to support Py39. > (I may tag a new release too but no guarantees on the date for that.) > Antony > > On Thu, Nov 12, 2020 at 1:41 PM Neal Becker wrote: > >> 4 things: >> 1. this is python3.9 >> 2. it is mplcairo. Selecting default backend save to pdf succeeds. >> 3. the message is coming from pybind11. >> 4. occurs when saving to pdf and svg, but not png (others not tested) >> >> On Thu, Nov 12, 2020 at 7:31 AM Neal Becker wrote: >> >>> fedora-33 >>> mplcairo-0.3 >>> rpm -qa python3-matplotlib-* >>> python3-matplotlib-tk-3.3.2-1.fc33.x86_64 >>> python3-matplotlib-qt4-3.3.2-1.fc33.x86_64 >>> python3-matplotlib-data-3.3.2-1.fc33.noarch >>> python3-matplotlib-data-fonts-3.3.2-1.fc33.noarch >>> python3-matplotlib-qt5-3.3.2-1.fc33.x86_64 >>> >>> This happened when I tried so save a plot to pdf using the gui. I got a >>> dialog error box with the message: >>> prohibited to create memoryview without Py_buffer >>> -- >>> *Those who don't understand recursion are doomed to repeat it* >>> >> >> >> -- >> *Those who don't understand recursion are doomed to repeat it* >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > -- *Those who don't understand recursion are doomed to repeat it* -------------- next part -------------- An HTML attachment was scrubbed... URL: From antony.lee at institutoptique.fr Thu Nov 12 09:33:16 2020 From: antony.lee at institutoptique.fr (Antony Lee) Date: Thu, 12 Nov 2020 15:33:16 +0100 Subject: [Matplotlib-users] prohibited to create memoryview without Py_buffer In-Reply-To: References: Message-ID: You need to install from master, e.g. `pip install git+ https://github.com/matplotlib/mplcairo`. Otherwise you get the version from PyPI, which is the last release (0.3.0), which was not marked as not compatible with Py3.9 given that Py3.9 had not been released yet at that point and that I therefore did not know it would require pybind11 2.6.0 and would be compatible :-) Antony On Thu, Nov 12, 2020 at 2:16 PM Neal Becker wrote: > Thanks for the quick response! > > I didn't realize mplcairo was packaged for fedora and have been using the > local pip installed version. The fixed version is not yet pip installable? > > On Thu, Nov 12, 2020 at 8:09 AM Antony Lee > wrote: > >> Thanks for the report. >> I am aware of the issue and it has been fixed in mplcairo master (at >> ddbc01c to be precise). This arose because a backwards-incompatible change >> in the latest pybind11 (2.6.0) broke mplcairo. I am somewhat puzzled, >> though, by how mplcairo managed to pass Fedora's CI (things broke locally >> as well). >> In any case mplcairo should be repackaged for Fedora 33 (attn. Elliott, I >> guess :-) also, do you have an idea wrt. how mplcairo managed to pass the >> tests on Fedora's CI?) using the current HEAD (or backporting just the >> relevant commit, although that may not apply cleanly...) to support Py39. >> (I may tag a new release too but no guarantees on the date for that.) >> Antony >> >> On Thu, Nov 12, 2020 at 1:41 PM Neal Becker wrote: >> >>> 4 things: >>> 1. this is python3.9 >>> 2. it is mplcairo. Selecting default backend save to pdf succeeds. >>> 3. the message is coming from pybind11. >>> 4. occurs when saving to pdf and svg, but not png (others not tested) >>> >>> On Thu, Nov 12, 2020 at 7:31 AM Neal Becker wrote: >>> >>>> fedora-33 >>>> mplcairo-0.3 >>>> rpm -qa python3-matplotlib-* >>>> python3-matplotlib-tk-3.3.2-1.fc33.x86_64 >>>> python3-matplotlib-qt4-3.3.2-1.fc33.x86_64 >>>> python3-matplotlib-data-3.3.2-1.fc33.noarch >>>> python3-matplotlib-data-fonts-3.3.2-1.fc33.noarch >>>> python3-matplotlib-qt5-3.3.2-1.fc33.x86_64 >>>> >>>> This happened when I tried so save a plot to pdf using the gui. I got >>>> a dialog error box with the message: >>>> prohibited to create memoryview without Py_buffer >>>> -- >>>> *Those who don't understand recursion are doomed to repeat it* >>>> >>> >>> >>> -- >>> *Those who don't understand recursion are doomed to repeat it* >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >> > > -- > *Those who don't understand recursion are doomed to repeat it* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From antony.lee at institutoptique.fr Thu Nov 12 08:09:31 2020 From: antony.lee at institutoptique.fr (Antony Lee) Date: Thu, 12 Nov 2020 14:09:31 +0100 Subject: [Matplotlib-users] prohibited to create memoryview without Py_buffer In-Reply-To: References: Message-ID: Thanks for the report. I am aware of the issue and it has been fixed in mplcairo master (at ddbc01c to be precise). This arose because a backwards-incompatible change in the latest pybind11 (2.6.0) broke mplcairo. I am somewhat puzzled, though, by how mplcairo managed to pass Fedora's CI (things broke locally as well). In any case mplcairo should be repackaged for Fedora 33 (attn. Elliott, I guess :-) also, do you have an idea wrt. how mplcairo managed to pass the tests on Fedora's CI?) using the current HEAD (or backporting just the relevant commit, although that may not apply cleanly...) to support Py39. (I may tag a new release too but no guarantees on the date for that.) Antony On Thu, Nov 12, 2020 at 1:41 PM Neal Becker wrote: > 4 things: > 1. this is python3.9 > 2. it is mplcairo. Selecting default backend save to pdf succeeds. > 3. the message is coming from pybind11. > 4. occurs when saving to pdf and svg, but not png (others not tested) > > On Thu, Nov 12, 2020 at 7:31 AM Neal Becker wrote: > >> fedora-33 >> mplcairo-0.3 >> rpm -qa python3-matplotlib-* >> python3-matplotlib-tk-3.3.2-1.fc33.x86_64 >> python3-matplotlib-qt4-3.3.2-1.fc33.x86_64 >> python3-matplotlib-data-3.3.2-1.fc33.noarch >> python3-matplotlib-data-fonts-3.3.2-1.fc33.noarch >> python3-matplotlib-qt5-3.3.2-1.fc33.x86_64 >> >> This happened when I tried so save a plot to pdf using the gui. I got a >> dialog error box with the message: >> prohibited to create memoryview without Py_buffer >> -- >> *Those who don't understand recursion are doomed to repeat it* >> > > > -- > *Those who don't understand recursion are doomed to repeat it* > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ndbecker2 at gmail.com Fri Nov 13 08:53:05 2020 From: ndbecker2 at gmail.com (Neal Becker) Date: Fri, 13 Nov 2020 08:53:05 -0500 Subject: [Matplotlib-users] Title overwriting axis label Message-ID: The plot is produced by the following code: import matplotlib.pyplot as plt ax = plt.gca() ax.ticklabel_format(style='sci', scilimits=(-3,3), axis='y') ax.ticklabel_format(style='sci', scilimits=(-3,3), axis='x') plt.plot (np.arange (start=0, stop=len(freq)*opt.segment, step=opt.segment), freq) plt.xlabel ('time(symbols)') plt.title (r'$E_s/N_0=%s, \alpha=%s, \omega_n=%s, \Delta_f=%s$ mod=%s'%(opt.esnodB, opt.alpha, latex_float(opt.omega_n), opt.freq, opt.mod)) plt.ylabel ('freq(cycle/sym)') plt.tight_layout() Any suggestions how to prevent this overlap of the title and the axis label? This is mpl-3.3.3 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test_btr_iir.py,sym=1e-5,alpha=0.05,esno=0,mod=qpsk,loop=2nd,omega=3.5e-6,df=9e-4.pdf Type: application/pdf Size: 366604 bytes Desc: not available URL: From story645 at gmail.com Sun Nov 15 15:58:14 2020 From: story645 at gmail.com (Hannah) Date: Sun, 15 Nov 2020 15:58:14 -0500 Subject: [Matplotlib-users] Finalizing Code of Conduct Message-ID: Hello community, We have been revising our code of conduct and settled on using the latest form of the contributor covenant with some minor customization for reporting: https://github.com/matplotlib/matplotlib/pull/18802 We chose this code of conduct based on these criteria: 1) lists the behaviors we think are appropriate and inappropriate 2) includes reporting and enforcement mechanisms 3) clear and concise We are seeking holistic feedback on whether this new CoC is an accurate statement of the behavior we expect in Matplotlib, our expectations are in line with yours, and if there are significant issues with the text, Please refrain from wordsmithing; we think that most problems are likely an issue with the philosophy of the CoC and not solvable via changing some words (plus or minus the reporting and enforcement sections). We will be taking feedback for the next week (deadline Tuesday Nov 24th, 3:00PM EST) on the mailing list, discourse, pull request, and in private as appropriate. Thank you, Hannah -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.appel17 at imperial.ac.uk Sat Nov 21 19:18:07 2020 From: t.appel17 at imperial.ac.uk (Thibaut Appel) Date: Sun, 22 Nov 2020 01:18:07 +0100 Subject: [Matplotlib-users] Set text.latex.preamble in style sheet Message-ID: <08525efa-55fc-fccf-97e1-0ec8833b951c@imperial.ac.uk> Dear matplotlib developers, Suppose I define a style sheet 'foo.mplstyle' as text.usetex : True font.family? : serif and setting the LaTeX preamble in the following MWE: import numpy as np import matplotlib.pyplot as plt plt.rcParams["text.latex.preamble"] = r"\usepackage{newpxtext} \usepackage{eulervm}" plt.style.use('foo') x = np.linspace(0.0,1.0,50) y = x plt.plot(x,y) plt.show() This works fine with matplotlib 3.3.0. But the MWE fails when I try to set the LaTeX preamble directly in the style sheet. What's the correct syntax for 'text.latex.preamble'? I tried text.latex.preamble : r"\usepackage{newpxtext} \usepackage{eulervm}" text.latex.preamble : "\usepackage{newpxtext}, \usepackage{eulervm}" text.latex.preamble : \usepackage{newpxtext},\usepackage{eulervm} without success, despite seeing the API change notice about the parameter. System info: Ubuntu 20.10 Linux 5.8.0-29-generic x86_64 matplotlib 3.3.0 installed with apt ghostscript 9.52 texlive 2020 Thanks for the support, Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.pagani at astrophysics.eu Mon Nov 23 07:38:46 2020 From: bruno.pagani at astrophysics.eu (Bruno Pagani) Date: Mon, 23 Nov 2020 16:38:46 +0400 Subject: [Matplotlib-users] Set text.latex.preamble in style sheet In-Reply-To: <08525efa-55fc-fccf-97e1-0ec8833b951c@imperial.ac.uk> References: <08525efa-55fc-fccf-97e1-0ec8833b951c@imperial.ac.uk> Message-ID: <489a7846-465a-05fb-d52b-b40018b4718f@astrophysics.eu> Hi Thibaut, Le 22/11/2020 ? 04:18, Thibaut Appel a ?crit?: > > Dear matplotlib developers, > > Suppose I define a style sheet 'foo.mplstyle' as > > text.usetex : True > font.family? : serif > > and setting the LaTeX preamble in the following MWE: > > import numpy as np > import matplotlib.pyplot as plt > > plt.rcParams["text.latex.preamble"] = r"\usepackage{newpxtext} > \usepackage{eulervm}" > > plt.style.use('foo') > > x = np.linspace(0.0,1.0,50) > y = x > > plt.plot(x,y) > plt.show() > > This works fine with matplotlib 3.3.0. > > But the MWE fails when I try to set the LaTeX preamble directly in the > style sheet. What's the correct syntax for 'text.latex.preamble'? I tried > > text.latex.preamble : r"\usepackage{newpxtext} \usepackage{eulervm}" > > text.latex.preamble : "\usepackage{newpxtext}, \usepackage{eulervm}" > > text.latex.preamble : \usepackage{newpxtext},\usepackage{eulervm} > > without success, despite seeing the API change notice > > about the parameter. The API change is about setting the variable at runtime, not in a configuration file. The correct format for those is: text.latex.preamble : \usepackage{newpxtext}\usepackage{eulervm} The difference with your solution is the absence of comma (those are allowed for separating options of packages only). For instance, mine: text.latex.preamble: \usepackage{mathtools}\usepackage{xfrac}\usepackage{siunitx}\usepackage[lining,proportional]{ebgaramond}\usepackage{ebgaramond-maths} Regards, Bruno -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.douce.mathoscope at netcourrier.com Mon Nov 30 07:52:43 2020 From: vincent.douce.mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Mon, 30 Nov 2020 13:52:43 +0100 Subject: [Matplotlib-users] tk and matplotlib Message-ID: hi i am creating a matplotlib draw (musical sales on a guitar) in function of some parameters (tonic note, type of gamme or chord...) i am now creating tk radio buttons so that the user can choose the parameters i can get these parameters and create the matplotlib picture with them but the matplotlib will open a different window would it be possible to have a same window, divided as a table, with at the lift the radio buttons, and at the right the matplotlib result ? ---- https://lemathoscope.com/ cours de maths postbac par visio -------------- next part -------------- An HTML attachment was scrubbed... URL: