網站首頁 編程語言 正文
本文使用基本的繪圖命令plot
、rect
、segments
、text
繪制一把長10厘米的直尺。話不多說上教程。
1、定義基本單位
xcm <- 0.07 ycm <- 0.07
2、首先使用plot繪制一個空白畫布
plot(0:1, 0:1, type = "n", axes = F, ann = F)
3、繪制一個灰色的底作為直尺的影子
rect(0 + 0.2*xcm,0 - 0.2*ycm,0.95 + 0.2*xcm,0.15 - 0.2*ycm, col="gray", border = NA)
4、繪制一個白的底作為直尺
rect(0,0,0.95,0.15, col = "white")
5、標注刻度
segments(seq(1,11,0.1)*xcm,0,seq(1,11,0.1)*xcm, c(rep(c(0.5, rep(0.25,4), 0.35,rep(0.25,4)), 10), 0.5)*ycm )
6、標注數字以及單位
text(1:11*xcm, 0.6*ycm,0:10,adj = c(0.5, 0)) text(11.3*xcm, 0.6*ycm,"cm",adj = c(0, 0))
這樣一個直尺就做好了
原文鏈接:https://blog.csdn.net/weixin_46111814/article/details/122374890
相關推薦
- 2022-08-31 Python無法用requests獲取網頁源碼的解決方法_python
- 2022-11-24 React?HOC高階組件深入講解_React
- 2022-02-21 django update_or_create 報錯GPUModel.MultipleObjects
- 2024-01-12 JPA實現不等于查詢
- 2022-12-26 python?QT界面關閉線程池的線程跟隨退出完美解決方案_python
- 2023-02-25 C++?move()函數及priority_queue隊列使用記錄_C 語言
- 2022-03-19 好用的C++?string?Format“函數”介紹_C 語言
- 2022-04-14 Python中五種列表拷貝的方法_python
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支