[Matplotlib-users] some problems

Vincent Douce Mathoscope mathoscope at netcourrier.com
Fri Apr 6 00:29:46 EDT 2018


hi
i am workind on the thread "filling"
since a cuple of months i did not use Matplotlib
i have difficulties to get comfortable with simple lines of code
for example (end of this mail)
- why do the circle appear so big whereas the dimension of the picture are [0,5] for x and for y and the radius of the circle is 0.05 ?
- why, if i cancel the paragraph named "oeil......", do the circle disappear ?
thanks for your help...


figur generated :



lines of code :
-----
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl

# quelques paramètres par défaut
plt.style.use('bmh')
mpl.rcParams['font.family'] = 'STIXGeneral'
plt.rcParams["font.size"] = 10

# dimensions à choisir
xmin,xmax,ymin,ymax=0,5,0,5
(L,l)=(7,7)

# fenetrages divers
Linch,linch=(L/2.54,l/2.54)
fig, lafigure = plt.subplots(figsize=(Linch,linch))
Lx,x,Ly,y=[],xmin,[],ymin
while (x<=xmax):
    Lx.append(x)
    x+=1
while (y<=ymax):
    Ly.append(y)
    y+=1

#oeil.............
X1 = np.linspace(1-np.sqrt(2),1+np.sqrt(2), 256,endpoint=True)
Y1 = np.sqrt(2-X1**2)
lafigure.plot(X1, Y1, color="black", linewidth=0.5, linestyle="-")
lafigure.plot(X1, 1-Y1, color="black", linewidth=0.5, linestyle="-")

# tracé d'un cercle
r=0.05
lafigure.add_patch(mpl.patches.Circle((r, r),1,color ='black', linewidth=0.5, fill=False,linestyle="--"))

plt.axis('off')
lafigure.spines['right'].set_visible(True)
plt.show()

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180406/04c74b37/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-7.png
Type: image/png
Size: 42418 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180406/04c74b37/attachment-0001.png>


More information about the Matplotlib-users mailing list