怎么调整Makie的label大小

想调整label的大小怎么调整呢,谢谢!

	x = range(0, 10, length=100)
	y = sin.(x)
	lines(x, y, axis=(; xlabel = "x", ylabel = "y"))

文档:https://makie.juliaplots.org/stable/examples/layoutables/legend/index.html

patchsize 可能是你想要的?

或者试试 Legend size 相关参数,titlesize, markersize, labelsize等:

help?> Legend
search: Legend LegendEntry LegendElement axislegend LineSegments linesegments linesegments! GeneralizedEigen available_gradients plot_energy_potential

  Legend has the following attributes:

  alignmode
  Default: Inside()
  The align mode of the legend in its parent GridLayout.

  bgcolor
  Default: :white
  The background color of the legend.

  colgap
  Default: 16
  The gap between the label of one legend entry and the patch of the next.

  framecolor
  Default: :black
  The color of the legend border.

  framevisible
  Default: true
  Controls if the legend border is visible.

  framewidth
  Default: 1.0
  The line width of the legend border.

  gridshalign
  Default: :center
  The horizontal alignment of entry groups in their parent GridLayout.

  gridsvalign
  Default: :center
  The vertical alignment of entry groups in their parent GridLayout.

  groupgap
  Default: 16
  The gap between each group and the next.

  halign
  Default: :center
  The horizontal alignment of the legend in its suggested bounding box.

  height
  Default: Auto()
  The height setting of the legend.

  label
  Default: "undefined"
  The default entry label.

  labelcolor
  Default: lift_parent_attribute(scene, :textcolor, :black)
  The color of the entry labels.

  labelfont
  Default: lift_parent_attribute(scene, :font, "DejaVu Sans")
  The font family of the entry labels.

  labelhalign
  Default: :left
  The horizontal alignment of the entry labels.

  labelsize
  Default: lift_parent_attribute(scene, :fontsize, 16.0f0)
  The font size of the entry labels.

  labelvalign
  Default: :center
  The vertical alignment of the entry labels.

  linecolor
  Default: theme(scene, :linecolor)
  The default line color used for LineElements

  linepoints
  Default: [Point2f(0, 0.5), Point2f(1, 0.5)]
  The default points used for LineElements in normalized coordinates relative to each label patch.

  linestyle
  Default: :solid
  The default line style used for LineElements

  linewidth
  Default: theme(scene, :linewidth)
  The default line width used for LineElements.

  margin
  Default: (0.0f0, 0.0f0, 0.0f0, 0.0f0)
  The additional space between the legend and its suggested boundingbox.

  marker
  Default: theme(scene, :marker)
  The default marker for MarkerElements

  markercolor
  Default: theme(scene, :markercolor)
  The default marker color for MarkerElements

  markerpoints
  Default: [Point2f(0.5, 0.5)]
  The default marker points used for MarkerElements in normalized coordinates relative to each label patch.

  markersize
  Default: theme(scene, :markersize)
  The default marker size used for MarkerElements.

  markerstrokecolor
  Default: theme(scene, :markerstrokecolor)
  The default marker stroke color used for MarkerElements.

  markerstrokewidth
  Default: theme(scene, :markerstrokewidth)
  The default marker stroke width used for MarkerElements.

  nbanks
  Default: 1
  The number of banks in which the legend entries are grouped. Columns if the legend is vertically oriented, otherwise rows.

  orientation
  Default: :vertical
  The orientation of the legend (:horizontal or :vertical).

  padding
  Default: (10.0f0, 10.0f0, 8.0f0, 8.0f0)
  The additional space between the legend content and the border.

  patchcolor
  Default: :transparent
  The color of the patches containing the legend markers.

  patchlabelgap
  Default: 5
  The gap between the patch and the label of each legend entry.

  patchsize
  Default: (20.0f0, 20.0f0)
  The size of the rectangles containing the legend markers.

  patchstrokecolor
  Default: :transparent
  The color of the border of the patches containing the legend markers.

  patchstrokewidth
  Default: 1.0
  The line width of the border of the patches containing the legend markers.

  polycolor
  Default: theme(scene, :patchcolor)
  The default poly color used for PolyElements.

  polypoints
  Default: [Point2f(0, 0), Point2f(1, 0), Point2f(1, 1), Point2f(0, 1)]
  The default poly points used for PolyElements in normalized coordinates relative to each label patch.

  polystrokecolor
  Default: theme(scene, :patchstrokecolor)
  The default poly stroke color used for PolyElements.

  polystrokewidth
  Default: theme(scene, :patchstrokewidth)
  The default poly stroke width used for PolyElements.

  rowgap
  Default: 3
  The gap between the entry rows.

  tellheight
  Default: automatic
  Controls if the parent layout can adjust to this element's height

  tellwidth
  Default: automatic
  Controls if the parent layout can adjust to this element's width

  titlecolor
  Default: lift_parent_attribute(scene, :textcolor, :black)
  The color of the legend titles

  titlefont
  Default: lift_parent_attribute(scene, :font, "DejaVu Sans")
  The font family of the legend group titles.

  titlegap
  Default: 8
  The gap between each group title and its group.

  titlehalign
  Default: :center
  The horizontal alignment of the legend group titles.

  titleposition
  Default: :top
  The group title positions relative to their groups. Can be :top or :left.

  titlesize
  Default: lift_parent_attribute(scene, :fontsize, 16.0f0)
  The font size of the legend group titles.

  titlevalign
  Default: :center
  The vertical alignment of the legend group titles.

  titlevisible
  Default: true
  Controls if the legend titles are visible.

  valign
  Default: :center
  The vertical alignment of the legend in its suggested bounding box.

  width
  Default: Auto()
  The width setting of the legend.

这个好像是legend,我想调整xlabel和ylabel :joy:

using GLMakie

x = range(0, 10, length=100)
y = sin.(x)
lines(x, y, axis=(; xlabel = "x", ylabel = "y", xlabelsize=40)
1 个赞