着色图中标题的一部分 [英] Colorize parts of the title in a plot

查看:143
本文介绍了着色图中标题的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在地块中对标题的某些部分进行着色?

Is it possible to colorize parts of the title in a plot?

x = 1:10
y = 1:10
plot(x, y, main="title (slope=1)")

在此图中,我想将 slope = 1 的颜色更改为红色。

In this plot I'd like to change the color of slope=1 to red.

推荐答案

这是一个很简单的解决你的问题:

This is a quite simple solution to your problem:

plot(x, y)
title(expression("title (" * phantom("slope=1)") * ")"), col.main = "black")
title(expression(phantom("title (") * "slope=1"), col.main = "red")

这篇关于着色图中标题的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆