简体   繁体   English

朱莉娅:颜色条的牛虻大小

[英]Julia: Gadfly size of colorbar

I'm currently trying to dive deeper into Gadfly.jl for plotting in Julia.我目前正在尝试更深入地研究 Gadfly.jl,以便在 Julia 中进行绘图。 I made a plot of a few stations on a map showing daily precipitation sums, but I'm rather unhappy with the size of the colorbar.我在地图上绘制了几个站点的图,显示了每日降水量总和,但我对颜色条的大小很不满意。 I couldn't find a way to manipulate the size of the colorbar in the documentation.我找不到在文档中操作颜色栏大小的方法。 Does anyone know how to do this?有谁知道如何做到这一点?

Here is the plotted map:这是绘制的地图:

这是绘制的地图

Use themes to change the style of the colour bar.使用主题更改颜色栏的样式。

The simplest way just to change the font size of the key label and the title (RRsum on your image).最简单的方法就是更改键标签和标题的字体大小(图像上的 RRsum)。 Eg add Theme(key_label_font_size=12pt, key_title_font_size=12pt) argument to your plot call.例如,将Theme(key_label_font_size=12pt, key_title_font_size=12pt)参数添加到您的绘图调用中。

For example:例如:

  • Smaller colorbar:较小的颜色条:
plot(
    z=(x,y) -> x*exp(-(x-round(Int, x))^2-y^2),
    x=range(-8,stop=8,length=150),
    y=range(-2, stop=2,length=150),
    Geom.contour,
    Theme(key_label_font_size=10pt, key_title_font_size=10pt)
)

Smaller colorbar较小的颜色条

  • Bigger colorbar:更大的颜色条:
plot(
    z=(x,y) -> x*exp(-(x-round(Int, x))^2-y^2),
    x=range(-8,stop=8,length=150),
    y=range(-2, stop=2,length=150),
    Geom.contour,
    Theme(key_label_font_size=15pt, key_title_font_size=15pt)
)

Bigger colorbar更大的颜色条

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM