Skip to content

Nodes get cut-off when ilabels_fontsize is set to large number. #196

@newptcai

Description

@newptcai

I have the following code to draw a directed graph with edge weights.

## Load the packages
using Random
using CairoMakie
using GraphMakie
using Graphs
using LaTeXStrings
using Colors

## Create a random directed graph
vnum = 4
enum = 6
ilabels = string.('a':'z')[1:vnum]
seed = 1234
g = erdos_renyi(4, 6, is_directed = true, seed = seed)
Random.seed!(seed)
elabels = LaTeXString.(string.(rand(1:10, enum)))

## Plot the data
font_size = 32
fig, ax, p = graphplot(
    g;
    ilabels = ilabels,
    ilabels_fontsize = font_size,
    elabels = elabels,
    elabels_fontsize = font_size,
    node_color = :orange,
    edge_color = :gray,
    edge_width = 4,
    node_strokewidth = 4,
    arrow_shift = :end,
    arrow_size = 40,
);
hidedecorations!(ax);
hidespines!(ax);
colsize!(fig.layout, 1, Aspect(1, 1.0));
resize_to_layout!(fig);
fig

Image

As you can see, the nodes in the picture gets cut off when they are too large. Is there any way to avoid this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions