Package: geg
Version: 2.0.6-1
Severity: normal

Dear Maintainer,

I tried to plot the function:
        f(x) = x * cos(x)^2
in the x range [-12, 12].

Let pi represents the Archimed's number  : 3.14159…
Some piece of the plot is missing between [-7*pi/2, -5*pi/2], [-3*pi/2, -pi/2],
[pi/2, 3*pi/2], etc

I inlcuded example to show this and the correct plot (using python3 +
matplotlib) :

- the sample program for geg : xsquarecosx.geg
- the incorrect plot : xsquarecosx_geg.pdf
- the python script using matplotlib : xsquarecosx.py
- the expecting correct result : xsquarecosx_matplotlib.png

Cheers



-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (900, 'unstable'), (100, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.5.3-e1 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages geg depends on:
ii  libatk1.0-0          2.20.0-1
ii  libc6                2.22-7
ii  libcairo2            1.14.6-1+b1
ii  libfontconfig1       2.11.0-6.4
ii  libfreetype6         2.6.3-3+b1
ii  libgdk-pixbuf2.0-0   2.34.0-1
ii  libglib2.0-0         2.48.1-1
ii  libgtk2.0-0          2.24.30-1.1
ii  libpango-1.0-0       1.40.1-1
ii  libpangocairo-1.0-0  1.40.1-1
ii  libpangoft2-1.0-0    1.40.1-1
ii  libx11-6             2:1.6.3-1
ii  libxext6             2:1.3.3-1

geg recommends no packages.

geg suggests no packages.

-- no debconf information
# geg data file
# all options can be changed within geg

toolbar = pictures_and_text
tooltips = on
print_as = pdf

xmin = -12.000000
xmax = 12.000000
ymin = -9.000000
ymax = 9.000000
tmin = 0.000000
tmax = 1.000000
amin = 0.000000
amax = 6.283185

graph_width = 1024
graph_height = 768
axes_lw = 0.4
grid_lw = 0.3
box_lw = 0.4
curves_lw = 0.5
point_radius = 1
coordinates_type = decimal
mode_type = cartesian
zoom_xy = 3

zoom_factor = 0.100000
notch_spacing = 45
minimum_resolution = 0.000100
maximum_resolution = 10000.000000
interpolation_factor = 4
maximum_formulas = 100

do_Ox = 1
do_Oy = 1
do_xval = 1
do_yval = 1
do_color = 1
do_box = 0

# positions: 0=top left, 1=top right, 2=bottom left, 3=bottom right 
text_position = 2
formula_size = 20
number_size = 12

utility_editor = emacs
utility_eps_viewer = evince
utility_pdf_viewer = evince
utility_eps_to_pdf = ps2pdf -dEPSCrop -dPDFSETTINGS=/prepress
utility_svg_viewer = inkscape
utility_eps_to_svg = eps2svg

color[0] = { 1.000000, 1.000000, 1.000000 }
color[1] = { 0.500000, 0.600000, 0.700000 }
color[2] = { 0.800000, 0.700000, 0.600000 }
color[3] = { 0.800000, 0.800000, 0.800000 }
color[4] = { 0.200000, 0.800000, 0.400000 }
color[5] = { 0.500000, 0.500000, 0.500000 }
color[6] = { 0.000000, 0.000000, 0.000000 }
color[7] = { 0.800000, 0.000000, 0.000000 }
color[8] = { 0.000000, 0.000000, 0.800000 }
color[9] = { 0.000000, 0.800000, 0.000000 }
color[10] = { 0.800000, 0.800000, 0.000000 }
color[11] = { 0.800000, 0.000000, 0.800000 }
color[12] = { 0.000000, 0.800000, 0.800000 }
color[13] = { 0.400000, 0.400000, 0.400000 }
color[14] = { 0.000000, 0.000000, 0.000000 }

end_parameters

# Formulas
x*cos(x)^2

Attachment: xsquarecosx_geg.pdf
Description: Adobe PDF document

#! /usr/bin/python3
# -*- coding: UTF-8 -*-
import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(-12, 12, 500)
plt.plot(x, x * np.cos(x) ** 2)
plt.grid(axis='both')
plt.axis([-12, 12, -10, 10])
plt.title('Function f(x)=x*cos(x)**2')
plt.show()

Reply via email to