Versatility of the Plot
The code below in the Engee programming language is designed to plot two functions and using the Plots package.
x = 0:0.1:10
y1 = sin.(x)
y2 = cos.(x)
The purpose of the demonstration is to show the maximum number of possible settings for the appearance of the graph. This example covers almost the entire range of visualization available in the package, starting from basic settings such as color and line thickness, ending with complex design parameters such as grid, markers, transparency of elements and border design.
Thanks to the use of a large number of parameters, the graph becomes expressive and informative, allowing you to emphasize important aspects of the data. This approach is ideal for exploring in detail the possibilities of batch charting in Engee and achieving high-precision data visualization.
# Построение графика с максимальным количеством параметров
plot(x, y1, 
    label = "sin(x)",          # Подпись для легенды
    title = "График функций",  # Заголовок
    xlabel = "Ось X",         # Подпись оси X
    ylabel = "Ось Y",         # Подпись оси Y
    legend = :topright,       # Положение легенды (:none, :left, :right, :top, :bottom, :best)
    linewidth = 2,            # Толщина линии
    linestyle = :solid,       # Стиль линии (:solid, :dash, :dot, :dashdot)
    linecolor = :blue,        # Цвет линии (имя, HEX, RGB)
    marker = :circle,         # Маркер точек (:none, :circle, :square, :diamond и др.)
    markersize = 5,           # Размер маркера
    markercolor = :red,       # Цвет маркера
    markeralpha = 0.5,        # Прозрачность маркера (0-1)
    markerstrokewidth = 1,    # Толщина обводки маркера
    markerstrokecolor = :black, # Цвет обводки маркера
    seriesalpha = 0.8,        # Прозрачность всей серии (линии + маркеры)
    grid = true,              # Отображать сетку
    gridstyle = :dash,        # Стиль сетки
    gridalpha = 0.3,          # Прозрачность сетки
    minorgrid = false,        # Включить дополнительную сетку
    xlims = (0, 10),         # Границы оси X
    ylims = (-1.5, 1.5),     # Границы оси Y
    xticks = 0:1:10,         # Деления на оси X
    yticks = -1:0.5:1,       # Деления на оси Y
    framestyle = :box,       # Стиль рамки (:box, :axes, :origin, :zerolines, :grid)
    background_color = :white,# Цвет фона
    foreground_color = :black,# Цвет переднего плана (осей, текста)
    size = (800, 400),       # Размер графика в пикселях (ширина, высота)
    dpi = 100,               # Разрешение (точек на дюйм)
    colorbar = false,        # Показывать цветовую шкалу (для heatmap, contour)
    clims = (0, 1),          # Границы цветовой шкалы
    aspect_ratio = :auto,    # Соотношение осей (:auto, :equal, число)
    inset = (1, bbox(0.5, 0.5, 0.3, 0.3)), # Вставка (subplot)
    subplot = 1,             # Номер подграфика
    layout = @layout([a; b]),# Расположение графиков (используется с `plot!`)
    palette = :viridis,      # Цветовая палитра (:viridis, :plasma, :magma и др.)
    tickfontsize = 10,       # Размер шрифта делений
    guidefontsize = 12,      # Размер шрифта подписей осей
    legendfontsize = 10,     # Размер шрифта легенды
    titlefontsize = 14,      # Размер шрифта заголовка
    widen = true,            # Автоматически расширять границы осей
    reuse = false            # Переиспользовать текущий график
)
Next, add the second line (cos(x)) to an existing schedule using the method plot!(). Here are its key features:
- label="cos(x)": sets the line signature in the legend.
- linewidth=2: Sets the line thickness to two units.
- linestyle=:dash: makes the line dotted.
- linecolor=:green: Turns the line green.
This approach is convenient for adding new data to the same graph without repeating the overall configuration.
plot!(x, y2, 
    label = "cos(x)", 
    linewidth = 2, 
    linestyle = :dash, 
    linecolor = :green
)
We can also use savefig() - This feature is useful for saving graph images for later use outside the development environment, for example, for inclusion in reports, presentations or publication of articles, for example by specifying a file name. savefig("my_plot.png")— we will create a graph in a PNG file with the name "my_plot.png" in the current working directory.
Conclusion
In this example, we have shown the maximum number of possible settings for the appearance of the Plots graph.