research-copilot 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +190 -0
- package/app/build/icon.icns +0 -0
- package/app/build/icon.ico +0 -0
- package/app/build/icon.png +0 -0
- package/app/out/main/index.mjs +6719 -0
- package/app/out/preload/index.js +141 -0
- package/app/out/renderer/assets/Inter-Variable-Latin-8kRkwJBP.woff2 +0 -0
- package/app/out/renderer/assets/Inter-Variable-LatinExt-B_-bZUTo.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/app/out/renderer/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/app/out/renderer/assets/MilkdownMarkdownEditor-bLPxrCVb.js +89821 -0
- package/app/out/renderer/assets/MilkdownMarkdownEditor-tTNRIB2K.css +2555 -0
- package/app/out/renderer/assets/Tableau10-BqnYsPR6.js +9 -0
- package/app/out/renderer/assets/apl-fqmucPXA.js +140 -0
- package/app/out/renderer/assets/arc-J47ePHZ2.js +132 -0
- package/app/out/renderer/assets/array-DgktLKBx.js +6 -0
- package/app/out/renderer/assets/asciiarmor-DucZyvP0.js +56 -0
- package/app/out/renderer/assets/asn1-BnOEsgAm.js +144 -0
- package/app/out/renderer/assets/asterisk-QAlztEwS.js +345 -0
- package/app/out/renderer/assets/blockDiagram-c4efeb88-5uRQXgQJ.js +1817 -0
- package/app/out/renderer/assets/brainfuck-DZVCuF_t.js +53 -0
- package/app/out/renderer/assets/c4Diagram-c83219d4-C4iCTPEL.js +2464 -0
- package/app/out/renderer/assets/channel-ZAmhHE3g.js +7 -0
- package/app/out/renderer/assets/classDiagram-beda092f-7NOZxq_W.js +357 -0
- package/app/out/renderer/assets/classDiagram-v2-2358418a-5fPT-cUH.js +291 -0
- package/app/out/renderer/assets/clike-xqXYL6ge.js +805 -0
- package/app/out/renderer/assets/clojure-BhXMqnxz.js +849 -0
- package/app/out/renderer/assets/clone-CsnzsYXQ.js +8 -0
- package/app/out/renderer/assets/cmake-BGaNd9E7.js +71 -0
- package/app/out/renderer/assets/cobol-4yqQntpt.js +120 -0
- package/app/out/renderer/assets/coffeescript-D2dXvhEc.js +308 -0
- package/app/out/renderer/assets/commonlisp-CF_VNHQR.js +130 -0
- package/app/out/renderer/assets/createText-1719965b-Cji7KN4K.js +4904 -0
- package/app/out/renderer/assets/crystal-DyuLTqLs.js +398 -0
- package/app/out/renderer/assets/css-c-jst79C.js +1783 -0
- package/app/out/renderer/assets/cypher-Dlu_3r4V.js +121 -0
- package/app/out/renderer/assets/d-UURgV0Ux.js +179 -0
- package/app/out/renderer/assets/diff-B_Bi2Crb.js +25 -0
- package/app/out/renderer/assets/dockerfile-Bvk733Ga.js +201 -0
- package/app/out/renderer/assets/dtd-Dy74G54E.js +114 -0
- package/app/out/renderer/assets/dylan-TSb-Nfix.js +314 -0
- package/app/out/renderer/assets/ebnf-DAomQUbD.js +139 -0
- package/app/out/renderer/assets/ecl-B59qGGVg.js +178 -0
- package/app/out/renderer/assets/edges-96097737-CD0EvAZQ.js +1844 -0
- package/app/out/renderer/assets/eiffel-Dze7nlu3.js +134 -0
- package/app/out/renderer/assets/elm-DG7jkhNZ.js +176 -0
- package/app/out/renderer/assets/erDiagram-0228fc6a-DRYXBpi7.js +1321 -0
- package/app/out/renderer/assets/erlang-BO6gOnGA.js +674 -0
- package/app/out/renderer/assets/factor-CMxFHDqz.js +65 -0
- package/app/out/renderer/assets/fcl-CDDUNjTj.js +141 -0
- package/app/out/renderer/assets/flowDb-c6c81e3f-CuoIN-Cy.js +1713 -0
- package/app/out/renderer/assets/flowDiagram-50d868cf-CPWPLOml.js +1272 -0
- package/app/out/renderer/assets/flowDiagram-v2-4f6560a1-C_R12s4S.js +33 -0
- package/app/out/renderer/assets/flowchart-elk-definition-6af322e1-BdKUSFpi.js +92921 -0
- package/app/out/renderer/assets/forth-B9D2JCeE.js +116 -0
- package/app/out/renderer/assets/fortran-CAG2BFbe.js +467 -0
- package/app/out/renderer/assets/ganttDiagram-a2739b55-ygqT5HlG.js +3399 -0
- package/app/out/renderer/assets/gas-d3KEcW3x.js +294 -0
- package/app/out/renderer/assets/gherkin-DhZlEZiy.js +115 -0
- package/app/out/renderer/assets/gitGraphDiagram-82fe8481-D97GT4iA.js +1791 -0
- package/app/out/renderer/assets/graph-DpC13d95.js +1237 -0
- package/app/out/renderer/assets/groovy-CpwJiBl7.js +223 -0
- package/app/out/renderer/assets/haskell-BlGBCCe3.js +459 -0
- package/app/out/renderer/assets/haxe-7MlzfeYV.js +514 -0
- package/app/out/renderer/assets/http-BqypyemW.js +79 -0
- package/app/out/renderer/assets/idl-4HIGJlDI.js +985 -0
- package/app/out/renderer/assets/index-4-ziknCv.js +292 -0
- package/app/out/renderer/assets/index-5325376f-Bbs7Fbqr.js +663 -0
- package/app/out/renderer/assets/index-B2jip-rk.js +2489 -0
- package/app/out/renderer/assets/index-BKTVfokE.js +312 -0
- package/app/out/renderer/assets/index-BiJbFgVG.js +118 -0
- package/app/out/renderer/assets/index-Bn433Fat.js +83 -0
- package/app/out/renderer/assets/index-BqDyyRCx.js +39679 -0
- package/app/out/renderer/assets/index-BzFMeMPn.js +158 -0
- package/app/out/renderer/assets/index-C-_uCjZJ.css +2701 -0
- package/app/out/renderer/assets/index-C1ithNW1.js +1765 -0
- package/app/out/renderer/assets/index-CAJkRYkO.js +407 -0
- package/app/out/renderer/assets/index-CleO0-yj.js +690 -0
- package/app/out/renderer/assets/index-Cq4MH3sY.js +1020 -0
- package/app/out/renderer/assets/index-CtA0Xj22.js +705 -0
- package/app/out/renderer/assets/index-CvAZkqBZ.js +83 -0
- package/app/out/renderer/assets/index-D3UDN-5c.js +152 -0
- package/app/out/renderer/assets/index-D4F9R5ao.js +179 -0
- package/app/out/renderer/assets/index-D6RguhZ5.js +328 -0
- package/app/out/renderer/assets/index-DnEowqXv.js +386 -0
- package/app/out/renderer/assets/index-K8c8Mqdy.js +98 -0
- package/app/out/renderer/assets/index-Kh14gO6K.js +62 -0
- package/app/out/renderer/assets/index-WFd2jRnA.js +333 -0
- package/app/out/renderer/assets/index-WgMfkRFp.js +313 -0
- package/app/out/renderer/assets/index-Y4lKyF6t.js +1042 -0
- package/app/out/renderer/assets/index-fx307_f1.js +643 -0
- package/app/out/renderer/assets/infoDiagram-8eee0895-ptaVSwzq.js +511 -0
- package/app/out/renderer/assets/init-ZxktEp_H.js +16 -0
- package/app/out/renderer/assets/javascript-C3MnDRiU.js +994 -0
- package/app/out/renderer/assets/journeyDiagram-c64418c1-aloEGOQp.js +1184 -0
- package/app/out/renderer/assets/julia-Bs6JJhYG.js +407 -0
- package/app/out/renderer/assets/layout-ZeuHE_aY.js +2217 -0
- package/app/out/renderer/assets/line-CAgaGl-S.js +45 -0
- package/app/out/renderer/assets/linear-DIg7lTe1.js +539 -0
- package/app/out/renderer/assets/livescript-DmzgM3Yt.js +296 -0
- package/app/out/renderer/assets/lua-8cJgIlqe.js +256 -0
- package/app/out/renderer/assets/mathematica-DNLOL9PQ.js +110 -0
- package/app/out/renderer/assets/mbox-Ga7d4MMN.js +117 -0
- package/app/out/renderer/assets/mindmap-definition-8da855dc-B8XVoUxz.js +36054 -0
- package/app/out/renderer/assets/mirc-Dma3B8rS.js +107 -0
- package/app/out/renderer/assets/mllike-DHn7xckP.js +334 -0
- package/app/out/renderer/assets/modelica-0d55jYY0.js +147 -0
- package/app/out/renderer/assets/mscgen-DdqZYINH.js +135 -0
- package/app/out/renderer/assets/mumps-Btr8VblO.js +93 -0
- package/app/out/renderer/assets/nginx-DTDtBDVN.js +141 -0
- package/app/out/renderer/assets/nsis-3zG7tgur.js +62 -0
- package/app/out/renderer/assets/ntriples-CvgOYMpL.js +153 -0
- package/app/out/renderer/assets/octave-DYBj3-tl.js +200 -0
- package/app/out/renderer/assets/ordinal-DSZU4PqD.js +76 -0
- package/app/out/renderer/assets/oz-R_e8WMIi.js +231 -0
- package/app/out/renderer/assets/pascal-GD8iposT.js +105 -0
- package/app/out/renderer/assets/path-Cp2qmpkd.js +109 -0
- package/app/out/renderer/assets/perl-DL9mHpoi.js +1105 -0
- package/app/out/renderer/assets/pieDiagram-a8764435-DlwoeBU2.js +770 -0
- package/app/out/renderer/assets/pig-C_4T4YIV.js +101 -0
- package/app/out/renderer/assets/powershell-B0suO7Vd.js +328 -0
- package/app/out/renderer/assets/properties-BR-vP1aU.js +58 -0
- package/app/out/renderer/assets/protobuf-BxgpyhoW.js +77 -0
- package/app/out/renderer/assets/pug-By0kVCfm.js +405 -0
- package/app/out/renderer/assets/puppet-Bdao66PW.js +137 -0
- package/app/out/renderer/assets/python-CvWbmiX4.js +427 -0
- package/app/out/renderer/assets/q-CrbCVq4a.js +131 -0
- package/app/out/renderer/assets/quadrantDiagram-1e28029f-BaSi1XB4.js +1200 -0
- package/app/out/renderer/assets/r-V7nswm59.js +170 -0
- package/app/out/renderer/assets/requirementDiagram-08caed73-D3EFyegZ.js +1092 -0
- package/app/out/renderer/assets/rpm-C-DLY-If.js +109 -0
- package/app/out/renderer/assets/ruby-JDKLJNK0.js +330 -0
- package/app/out/renderer/assets/sankeyDiagram-a04cb91d-Cv44AsnM.js +1174 -0
- package/app/out/renderer/assets/sas-D2UG-yhZ.js +207 -0
- package/app/out/renderer/assets/scheme-BKzrkGJD.js +222 -0
- package/app/out/renderer/assets/sequenceDiagram-c5b8d532-CuUBu-x4.js +3337 -0
- package/app/out/renderer/assets/shell-BlsXDxCn.js +222 -0
- package/app/out/renderer/assets/sieve-CjwBwOY5.js +135 -0
- package/app/out/renderer/assets/simple-mode-DMneyfDu.js +130 -0
- package/app/out/renderer/assets/smalltalk-BOIGQuhN.js +121 -0
- package/app/out/renderer/assets/solr-CwD7U71z.js +69 -0
- package/app/out/renderer/assets/sparql-DYskk2vE.js +249 -0
- package/app/out/renderer/assets/spreadsheet-Bgtt3oLP.js +87 -0
- package/app/out/renderer/assets/sql-BSrOzCRI.js +354 -0
- package/app/out/renderer/assets/stateDiagram-1ecb1508-BOU34Zp4.js +454 -0
- package/app/out/renderer/assets/stateDiagram-v2-c2b004d7-BgRoffou.js +326 -0
- package/app/out/renderer/assets/stex-B6LNC55o.js +231 -0
- package/app/out/renderer/assets/styles-b4e223ce-BMr9TPuj.js +1483 -0
- package/app/out/renderer/assets/styles-ca3715f6-DgbNw99p.js +1363 -0
- package/app/out/renderer/assets/styles-d45a18b0-DtRYKYKf.js +574 -0
- package/app/out/renderer/assets/stylus-BkS-boTH.js +565 -0
- package/app/out/renderer/assets/svgDrawCommon-b86b1483-Bein03PD.js +100 -0
- package/app/out/renderer/assets/swift-FRZi1uvB.js +291 -0
- package/app/out/renderer/assets/tcl-CUcaCdmq.js +114 -0
- package/app/out/renderer/assets/textile-BnFpjsrl.js +414 -0
- package/app/out/renderer/assets/tiddlywiki-CjprD-Qp.js +218 -0
- package/app/out/renderer/assets/tiki-B4EPSQ1G.js +265 -0
- package/app/out/renderer/assets/timeline-definition-faaaa080-BlWpLE_4.js +1212 -0
- package/app/out/renderer/assets/toml-BOuWGMcf.js +76 -0
- package/app/out/renderer/assets/troff-E1bJ0PPL.js +61 -0
- package/app/out/renderer/assets/ttcn-cfg-Dc39-fIP.js +133 -0
- package/app/out/renderer/assets/ttcn-tKd4HLu4.js +192 -0
- package/app/out/renderer/assets/turtle-Dq7-1WAf.js +124 -0
- package/app/out/renderer/assets/vb-Dp90gtsv.js +196 -0
- package/app/out/renderer/assets/vbscript-CI6_mxxU.js +479 -0
- package/app/out/renderer/assets/velocity-BwIZK1TH.js +149 -0
- package/app/out/renderer/assets/verilog-DDCYnHN8.js +430 -0
- package/app/out/renderer/assets/vhdl-DCkMIyT9.js +158 -0
- package/app/out/renderer/assets/webidl-BTLTThCm.js +204 -0
- package/app/out/renderer/assets/xquery-BgiOC5Ce.js +525 -0
- package/app/out/renderer/assets/xychartDiagram-f5964ef8-Bhga-YXm.js +1799 -0
- package/app/out/renderer/assets/yacas-b5lAVEIl.js +130 -0
- package/app/out/renderer/assets/z80-BZV19vqv.js +93 -0
- package/app/out/renderer/index.html +13 -0
- package/app/out/skills/community-builtin/README.md +29 -0
- package/app/out/skills/community-builtin/document-docx/SKILL.md +44 -0
- package/app/out/skills/community-builtin/document-docx/scripts/docx-to-markdown.sh +20 -0
- package/app/out/skills/community-builtin/document-docx/scripts/extract-docx-text.sh +28 -0
- package/app/out/skills/community-builtin/document-docx/scripts/init-docx-template.sh +32 -0
- package/app/out/skills/community-builtin/document-docx/scripts/setup-docx-tools.sh +10 -0
- package/app/out/skills/community-builtin/markitdown/SKILL.md +105 -0
- package/app/out/skills/community-builtin/markitdown/scripts/batch-convert.sh +40 -0
- package/app/out/skills/community-builtin/markitdown/scripts/convert-file.sh +24 -0
- package/app/out/skills/community-builtin/markitdown/scripts/setup-markitdown.sh +10 -0
- package/app/out/skills/community-builtin/repo-quick-audit/SKILL.md +27 -0
- package/app/out/skills/community-builtin/repo-quick-audit/scripts/audit-basics.sh +19 -0
- package/app/out/skills/research-pilot-default-project-skills/README.md +23 -0
- package/app/out/skills/research-pilot-default-project-skills/citation-management/SKILL.md +39 -0
- package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/doi-to-bibtex.sh +25 -0
- package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/normalize-bibtex-keys.sh +51 -0
- package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/setup-citation-tools.sh +10 -0
- package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/validate-bib.sh +31 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/SKILL.md +34 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/api_reference.md +412 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/common_issues.md +563 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/plot_types.md +476 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/styling_guide.md +589 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/subagent_quickstart.md +30 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/scripts/plot_template.py +401 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/scripts/style_configurator.py +409 -0
- package/app/out/skills/research-pilot-default-project-skills/research-grants/SKILL.md +38 -0
- package/app/out/skills/research-pilot-default-project-skills/research-grants/scripts/check-grant-compliance.sh +40 -0
- package/app/out/skills/research-pilot-default-project-skills/research-grants/scripts/grant-summary-card.sh +32 -0
- package/app/out/skills/research-pilot-default-project-skills/research-grants/scripts/init-grant-structure.sh +70 -0
- package/app/package.json +77 -0
- package/bin/cli.mjs +56 -0
- package/lib/README.md +145 -0
- package/lib/skills/_generated.ts +13 -0
- package/lib/skills/builtin/brainstorming-research-ideas/SKILL.md +280 -0
- package/lib/skills/builtin/coding/SKILL.md +114 -0
- package/lib/skills/builtin/creative-thinking-for-research/SKILL.md +273 -0
- package/lib/skills/builtin/matplotlib/SKILL.md +361 -0
- package/lib/skills/builtin/matplotlib/references/api_reference.md +412 -0
- package/lib/skills/builtin/matplotlib/references/common_issues.md +563 -0
- package/lib/skills/builtin/matplotlib/references/plot_types.md +476 -0
- package/lib/skills/builtin/matplotlib/references/styling_guide.md +589 -0
- package/lib/skills/builtin/matplotlib/scripts/plot_template.py +401 -0
- package/lib/skills/builtin/matplotlib/scripts/style_configurator.py +409 -0
- package/lib/skills/builtin/paper-writing/SKILL.md +554 -0
- package/lib/skills/builtin/paper-writing/references/checklists.md +524 -0
- package/lib/skills/builtin/paper-writing/references/citation-workflow.md +562 -0
- package/lib/skills/builtin/paper-writing/references/reviewer-guidelines.md +462 -0
- package/lib/skills/builtin/paper-writing/references/sources.md +189 -0
- package/lib/skills/builtin/paper-writing/references/systems-conferences.md +260 -0
- package/lib/skills/builtin/paper-writing/references/writing-guide.md +476 -0
- package/lib/skills/builtin/paper-writing/templates/README.md +408 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/README.md +534 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026-unified-supp.tex +144 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026-unified-template.tex +952 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026.bib +111 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026.bst +1493 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026.sty +315 -0
- package/lib/skills/builtin/paper-writing/templates/acl/README.md +50 -0
- package/lib/skills/builtin/paper-writing/templates/acl/acl.sty +312 -0
- package/lib/skills/builtin/paper-writing/templates/acl/acl_latex.tex +377 -0
- package/lib/skills/builtin/paper-writing/templates/acl/acl_lualatex.tex +101 -0
- package/lib/skills/builtin/paper-writing/templates/acl/acl_natbib.bst +1940 -0
- package/lib/skills/builtin/paper-writing/templates/acl/anthology.bib.txt +26 -0
- package/lib/skills/builtin/paper-writing/templates/acl/custom.bib +70 -0
- package/lib/skills/builtin/paper-writing/templates/acl/formatting.md +326 -0
- package/lib/skills/builtin/paper-writing/templates/asplos2027/main.tex +459 -0
- package/lib/skills/builtin/paper-writing/templates/asplos2027/references.bib +135 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/README.md +3 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.bib +11 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.bst +1440 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.pdf +0 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.sty +218 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.tex +305 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/fancyhdr.sty +485 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/math_commands.tex +508 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/natbib.sty +1246 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/fancyhdr.sty +485 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.bib +24 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.bst +1440 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.pdf +0 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.sty +246 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.tex +414 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/math_commands.tex +508 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/natbib.sty +1246 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/algorithm.sty +79 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/algorithmic.sty +201 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/example_paper.bib +75 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/example_paper.pdf +0 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/example_paper.tex +662 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/fancyhdr.sty +864 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/icml2026.bst +1443 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/icml2026.sty +767 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/icml_numpapers.pdf +0 -0
- package/lib/skills/builtin/paper-writing/templates/neurips2025/Makefile +36 -0
- package/lib/skills/builtin/paper-writing/templates/neurips2025/extra_pkgs.tex +53 -0
- package/lib/skills/builtin/paper-writing/templates/neurips2025/main.tex +38 -0
- package/lib/skills/builtin/paper-writing/templates/neurips2025/neurips.sty +382 -0
- package/lib/skills/builtin/paper-writing/templates/nsdi2027/main.tex +426 -0
- package/lib/skills/builtin/paper-writing/templates/nsdi2027/references.bib +151 -0
- package/lib/skills/builtin/paper-writing/templates/nsdi2027/usenix-2020-09.sty +83 -0
- package/lib/skills/builtin/paper-writing/templates/osdi2026/main.tex +429 -0
- package/lib/skills/builtin/paper-writing/templates/osdi2026/references.bib +150 -0
- package/lib/skills/builtin/paper-writing/templates/osdi2026/usenix-2020-09.sty +83 -0
- package/lib/skills/builtin/paper-writing/templates/sosp2026/main.tex +532 -0
- package/lib/skills/builtin/paper-writing/templates/sosp2026/references.bib +148 -0
- package/lib/skills/builtin/research-grants/SKILL.md +958 -0
- package/lib/skills/builtin/research-grants/assets/budget_justification_template.md +453 -0
- package/lib/skills/builtin/research-grants/assets/nih_specific_aims_template.md +166 -0
- package/lib/skills/builtin/research-grants/assets/nsf_project_summary_template.md +92 -0
- package/lib/skills/builtin/research-grants/references/README.md +285 -0
- package/lib/skills/builtin/research-grants/references/broader_impacts.md +392 -0
- package/lib/skills/builtin/research-grants/references/darpa_guidelines.md +636 -0
- package/lib/skills/builtin/research-grants/references/doe_guidelines.md +586 -0
- package/lib/skills/builtin/research-grants/references/nih_guidelines.md +851 -0
- package/lib/skills/builtin/research-grants/references/nsf_guidelines.md +570 -0
- package/lib/skills/builtin/research-grants/references/nstc_guidelines.md +733 -0
- package/lib/skills/builtin/research-grants/references/specific_aims_guide.md +458 -0
- package/lib/skills/builtin/rewrite-humanize/SKILL.md +116 -0
- package/lib/skills/builtin/rewrite-humanize/references/cs-venue-tone.md +57 -0
- package/lib/skills/builtin/rewrite-humanize/references/lexicon.md +50 -0
- package/lib/skills/builtin/scholar-evaluation/SKILL.md +300 -0
- package/lib/skills/builtin/scholar-evaluation/references/evaluation_framework.md +663 -0
- package/lib/skills/builtin/scholar-evaluation/scripts/calculate_scores.py +379 -0
- package/lib/skills/builtin/scientific-schematics/SKILL.md +603 -0
- package/lib/skills/builtin/scientific-schematics/references/QUICK_REFERENCE.md +182 -0
- package/lib/skills/builtin/scientific-schematics/references/README.md +292 -0
- package/lib/skills/builtin/scientific-schematics/references/best_practices.md +560 -0
- package/lib/skills/builtin/scientific-schematics/scripts/__pycache__/generate_schematic.cpython-312.pyc +0 -0
- package/lib/skills/builtin/scientific-schematics/scripts/__pycache__/generate_schematic_ai.cpython-312.pyc +0 -0
- package/lib/skills/builtin/scientific-schematics/scripts/example_usage.sh +85 -0
- package/lib/skills/builtin/scientific-schematics/scripts/generate_schematic.py +141 -0
- package/lib/skills/builtin/scientific-schematics/scripts/generate_schematic_ai.py +910 -0
- package/lib/skills/builtin/scientific-visualization/SKILL.md +749 -0
- package/lib/skills/builtin/scientific-visualization/assets/color_palettes.py +197 -0
- package/lib/skills/builtin/scientific-visualization/assets/nature.mplstyle +63 -0
- package/lib/skills/builtin/scientific-visualization/assets/presentation.mplstyle +61 -0
- package/lib/skills/builtin/scientific-visualization/assets/publication.mplstyle +68 -0
- package/lib/skills/builtin/scientific-visualization/references/color_palettes.md +348 -0
- package/lib/skills/builtin/scientific-visualization/references/journal_requirements.md +320 -0
- package/lib/skills/builtin/scientific-visualization/references/matplotlib_examples.md +620 -0
- package/lib/skills/builtin/scientific-visualization/references/publication_guidelines.md +205 -0
- package/lib/skills/builtin/scientific-visualization/scripts/figure_export.py +343 -0
- package/lib/skills/builtin/scientific-visualization/scripts/style_presets.py +416 -0
- package/lib/skills/builtin/scientific-writing/SKILL.md +745 -0
- package/lib/skills/builtin/scientific-writing/assets/REPORT_FORMATTING_GUIDE.md +574 -0
- package/lib/skills/builtin/scientific-writing/assets/scientific_report.sty +606 -0
- package/lib/skills/builtin/scientific-writing/assets/scientific_report_template.tex +449 -0
- package/lib/skills/builtin/scientific-writing/references/citation_styles.md +720 -0
- package/lib/skills/builtin/scientific-writing/references/figures_tables.md +806 -0
- package/lib/skills/builtin/scientific-writing/references/imrad_structure.md +686 -0
- package/lib/skills/builtin/scientific-writing/references/professional_report_formatting.md +664 -0
- package/lib/skills/builtin/scientific-writing/references/reporting_guidelines.md +748 -0
- package/lib/skills/builtin/scientific-writing/references/writing_principles.md +824 -0
- package/lib/skills/builtin/seaborn/SKILL.md +674 -0
- package/lib/skills/builtin/seaborn/references/examples.md +822 -0
- package/lib/skills/builtin/seaborn/references/function_reference.md +770 -0
- package/lib/skills/builtin/seaborn/references/objects_interface.md +964 -0
- package/lib/skills/data-analysis/SKILL.md +285 -0
- package/lib/skills/generate-skill-content.mjs +58 -0
- package/lib/skills/index.ts +34 -0
- package/lib/skills/loader.ts +452 -0
- package/package.json +62 -0
|
@@ -0,0 +1,749 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scientific-visualization
|
|
3
|
+
description: Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib/seaborn/plotly with publication styles. For quick exploration use seaborn or plotly directly.
|
|
4
|
+
category: Visualization
|
|
5
|
+
depends: [matplotlib, seaborn]
|
|
6
|
+
tags: [science, visualization]
|
|
7
|
+
triggers: [publication figure, journal figure, multi-panel figure, figure for Nature, figure for Science, error bars, significance annotation, 做图, 论文配图]
|
|
8
|
+
license: MIT license
|
|
9
|
+
metadata:
|
|
10
|
+
skill-author: K-Dense Inc.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Scientific Visualization
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
Scientific visualization transforms data into clear, accurate figures for publication. Create journal-ready plots with multi-panel layouts, error bars, significance markers, and colorblind-safe palettes. Export as PDF/EPS/TIFF using matplotlib, seaborn, and plotly for manuscripts.
|
|
18
|
+
|
|
19
|
+
## When to Use This Skill
|
|
20
|
+
|
|
21
|
+
This skill should be used when:
|
|
22
|
+
- Creating plots or visualizations for scientific manuscripts
|
|
23
|
+
- Preparing figures for journal submission (Nature, Science, Cell, PLOS, etc.)
|
|
24
|
+
- Ensuring figures are colorblind-friendly and accessible
|
|
25
|
+
- Making multi-panel figures with consistent styling
|
|
26
|
+
- Exporting figures at correct resolution and format
|
|
27
|
+
- Following specific publication guidelines
|
|
28
|
+
- Improving existing figures to meet publication standards
|
|
29
|
+
- Creating figures that need to work in both color and grayscale
|
|
30
|
+
|
|
31
|
+
## Quick Start Guide
|
|
32
|
+
|
|
33
|
+
### Basic Publication-Quality Figure
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
import matplotlib.pyplot as plt
|
|
37
|
+
import numpy as np
|
|
38
|
+
|
|
39
|
+
# Apply a compact publication style inline so this example runs anywhere
|
|
40
|
+
plt.rcParams.update({
|
|
41
|
+
'font.family': 'sans-serif',
|
|
42
|
+
'font.sans-serif': ['Arial', 'Helvetica', 'DejaVu Sans'],
|
|
43
|
+
'font.size': 8,
|
|
44
|
+
'axes.labelsize': 9,
|
|
45
|
+
'xtick.labelsize': 7,
|
|
46
|
+
'ytick.labelsize': 7,
|
|
47
|
+
'axes.spines.top': False,
|
|
48
|
+
'axes.spines.right': False,
|
|
49
|
+
'savefig.dpi': 300,
|
|
50
|
+
'savefig.bbox': 'tight',
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
# Create figure with appropriate size (single column = 3.5 inches)
|
|
54
|
+
fig, ax = plt.subplots(figsize=(3.5, 2.5))
|
|
55
|
+
|
|
56
|
+
# Plot data
|
|
57
|
+
x = np.linspace(0, 10, 100)
|
|
58
|
+
ax.plot(x, np.sin(x), label='sin(x)')
|
|
59
|
+
ax.plot(x, np.cos(x), label='cos(x)')
|
|
60
|
+
|
|
61
|
+
# Proper labeling with units
|
|
62
|
+
ax.set_xlabel('Time (seconds)')
|
|
63
|
+
ax.set_ylabel('Amplitude (mV)')
|
|
64
|
+
ax.legend(frameon=False)
|
|
65
|
+
|
|
66
|
+
# Save in publication formats
|
|
67
|
+
fig.savefig('figure1.pdf')
|
|
68
|
+
fig.savefig('figure1.png', dpi=300)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Reusable presets and export helpers live in `@skill/scripts/style_presets.py` and `@skill/scripts/figure_export.py`. Inspect or run those from a shell instead of assuming they are importable from the current notebook or workspace script.
|
|
72
|
+
|
|
73
|
+
### Using Pre-configured Styles
|
|
74
|
+
|
|
75
|
+
Journal-specific presets live in `@skill/assets/*.mplstyle` and `@skill/scripts/style_presets.py`.
|
|
76
|
+
Do not assume your current Python working directory can open skill-local files directly or import `style_presets` as a global module. Copy the relevant `rcParams` into your script, or run the helper from a shell using the scoped path.
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
import matplotlib.pyplot as plt
|
|
80
|
+
|
|
81
|
+
# Example Nature-like settings applied inline
|
|
82
|
+
plt.rcParams.update({
|
|
83
|
+
'font.size': 7,
|
|
84
|
+
'axes.labelsize': 8,
|
|
85
|
+
'xtick.labelsize': 6,
|
|
86
|
+
'ytick.labelsize': 6,
|
|
87
|
+
'legend.fontsize': 6,
|
|
88
|
+
'savefig.dpi': 600,
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
# Now create figures - they'll automatically match Nature specifications
|
|
92
|
+
fig, ax = plt.subplots(figsize=(3.5, 2.5))
|
|
93
|
+
# ... your plotting code ...
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Quick Start with Seaborn
|
|
97
|
+
|
|
98
|
+
For statistical plots, use seaborn with publication styling:
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
import seaborn as sns
|
|
102
|
+
import matplotlib.pyplot as plt
|
|
103
|
+
|
|
104
|
+
# Apply publication styling inline
|
|
105
|
+
plt.rcParams.update({
|
|
106
|
+
'font.family': 'sans-serif',
|
|
107
|
+
'font.sans-serif': ['Arial', 'Helvetica', 'DejaVu Sans'],
|
|
108
|
+
'font.size': 8,
|
|
109
|
+
'axes.labelsize': 9,
|
|
110
|
+
'xtick.labelsize': 7,
|
|
111
|
+
'ytick.labelsize': 7,
|
|
112
|
+
})
|
|
113
|
+
sns.set_theme(style='ticks', context='paper', font_scale=1.1)
|
|
114
|
+
sns.set_palette('colorblind')
|
|
115
|
+
|
|
116
|
+
# Create statistical comparison figure
|
|
117
|
+
fig, ax = plt.subplots(figsize=(3.5, 3))
|
|
118
|
+
sns.boxplot(data=df, x='treatment', y='response',
|
|
119
|
+
order=['Control', 'Low', 'High'], palette='Set2', ax=ax)
|
|
120
|
+
sns.stripplot(data=df, x='treatment', y='response',
|
|
121
|
+
order=['Control', 'Low', 'High'],
|
|
122
|
+
color='black', alpha=0.3, size=3, ax=ax)
|
|
123
|
+
ax.set_ylabel('Response (μM)')
|
|
124
|
+
sns.despine()
|
|
125
|
+
|
|
126
|
+
# Save figure
|
|
127
|
+
fig.savefig('treatment_comparison.pdf')
|
|
128
|
+
fig.savefig('treatment_comparison.png', dpi=300)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Core Principles and Best Practices
|
|
132
|
+
|
|
133
|
+
### 1. Resolution and File Format
|
|
134
|
+
|
|
135
|
+
**Critical requirements** (detailed in `@skill/references/publication_guidelines.md`):
|
|
136
|
+
- **Raster images** (photos, microscopy): 300-600 DPI
|
|
137
|
+
- **Line art** (graphs, plots): 600-1200 DPI or vector format
|
|
138
|
+
- **Vector formats** (preferred): PDF, EPS, SVG
|
|
139
|
+
- **Raster formats**: TIFF, PNG (never JPEG for scientific data)
|
|
140
|
+
|
|
141
|
+
**Implementation:**
|
|
142
|
+
```python
|
|
143
|
+
# Save vector + raster outputs directly from matplotlib
|
|
144
|
+
fig.savefig('myfigure.pdf', bbox_inches='tight')
|
|
145
|
+
fig.savefig('myfigure.png', dpi=300, bbox_inches='tight')
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
If you want reusable export helpers, inspect or run `@skill/scripts/figure_export.py` from the shell.
|
|
149
|
+
|
|
150
|
+
### 2. Color Selection - Colorblind Accessibility
|
|
151
|
+
|
|
152
|
+
**Always use colorblind-friendly palettes** (detailed in `@skill/references/color_palettes.md`):
|
|
153
|
+
|
|
154
|
+
**Recommended: Okabe-Ito palette** (distinguishable by all types of color blindness):
|
|
155
|
+
```python
|
|
156
|
+
okabe_ito = ['#E69F00', '#56B4E9', '#009E73', '#F0E442',
|
|
157
|
+
'#0072B2', '#D55E00', '#CC79A7', '#000000']
|
|
158
|
+
plt.rcParams['axes.prop_cycle'] = plt.cycler(color=okabe_ito)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Reusable palette definitions also live in `@skill/assets/color_palettes.py`.
|
|
162
|
+
|
|
163
|
+
**For heatmaps/continuous data:**
|
|
164
|
+
- Use perceptually uniform colormaps: `viridis`, `plasma`, `cividis`
|
|
165
|
+
- Avoid red-green diverging maps (use `PuOr`, `RdBu`, `BrBG` instead)
|
|
166
|
+
- Never use `jet` or `rainbow` colormaps
|
|
167
|
+
|
|
168
|
+
**Always test figures in grayscale** to ensure interpretability.
|
|
169
|
+
|
|
170
|
+
### 3. Typography and Text
|
|
171
|
+
|
|
172
|
+
**Font guidelines** (detailed in `@skill/references/publication_guidelines.md`):
|
|
173
|
+
- Sans-serif fonts: Arial, Helvetica, Calibri
|
|
174
|
+
- Minimum sizes at **final print size**:
|
|
175
|
+
- Axis labels: 7-9 pt
|
|
176
|
+
- Tick labels: 6-8 pt
|
|
177
|
+
- Panel labels: 8-12 pt (bold)
|
|
178
|
+
- Sentence case for labels: "Time (hours)" not "TIME (HOURS)"
|
|
179
|
+
- Always include units in parentheses
|
|
180
|
+
|
|
181
|
+
**Implementation:**
|
|
182
|
+
```python
|
|
183
|
+
# Set fonts globally
|
|
184
|
+
import matplotlib as mpl
|
|
185
|
+
mpl.rcParams['font.family'] = 'sans-serif'
|
|
186
|
+
mpl.rcParams['font.sans-serif'] = ['Arial', 'Helvetica']
|
|
187
|
+
mpl.rcParams['font.size'] = 8
|
|
188
|
+
mpl.rcParams['axes.labelsize'] = 9
|
|
189
|
+
mpl.rcParams['xtick.labelsize'] = 7
|
|
190
|
+
mpl.rcParams['ytick.labelsize'] = 7
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### 4. Figure Dimensions
|
|
194
|
+
|
|
195
|
+
**Journal-specific widths** (detailed in `@skill/references/journal_requirements.md`):
|
|
196
|
+
- **Nature**: Single 89 mm, Double 183 mm
|
|
197
|
+
- **Science**: Single 55 mm, Double 175 mm
|
|
198
|
+
- **Cell**: Single 85 mm, Double 178 mm
|
|
199
|
+
|
|
200
|
+
**Check figure size compliance:**
|
|
201
|
+
```python
|
|
202
|
+
fig = plt.figure(figsize=(3.5, 3)) # 89 mm for Nature
|
|
203
|
+
width_mm, height_mm = fig.get_size_inches() * 25.4
|
|
204
|
+
print(f'{width_mm:.1f} mm x {height_mm:.1f} mm')
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Compare those values against `@skill/references/journal_requirements.md`, or reuse the helper in `@skill/scripts/figure_export.py`.
|
|
208
|
+
|
|
209
|
+
### 5. Multi-Panel Figures
|
|
210
|
+
|
|
211
|
+
**Best practices:**
|
|
212
|
+
- Label panels with bold letters: **A**, **B**, **C** (uppercase for most journals, lowercase for Nature)
|
|
213
|
+
- Maintain consistent styling across all panels
|
|
214
|
+
- Align panels along edges where possible
|
|
215
|
+
- Use adequate white space between panels
|
|
216
|
+
|
|
217
|
+
**Example implementation** (see `@skill/references/matplotlib_examples.md` for complete code):
|
|
218
|
+
```python
|
|
219
|
+
from string import ascii_uppercase
|
|
220
|
+
|
|
221
|
+
fig = plt.figure(figsize=(7, 4))
|
|
222
|
+
gs = fig.add_gridspec(2, 2, hspace=0.4, wspace=0.4)
|
|
223
|
+
|
|
224
|
+
ax1 = fig.add_subplot(gs[0, 0])
|
|
225
|
+
ax2 = fig.add_subplot(gs[0, 1])
|
|
226
|
+
# ... create other panels ...
|
|
227
|
+
|
|
228
|
+
# Add panel labels
|
|
229
|
+
for i, ax in enumerate([ax1, ax2, ...]):
|
|
230
|
+
ax.text(-0.15, 1.05, ascii_uppercase[i], transform=ax.transAxes,
|
|
231
|
+
fontsize=10, fontweight='bold', va='top')
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Common Tasks
|
|
235
|
+
|
|
236
|
+
### Task 1: Create a Publication-Ready Line Plot
|
|
237
|
+
|
|
238
|
+
See `@skill/references/matplotlib_examples.md` Example 1 for complete code.
|
|
239
|
+
|
|
240
|
+
**Key steps:**
|
|
241
|
+
1. Apply publication style
|
|
242
|
+
2. Set appropriate figure size for target journal
|
|
243
|
+
3. Use colorblind-friendly colors
|
|
244
|
+
4. Add error bars with correct representation (SEM, SD, or CI)
|
|
245
|
+
5. Label axes with units
|
|
246
|
+
6. Remove unnecessary spines
|
|
247
|
+
7. Save in vector format
|
|
248
|
+
|
|
249
|
+
**Using seaborn for automatic confidence intervals:**
|
|
250
|
+
```python
|
|
251
|
+
import seaborn as sns
|
|
252
|
+
fig, ax = plt.subplots(figsize=(5, 3))
|
|
253
|
+
sns.lineplot(data=timeseries, x='time', y='measurement',
|
|
254
|
+
hue='treatment', errorbar=('ci', 95),
|
|
255
|
+
markers=True, ax=ax)
|
|
256
|
+
ax.set_xlabel('Time (hours)')
|
|
257
|
+
ax.set_ylabel('Measurement (AU)')
|
|
258
|
+
sns.despine()
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Task 2: Create a Multi-Panel Figure
|
|
262
|
+
|
|
263
|
+
See `@skill/references/matplotlib_examples.md` Example 2 for complete code.
|
|
264
|
+
|
|
265
|
+
**Key steps:**
|
|
266
|
+
1. Use `GridSpec` for flexible layout
|
|
267
|
+
2. Ensure consistent styling across panels
|
|
268
|
+
3. Add bold panel labels (A, B, C, etc.)
|
|
269
|
+
4. Align related panels
|
|
270
|
+
5. Verify all text is readable at final size
|
|
271
|
+
|
|
272
|
+
### Task 3: Create a Heatmap with Proper Colormap
|
|
273
|
+
|
|
274
|
+
See `@skill/references/matplotlib_examples.md` Example 4 for complete code.
|
|
275
|
+
|
|
276
|
+
**Key steps:**
|
|
277
|
+
1. Use perceptually uniform colormap (`viridis`, `plasma`, `cividis`)
|
|
278
|
+
2. Include labeled colorbar
|
|
279
|
+
3. For diverging data, use colorblind-safe diverging map (`RdBu_r`, `PuOr`)
|
|
280
|
+
4. Set appropriate center value for diverging maps
|
|
281
|
+
5. Test appearance in grayscale
|
|
282
|
+
|
|
283
|
+
**Using seaborn for correlation matrices:**
|
|
284
|
+
```python
|
|
285
|
+
import seaborn as sns
|
|
286
|
+
fig, ax = plt.subplots(figsize=(5, 4))
|
|
287
|
+
corr = df.corr()
|
|
288
|
+
mask = np.triu(np.ones_like(corr, dtype=bool))
|
|
289
|
+
sns.heatmap(corr, mask=mask, annot=True, fmt='.2f',
|
|
290
|
+
cmap='RdBu_r', center=0, square=True,
|
|
291
|
+
linewidths=1, cbar_kws={'shrink': 0.8}, ax=ax)
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Task 4: Prepare Figure for Specific Journal
|
|
295
|
+
|
|
296
|
+
**Workflow:**
|
|
297
|
+
1. Check journal requirements: `@skill/references/journal_requirements.md`
|
|
298
|
+
2. Set figure width, font sizes, and export DPI explicitly in matplotlib, or copy the relevant preset from `@skill/scripts/style_presets.py`
|
|
299
|
+
3. Create figure at the final intended print size
|
|
300
|
+
4. Export to the journal's required formats directly with `fig.savefig(...)`, or reuse `@skill/scripts/figure_export.py`
|
|
301
|
+
|
|
302
|
+
### Task 5: Fix an Existing Figure to Meet Publication Standards
|
|
303
|
+
|
|
304
|
+
**Checklist approach** (full checklist in `@skill/references/publication_guidelines.md`):
|
|
305
|
+
|
|
306
|
+
1. **Check resolution**: Verify DPI meets journal requirements
|
|
307
|
+
2. **Check file format**: Use vector for plots, TIFF/PNG for images
|
|
308
|
+
3. **Check colors**: Ensure colorblind-friendly
|
|
309
|
+
4. **Check fonts**: Minimum 6-7 pt at final size, sans-serif
|
|
310
|
+
5. **Check labels**: All axes labeled with units
|
|
311
|
+
6. **Check size**: Matches journal column width
|
|
312
|
+
7. **Test grayscale**: Figure interpretable without color
|
|
313
|
+
8. **Remove chart junk**: No unnecessary grids, 3D effects, shadows
|
|
314
|
+
|
|
315
|
+
### Task 6: Create Colorblind-Friendly Visualizations
|
|
316
|
+
|
|
317
|
+
**Strategy:**
|
|
318
|
+
1. Use approved palettes from `@skill/assets/color_palettes.py`
|
|
319
|
+
2. Add redundant encoding (line styles, markers, patterns)
|
|
320
|
+
3. Test with colorblind simulator
|
|
321
|
+
4. Ensure grayscale compatibility
|
|
322
|
+
|
|
323
|
+
**Example:**
|
|
324
|
+
```python
|
|
325
|
+
import matplotlib.pyplot as plt
|
|
326
|
+
|
|
327
|
+
okabe_ito = ['#E69F00', '#56B4E9', '#009E73', '#F0E442',
|
|
328
|
+
'#0072B2', '#D55E00', '#CC79A7', '#000000']
|
|
329
|
+
plt.rcParams['axes.prop_cycle'] = plt.cycler(color=okabe_ito)
|
|
330
|
+
|
|
331
|
+
# Add redundant encoding beyond color
|
|
332
|
+
line_styles = ['-', '--', '-.', ':']
|
|
333
|
+
markers = ['o', 's', '^', 'v']
|
|
334
|
+
|
|
335
|
+
for i, (data, label) in enumerate(datasets):
|
|
336
|
+
plt.plot(x, data, linestyle=line_styles[i % 4],
|
|
337
|
+
marker=markers[i % 4], label=label)
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
## Statistical Rigor
|
|
341
|
+
|
|
342
|
+
**Always include:**
|
|
343
|
+
- Error bars (SD, SEM, or CI - specify which in caption)
|
|
344
|
+
- Sample size (n) in figure or caption
|
|
345
|
+
- Statistical significance markers (*, **, ***)
|
|
346
|
+
- Individual data points when possible (not just summary statistics)
|
|
347
|
+
|
|
348
|
+
**Example with statistics:**
|
|
349
|
+
```python
|
|
350
|
+
# Show individual points with summary statistics
|
|
351
|
+
ax.scatter(x_jittered, individual_points, alpha=0.4, s=8)
|
|
352
|
+
ax.errorbar(x, means, yerr=sems, fmt='o', capsize=3)
|
|
353
|
+
|
|
354
|
+
# Mark significance
|
|
355
|
+
ax.text(1.5, max_y * 1.1, '***', ha='center', fontsize=8)
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## Working with Different Plotting Libraries
|
|
359
|
+
|
|
360
|
+
### Matplotlib
|
|
361
|
+
- Most control over publication details
|
|
362
|
+
- Best for complex multi-panel figures
|
|
363
|
+
- Use provided style files for consistent formatting
|
|
364
|
+
- See `@skill/references/matplotlib_examples.md` for extensive examples
|
|
365
|
+
|
|
366
|
+
### Seaborn
|
|
367
|
+
|
|
368
|
+
Seaborn provides a high-level, dataset-oriented interface for statistical graphics, built on matplotlib. It excels at creating publication-quality statistical visualizations with minimal code while maintaining full compatibility with matplotlib customization.
|
|
369
|
+
|
|
370
|
+
**Key advantages for scientific visualization:**
|
|
371
|
+
- Automatic statistical estimation and confidence intervals
|
|
372
|
+
- Built-in support for multi-panel figures (faceting)
|
|
373
|
+
- Colorblind-friendly palettes by default
|
|
374
|
+
- Dataset-oriented API using pandas DataFrames
|
|
375
|
+
- Semantic mapping of variables to visual properties
|
|
376
|
+
|
|
377
|
+
#### Quick Start with Publication Style
|
|
378
|
+
|
|
379
|
+
Always apply matplotlib publication styles first, then configure seaborn:
|
|
380
|
+
|
|
381
|
+
```python
|
|
382
|
+
import seaborn as sns
|
|
383
|
+
import matplotlib.pyplot as plt
|
|
384
|
+
|
|
385
|
+
# Apply publication style inline
|
|
386
|
+
plt.rcParams.update({
|
|
387
|
+
'font.family': 'sans-serif',
|
|
388
|
+
'font.sans-serif': ['Arial', 'Helvetica', 'DejaVu Sans'],
|
|
389
|
+
'font.size': 8,
|
|
390
|
+
'axes.labelsize': 9,
|
|
391
|
+
'xtick.labelsize': 7,
|
|
392
|
+
'ytick.labelsize': 7,
|
|
393
|
+
})
|
|
394
|
+
|
|
395
|
+
# Configure seaborn for publication
|
|
396
|
+
sns.set_theme(style='ticks', context='paper', font_scale=1.1)
|
|
397
|
+
sns.set_palette('colorblind') # Use colorblind-safe palette
|
|
398
|
+
|
|
399
|
+
# Create figure
|
|
400
|
+
fig, ax = plt.subplots(figsize=(3.5, 2.5))
|
|
401
|
+
sns.scatterplot(data=df, x='time', y='response',
|
|
402
|
+
hue='treatment', style='condition', ax=ax)
|
|
403
|
+
sns.despine() # Remove top and right spines
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
#### Common Plot Types for Publications
|
|
407
|
+
|
|
408
|
+
**Statistical comparisons:**
|
|
409
|
+
```python
|
|
410
|
+
# Box plot with individual points for transparency
|
|
411
|
+
fig, ax = plt.subplots(figsize=(3.5, 3))
|
|
412
|
+
sns.boxplot(data=df, x='treatment', y='response',
|
|
413
|
+
order=['Control', 'Low', 'High'], palette='Set2', ax=ax)
|
|
414
|
+
sns.stripplot(data=df, x='treatment', y='response',
|
|
415
|
+
order=['Control', 'Low', 'High'],
|
|
416
|
+
color='black', alpha=0.3, size=3, ax=ax)
|
|
417
|
+
ax.set_ylabel('Response (μM)')
|
|
418
|
+
sns.despine()
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
**Distribution analysis:**
|
|
422
|
+
```python
|
|
423
|
+
# Violin plot with split comparison
|
|
424
|
+
fig, ax = plt.subplots(figsize=(4, 3))
|
|
425
|
+
sns.violinplot(data=df, x='timepoint', y='expression',
|
|
426
|
+
hue='treatment', split=True, inner='quartile', ax=ax)
|
|
427
|
+
ax.set_ylabel('Gene Expression (AU)')
|
|
428
|
+
sns.despine()
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
**Correlation matrices:**
|
|
432
|
+
```python
|
|
433
|
+
# Heatmap with proper colormap and annotations
|
|
434
|
+
fig, ax = plt.subplots(figsize=(5, 4))
|
|
435
|
+
corr = df.corr()
|
|
436
|
+
mask = np.triu(np.ones_like(corr, dtype=bool)) # Show only lower triangle
|
|
437
|
+
sns.heatmap(corr, mask=mask, annot=True, fmt='.2f',
|
|
438
|
+
cmap='RdBu_r', center=0, square=True,
|
|
439
|
+
linewidths=1, cbar_kws={'shrink': 0.8}, ax=ax)
|
|
440
|
+
plt.tight_layout()
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
**Time series with confidence bands:**
|
|
444
|
+
```python
|
|
445
|
+
# Line plot with automatic CI calculation
|
|
446
|
+
fig, ax = plt.subplots(figsize=(5, 3))
|
|
447
|
+
sns.lineplot(data=timeseries, x='time', y='measurement',
|
|
448
|
+
hue='treatment', style='replicate',
|
|
449
|
+
errorbar=('ci', 95), markers=True, dashes=False, ax=ax)
|
|
450
|
+
ax.set_xlabel('Time (hours)')
|
|
451
|
+
ax.set_ylabel('Measurement (AU)')
|
|
452
|
+
sns.despine()
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
#### Multi-Panel Figures with Seaborn
|
|
456
|
+
|
|
457
|
+
**Using FacetGrid for automatic faceting:**
|
|
458
|
+
```python
|
|
459
|
+
# Create faceted plot
|
|
460
|
+
g = sns.relplot(data=df, x='dose', y='response',
|
|
461
|
+
hue='treatment', col='cell_line', row='timepoint',
|
|
462
|
+
kind='line', height=2.5, aspect=1.2,
|
|
463
|
+
errorbar=('ci', 95), markers=True)
|
|
464
|
+
g.set_axis_labels('Dose (μM)', 'Response (AU)')
|
|
465
|
+
g.set_titles('{row_name} | {col_name}')
|
|
466
|
+
sns.despine()
|
|
467
|
+
|
|
468
|
+
# Save with correct DPI
|
|
469
|
+
g.figure.savefig('figure_facets.pdf', bbox_inches='tight')
|
|
470
|
+
g.figure.savefig('figure_facets.png', dpi=300, bbox_inches='tight')
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
**Combining seaborn with matplotlib subplots:**
|
|
474
|
+
```python
|
|
475
|
+
# Create custom multi-panel layout
|
|
476
|
+
fig, axes = plt.subplots(2, 2, figsize=(7, 6))
|
|
477
|
+
|
|
478
|
+
# Panel A: Scatter with regression
|
|
479
|
+
sns.regplot(data=df, x='predictor', y='response', ax=axes[0, 0])
|
|
480
|
+
axes[0, 0].text(-0.15, 1.05, 'A', transform=axes[0, 0].transAxes,
|
|
481
|
+
fontsize=10, fontweight='bold')
|
|
482
|
+
|
|
483
|
+
# Panel B: Distribution comparison
|
|
484
|
+
sns.violinplot(data=df, x='group', y='value', ax=axes[0, 1])
|
|
485
|
+
axes[0, 1].text(-0.15, 1.05, 'B', transform=axes[0, 1].transAxes,
|
|
486
|
+
fontsize=10, fontweight='bold')
|
|
487
|
+
|
|
488
|
+
# Panel C: Heatmap
|
|
489
|
+
sns.heatmap(correlation_data, cmap='viridis', ax=axes[1, 0])
|
|
490
|
+
axes[1, 0].text(-0.15, 1.05, 'C', transform=axes[1, 0].transAxes,
|
|
491
|
+
fontsize=10, fontweight='bold')
|
|
492
|
+
|
|
493
|
+
# Panel D: Time series
|
|
494
|
+
sns.lineplot(data=timeseries, x='time', y='signal',
|
|
495
|
+
hue='condition', ax=axes[1, 1])
|
|
496
|
+
axes[1, 1].text(-0.15, 1.05, 'D', transform=axes[1, 1].transAxes,
|
|
497
|
+
fontsize=10, fontweight='bold')
|
|
498
|
+
|
|
499
|
+
plt.tight_layout()
|
|
500
|
+
sns.despine()
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
#### Color Palettes for Publications
|
|
504
|
+
|
|
505
|
+
Seaborn includes several colorblind-safe palettes:
|
|
506
|
+
|
|
507
|
+
```python
|
|
508
|
+
# Use built-in colorblind palette (recommended)
|
|
509
|
+
sns.set_palette('colorblind')
|
|
510
|
+
|
|
511
|
+
# Or specify custom colorblind-safe colors (Okabe-Ito)
|
|
512
|
+
okabe_ito = ['#E69F00', '#56B4E9', '#009E73', '#F0E442',
|
|
513
|
+
'#0072B2', '#D55E00', '#CC79A7', '#000000']
|
|
514
|
+
sns.set_palette(okabe_ito)
|
|
515
|
+
|
|
516
|
+
# For heatmaps and continuous data
|
|
517
|
+
sns.heatmap(data, cmap='viridis') # Perceptually uniform
|
|
518
|
+
sns.heatmap(corr, cmap='RdBu_r', center=0) # Diverging, centered
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
#### Choosing Between Axes-Level and Figure-Level Functions
|
|
522
|
+
|
|
523
|
+
**Axes-level functions** (e.g., `scatterplot`, `boxplot`, `heatmap`):
|
|
524
|
+
- Use when building custom multi-panel layouts
|
|
525
|
+
- Accept `ax=` parameter for precise placement
|
|
526
|
+
- Better integration with matplotlib subplots
|
|
527
|
+
- More control over figure composition
|
|
528
|
+
|
|
529
|
+
```python
|
|
530
|
+
fig, ax = plt.subplots(figsize=(3.5, 2.5))
|
|
531
|
+
sns.scatterplot(data=df, x='x', y='y', hue='group', ax=ax)
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
**Figure-level functions** (e.g., `relplot`, `catplot`, `displot`):
|
|
535
|
+
- Use for automatic faceting by categorical variables
|
|
536
|
+
- Create complete figures with consistent styling
|
|
537
|
+
- Great for exploratory analysis
|
|
538
|
+
- Use `height` and `aspect` for sizing
|
|
539
|
+
|
|
540
|
+
```python
|
|
541
|
+
g = sns.relplot(data=df, x='x', y='y', col='category', kind='scatter')
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
#### Statistical Rigor with Seaborn
|
|
545
|
+
|
|
546
|
+
Seaborn automatically computes and displays uncertainty:
|
|
547
|
+
|
|
548
|
+
```python
|
|
549
|
+
# Line plot: shows mean ± 95% CI by default
|
|
550
|
+
sns.lineplot(data=df, x='time', y='value', hue='treatment',
|
|
551
|
+
errorbar=('ci', 95)) # Can change to 'sd', 'se', etc.
|
|
552
|
+
|
|
553
|
+
# Bar plot: shows mean with bootstrapped CI
|
|
554
|
+
sns.barplot(data=df, x='treatment', y='response',
|
|
555
|
+
errorbar=('ci', 95), capsize=0.1)
|
|
556
|
+
|
|
557
|
+
# Always specify error type in figure caption:
|
|
558
|
+
# "Error bars represent 95% confidence intervals"
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
#### Best Practices for Publication-Ready Seaborn Figures
|
|
562
|
+
|
|
563
|
+
1. **Always set publication theme first:** `sns.set_theme(style='ticks', context='paper', font_scale=1.1)`
|
|
564
|
+
|
|
565
|
+
2. **Use colorblind-safe palettes:** `sns.set_palette('colorblind')`
|
|
566
|
+
|
|
567
|
+
3. **Remove unnecessary elements:** `sns.despine()`
|
|
568
|
+
|
|
569
|
+
4. **Control figure size appropriately:** use `fig, ax = plt.subplots(figsize=(3.5, 2.5))` for axes-level plots, or `sns.relplot(..., height=3, aspect=1.2)` for figure-level plots.
|
|
570
|
+
|
|
571
|
+
5. **Show individual data points when possible:** combine summary and raw data, for example `sns.boxplot(...)` plus `sns.stripplot(..., alpha=0.3)`.
|
|
572
|
+
|
|
573
|
+
6. **Include proper labels with units:** `ax.set_xlabel('Time (hours)')` and `ax.set_ylabel('Expression (AU)')`
|
|
574
|
+
|
|
575
|
+
7. **Export at correct resolution:** `fig.savefig('figure_name.pdf', bbox_inches='tight')` and `fig.savefig('figure_name.png', dpi=300, bbox_inches='tight')`
|
|
576
|
+
|
|
577
|
+
#### Advanced Seaborn Techniques
|
|
578
|
+
|
|
579
|
+
**Pairwise relationships for exploratory analysis:**
|
|
580
|
+
```python
|
|
581
|
+
# Quick overview of all relationships
|
|
582
|
+
g = sns.pairplot(data=df, hue='condition',
|
|
583
|
+
vars=['gene1', 'gene2', 'gene3'],
|
|
584
|
+
corner=True, diag_kind='kde', height=2)
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
**Hierarchical clustering heatmap:**
|
|
588
|
+
```python
|
|
589
|
+
# Cluster samples and features
|
|
590
|
+
g = sns.clustermap(expression_data, method='ward',
|
|
591
|
+
metric='euclidean', z_score=0,
|
|
592
|
+
cmap='RdBu_r', center=0,
|
|
593
|
+
figsize=(10, 8),
|
|
594
|
+
row_colors=condition_colors,
|
|
595
|
+
cbar_kws={'label': 'Z-score'})
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
**Joint distributions with marginals:**
|
|
599
|
+
```python
|
|
600
|
+
# Bivariate distribution with context
|
|
601
|
+
g = sns.jointplot(data=df, x='gene1', y='gene2',
|
|
602
|
+
hue='treatment', kind='scatter',
|
|
603
|
+
height=6, ratio=4, marginal_kws={'kde': True})
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
#### Common Seaborn Issues and Solutions
|
|
607
|
+
|
|
608
|
+
**Issue: Legend outside plot area**
|
|
609
|
+
```python
|
|
610
|
+
g = sns.relplot(...)
|
|
611
|
+
g._legend.set_bbox_to_anchor((0.9, 0.5))
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
**Issue: Overlapping labels**
|
|
615
|
+
```python
|
|
616
|
+
plt.xticks(rotation=45, ha='right')
|
|
617
|
+
plt.tight_layout()
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
**Issue: Text too small at final size**
|
|
621
|
+
```python
|
|
622
|
+
sns.set_context('paper', font_scale=1.2) # Increase if needed
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
#### Additional Resources
|
|
626
|
+
|
|
627
|
+
For more detailed seaborn information, see:
|
|
628
|
+
- `@skill:seaborn/SKILL.md` - Comprehensive seaborn documentation
|
|
629
|
+
- `@skill:seaborn/references/examples.md` - Practical use cases
|
|
630
|
+
- `@skill:seaborn/references/function_reference.md` - Complete API reference
|
|
631
|
+
- `@skill:seaborn/references/objects_interface.md` - Modern declarative API
|
|
632
|
+
|
|
633
|
+
### Plotly
|
|
634
|
+
- Interactive figures for exploration
|
|
635
|
+
- Export static images for publication
|
|
636
|
+
- Configure for publication quality:
|
|
637
|
+
```python
|
|
638
|
+
fig.update_layout(
|
|
639
|
+
font=dict(family='Arial, sans-serif', size=10),
|
|
640
|
+
plot_bgcolor='white',
|
|
641
|
+
# ... see matplotlib_examples.md Example 8
|
|
642
|
+
)
|
|
643
|
+
fig.write_image('figure.png', scale=3) # scale=3 gives ~300 DPI
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
## Resources
|
|
647
|
+
|
|
648
|
+
### References Directory
|
|
649
|
+
|
|
650
|
+
**Load these as needed for detailed information:**
|
|
651
|
+
|
|
652
|
+
- **`@skill/references/publication_guidelines.md`**: Comprehensive best practices
|
|
653
|
+
- Resolution and file format requirements
|
|
654
|
+
- Typography guidelines
|
|
655
|
+
- Layout and composition rules
|
|
656
|
+
- Statistical rigor requirements
|
|
657
|
+
- Complete publication checklist
|
|
658
|
+
|
|
659
|
+
- **`@skill/references/color_palettes.md`**: Color usage guide
|
|
660
|
+
- Colorblind-friendly palette specifications with RGB values
|
|
661
|
+
- Sequential and diverging colormap recommendations
|
|
662
|
+
- Testing procedures for accessibility
|
|
663
|
+
- Domain-specific palettes (genomics, microscopy)
|
|
664
|
+
|
|
665
|
+
- **`@skill/references/journal_requirements.md`**: Journal-specific specifications
|
|
666
|
+
- Technical requirements by publisher
|
|
667
|
+
- File format and DPI specifications
|
|
668
|
+
- Figure dimension requirements
|
|
669
|
+
- Quick reference table
|
|
670
|
+
|
|
671
|
+
- **`@skill/references/matplotlib_examples.md`**: Practical code examples
|
|
672
|
+
- 10 complete working examples
|
|
673
|
+
- Line plots, bar plots, heatmaps, multi-panel figures
|
|
674
|
+
- Journal-specific figure examples
|
|
675
|
+
- Tips for each library (matplotlib, seaborn, plotly)
|
|
676
|
+
|
|
677
|
+
### Scripts Directory
|
|
678
|
+
|
|
679
|
+
**Use these helper scripts for automation:**
|
|
680
|
+
|
|
681
|
+
- **`@skill/scripts/figure_export.py`**: Export utilities
|
|
682
|
+
- `save_publication_figure()`: Save in multiple formats with correct DPI
|
|
683
|
+
- `save_for_journal()`: Use journal-specific requirements automatically
|
|
684
|
+
- `check_figure_size()`: Verify dimensions meet journal specs
|
|
685
|
+
- Run directly: `python @skill/scripts/figure_export.py` for examples
|
|
686
|
+
|
|
687
|
+
- **`@skill/scripts/style_presets.py`**: Pre-configured styles
|
|
688
|
+
- `apply_publication_style()`: Apply preset styles (default, nature, science, cell)
|
|
689
|
+
- `set_color_palette()`: Quick palette switching
|
|
690
|
+
- `configure_for_journal()`: One-command journal configuration
|
|
691
|
+
- Run directly: `python @skill/scripts/style_presets.py` to see examples
|
|
692
|
+
|
|
693
|
+
### Assets Directory
|
|
694
|
+
|
|
695
|
+
**Use these files in figures:**
|
|
696
|
+
|
|
697
|
+
- **`@skill/assets/color_palettes.py`**: Importable color definitions
|
|
698
|
+
- All recommended palettes as Python constants
|
|
699
|
+
- `apply_palette()` helper function
|
|
700
|
+
- Copy definitions from this file if you need them in notebooks/scripts
|
|
701
|
+
|
|
702
|
+
- **Matplotlib style files**: copy settings from these files, or resolve their absolute path before calling `plt.style.use()`
|
|
703
|
+
- `@skill/assets/publication.mplstyle`: General publication quality
|
|
704
|
+
- `@skill/assets/nature.mplstyle`: Nature journal specifications
|
|
705
|
+
- `@skill/assets/presentation.mplstyle`: Larger fonts for posters/slides
|
|
706
|
+
|
|
707
|
+
## Workflow Summary
|
|
708
|
+
|
|
709
|
+
**Recommended workflow for creating publication figures:**
|
|
710
|
+
|
|
711
|
+
1. **Plan**: Determine target journal, figure type, and content
|
|
712
|
+
2. **Configure**: Apply appropriate style for journal, for example `plt.rcParams.update({'font.size': 7, 'axes.labelsize': 8, 'savefig.dpi': 600})`
|
|
713
|
+
3. **Create**: Build figure with proper labels, colors, statistics
|
|
714
|
+
4. **Verify**: Check size, fonts, colors, accessibility, for example `width_mm, height_mm = fig.get_size_inches() * 25.4`
|
|
715
|
+
5. **Export**: Save in required formats, for example `fig.savefig('figure1.pdf', bbox_inches='tight')` and `fig.savefig('figure1.png', dpi=300, bbox_inches='tight')`
|
|
716
|
+
6. **Review**: View at final size in manuscript context
|
|
717
|
+
|
|
718
|
+
## Common Pitfalls to Avoid
|
|
719
|
+
|
|
720
|
+
1. **Font too small**: Text unreadable when printed at final size
|
|
721
|
+
2. **JPEG format**: Never use JPEG for graphs/plots (creates artifacts)
|
|
722
|
+
3. **Red-green colors**: ~8% of males cannot distinguish
|
|
723
|
+
4. **Low resolution**: Pixelated figures in publication
|
|
724
|
+
5. **Missing units**: Always label axes with units
|
|
725
|
+
6. **3D effects**: Distorts perception, avoid completely
|
|
726
|
+
7. **Chart junk**: Remove unnecessary gridlines, decorations
|
|
727
|
+
8. **Truncated axes**: Start bar charts at zero unless scientifically justified
|
|
728
|
+
9. **Inconsistent styling**: Different fonts/colors across figures in same manuscript
|
|
729
|
+
10. **No error bars**: Always show uncertainty
|
|
730
|
+
|
|
731
|
+
## Final Checklist
|
|
732
|
+
|
|
733
|
+
Before submitting figures, verify:
|
|
734
|
+
|
|
735
|
+
- [ ] Resolution meets journal requirements (300+ DPI)
|
|
736
|
+
- [ ] File format is correct (vector for plots, TIFF for images)
|
|
737
|
+
- [ ] Figure size matches journal specifications
|
|
738
|
+
- [ ] All text readable at final size (≥6 pt)
|
|
739
|
+
- [ ] Colors are colorblind-friendly
|
|
740
|
+
- [ ] Figure works in grayscale
|
|
741
|
+
- [ ] All axes labeled with units
|
|
742
|
+
- [ ] Error bars present with definition in caption
|
|
743
|
+
- [ ] Panel labels present and consistent
|
|
744
|
+
- [ ] No chart junk or 3D effects
|
|
745
|
+
- [ ] Fonts consistent across all figures
|
|
746
|
+
- [ ] Statistical significance clearly marked
|
|
747
|
+
- [ ] Legend is clear and complete
|
|
748
|
+
|
|
749
|
+
Use this skill to ensure scientific figures meet the highest publication standards while remaining accessible to all readers.
|