1
0
Fork 0
planet/沈浪熊猫儿/2021年浙江高考数学第七题函数曲线绘制.tm

293 lines
186 KiB
Plaintext
Raw Normal View History

2022-08-29 19:24:27 +08:00
<TeXmacs|2.1.3>
<style|<tuple|generic|chinese|doc>>
<\body>
2022-08-29 19:24:27 +08:00
<doc-data|<doc-title|2021年浙江省高考数学第七题函数曲线绘制>>
2022-08-29 19:24:27 +08:00
2021年浙江省高考数学选择题第七题如下所示
<\framed>
2022-08-29 19:24:27 +08:00
7. 已知函数<math|f<around*|(|x|)>=x<rsup|2>+<frac|1|4>,g<around*|(|x|)>=sin
x>,则图像为如图的函数可能是
<image|<tuple|<#89504E470D0A1A0A0000000D49484452000002560000016C08060000000EACF749000000097048597300000B1300000B1301009A9C180000200049444154789CECDD69731BD97506E0170DA0D1DD68A01BFB4280BBA86D6664CFD82EA792FC8154E5EFE6633EA4E24AC59EB1AC198D16EE20B12F8D7DDFF2C1B9D7A0A45945717D9F2A944612876A8220F0E2DC73CF752D97CB258888886EA0C56281F97C8E72B98C972F5FA25C2E63369B21994CE2ABAFBE423A9DBEEE4B24BAC0C56045444437D572B9C472B9C4683442BBDDC66834C272B984A669088542D075FDBA2F91E802062B222222A24BA25CF70510111111DD150C56444444449784C18A888888E8923058111111115D12062B222222A24BC26045444444744918AC888888882E098315111111D12561B022222222BA249EEBBE0022BA9FC4A10FF3F91CB3D90CCBE5121E8F078AA2405114B85CAE6BBE4222A25F8EC18A88AECD72B9C4643241A7D3C162B180DFEF87A669F0783C70BBDDD77D794444BF188315115D8BE57289C562817EBF8F42A180E9748A582C06DBB6619A26831511DD4A0C5644742D96CB25E6F339DAED36DEBE7D8BC16080ADAD2D64B359A8AA0A9FCF77DD974844F48B315811D1B5592C16E876BB38393941B3D984A228300C039148E4BA2F8D88E85761B022A26BB15C2EB15C2E31180C90CFE751A954609A26A2D128363636AEFBF288887E15062B22BA368BC502A3D1088D4603A55209B1580C8D4603E3F1F8BA2F8D88E857E11C2B22BA16A2797D3299A0DFEFA3DD6EA3D168A0D96C623A9D5EF7E51111FD2A0C5644742D168B05C6E33186C3210683013A9D0E6AB59AAC5889A54222A2DB84C18A88AEC56C3643BFDF47B7DBC5683442BFDF47A55241AD56C37038C462B1B8EE4B2422FAC518AC88E85A4C2613388E03C771301C0E311A8DD06EB7D16C3665D89ACFE7D77D994444BF088315115D8BD168844AA58272B92C439458126C369BE8743AECB522A25B87C18A88AEC5783C46A55241B55AC5783CC662B1C0743A45AFD743BD5E87E338984C26D77D994444BF088315115D8BD168846AB58A6AB58AD1682477090E8743F9E71CBB4044B70D8315115D29B1DB6F3C1EA356AB5D0850CBE512C3E110954A05954A05A3D1E8273F8FB82D160BCC6633CCE773EE2624A26BC301A14474E596CBA5AC58D56A35395E4154ACCAE5322A95CACFAA588960359FCF319BCDE072B9A0AA2A0F7126A26BC1604544574A0C05ED76BB701C07AD564B36A98B8AD5BB4B8400E072B9E4C700C07C3EC7643291B3B0C6E331A6D3295C2E17344D83AEEBD0755D862C4551E4BF3F9FCF311E8F31180C309FCFE176BBE1F3F9601806BC5EEF35DC2B447457305811D1959A4EA7E876BB68B55A68B7DB180C0698CD66B262B55AC912F3AC442812C4C78969ED954A05DD6E1793C9042E970BBAAE231C0E2393C9201C0E43D775F939C4EEC37ABD8EB3B3330C0603F8FD7E44A35164B3595896751D770B11DD110C564474A5269309EAF53A6AB51AFAFDFE85910ACBE51293C904ED761B8EE3A0D3E960381C42D334B9B427760F76BB5DE4F37994CB65388E8376BB2DC31500C4E3718CC763CCE773241209783C1ED9DBD56AB570767686BFFDED6FE8743A88C562D8DEDE46341A65B022A28FC2604544576A381CA2542AA1542A61381CBEF7F7B3D90C83C14086AB76BB0DB7DB2D83D57C3E9707371F1C1CA05AADC2E3F1603018A0542AA15AADA2D3E9201C0ECBDE2DD334611886AC56D56A351C1E1EE2CF7FFE335AAD16B6B6B6A0AA2AF6F6F6AEFAEE20A23B86C18A88AED4683442A95442B158FCE0AE3F5191EAF7FB729E95699AD0340DCBE552CEBA6A369BA8D7EBE8F57A88C7E35055159D4E07A55209B55A0DBD5E0F994C06ED761BD3E914CBE5521EA353AD5691CFE791CBE5D0ED7661DB3646A3118FD121A28FC6710B4474A544B0FAA18A1500B93BB056AB5DD83528AA55A23F6BB158C0EFF7239D4E23168B61B95CA2D7EB613299603E9F435114288A0297CB259BE6C500D246A381D1680445516018060CC3E04E4222FA68AC5811D19510BBF97E6A9C82189FF0EE3886D5BF173BF92CCB82DBED86DFEF47BBDD46BFDFC7603080A228F0FBFD0887C3088542F07ABD178255AD5683E33898CD66F0F97C080683080402F078F89448441F87CF224474654425EAA70680AE56ACEAF5FA8560E5F178E42E3E4DD330994C309BCDE4B2E1683482655948A7D3D8DEDE46369B856118EF55AC5AAD1600C0344D84C361D8B60D5555AFE47E20A2BB8BC18A88AE84981DF5A1F955AB5627B3D7EB75D4EB7539CFCAE572C1EBF5221008C0ED76231008A0D96CA25028A056ABA1DBED0200C2E130D2E934D6D6D6108D46E1F3F930994C3E18ACFC7E3F229188AC6C11117D0C062B22BA12D3E9F4C21885D16884F97CFEC18F154B818D4603F57AFDC23C2B9FCF07B7DB0D4DD3E4EEC15AAD864AA582E9740AC330904C26B1B6B6865028247BA73E54B1F2783C304D53062B56AC88E863B1799D88AE84A84055AB55F4FB7D3914F443C4EEBF76BB8D66B3896EB72B77ED793C1E689A064DD3E0F57A319D4EE5A4F6D96C06D334914AA5904AA52EF44D4DA7530C0603399C743018C8AA976DDB080683AC5811D14763B022A22B21760396CBE51F3D5C5998CD66188D46E8743A729ED5EAD2A118CBD0EBF550A95450AFD7B1582C100C06914AA5904824E48886D5CF259ADC67B319344D432010806559F0FBFDDC1548441F8D4B8144746596CB25344D43369BBD70E872A3D1C0783C86D7EB856118B02C0BA669C2EFF723168BC1E3F1BC57E112BB0345DFD660300000799C8D6DDB7237A0988BD56834E49885D56
<\wide-tabular>
<tformat|<table|<row|<\cell>
A. <math|y=f<around*|(|x|)>+g<around*|(|x|)>-<frac|1|4>>
</cell>|<\cell>
B. <math|y=f<around*|(|x|)>-g<around*|(|x|)>-<frac|1|4>>
</cell>>|<row|<\cell>
C. <math|y=f<around*|(|x|)> g<around*|(|x|)>>
</cell>|<\cell>
D. <math|y=<frac|g<around*|(|x|)>|f<around*|(|x|)>>>
</cell>>>>
</wide-tabular>
</framed>
2022-08-29 19:24:27 +08:00
本文将从如何绘制<math|sin<around*|(|x|)>>开始讲解如何绘制题目中的选项D。
2022-08-29 19:24:27 +08:00
<section*|插入<name|Gnuplot>会话>
2022-08-29 19:24:27 +08:00
本文使用<name|Gnuplot>来绘制函数曲线,请提前安装好<name|Gnuplot>这个软件,并保证在墨干编辑器中可以使用<name|Gnuplot>会话。提示Windows平台除了安装<name|Gnuplot>之外还需要额外从Windows应用商店安装Python建议安装Python3.8.x
2022-08-29 19:24:27 +08:00
在墨干编辑器中,使用<menu|Insert|Fold|Executable|Gnuplot>就可以插入一个<name|Gnuplot>会话。
<\session|gnuplot|default>
<\output>
gnuplot 5.4 patchlevel 2
</output>
<\input>
gnuplot]\
<|input>
\;
</input>
</session>
2022-08-29 19:24:27 +08:00
<section*|绘制<math|sin<around*|(|x|)>>>
<\session|gnuplot|default>
<\unfolded-io>
gnuplot]\
<|unfolded-io>
% -width 0.618par
plot sin(x)
<|unfolded-io>
<image|<tuple|<#3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D227574662D382220207374616E64616C6F6E653D226E6F223F3E0A3C737667200A2077696474683D2236303022206865696768743D22343830220A2076696577426F783D223020302036303020343830220A20786D6C6E733D22687474703A2F2F7777772E77332E6F72672F323030302F737667220A20786D6C6E733A786C696E6B3D22687474703A2F2F7777772E77332E6F72672F313939392F786C696E6B220A3E0A0A3C7469746C653E476E75706C6F743C2F7469746C653E0A3C646573633E50726F647563656420627920474E55504C4F5420352E342070617463686C6576656C2032203C2F646573633E0A0A3C672069643D22676E75706C6F745F63616E766173223E0A0A3C7265637420783D22302220793D2230222077696474683D2236303022206865696768743D22343830222066696C6C3D226E6F6E65222F3E0A3C646566733E0A0A093C636972636C652069643D276770446F742720723D27302E3527207374726F6B652D77696474683D27302E3527207374726F6B653D2763757272656E74436F6C6F72272F3E0A093C706174682069643D27677050743027207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C30206832204D302C2D31207632272F3E0A093C706174682069643D27677050743127207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C2D31204C312C31204D312C2D31204C2D312C31272F3E0A093C706174682069643D27677050743227207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C30204C312C30204D302C2D31204C302C31204D2D312C2D31204C312C31204D2D312C31204C312C2D31272F3E0A093C726563742069643D27677050743327207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720783D272D312720793D272D31272077696474683D273227206865696768743D2732272F3E0A093C726563742069643D27677050743427207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F72272066696C6C3D2763757272656E74436F6C6F722720783D272D312720793D272D31272077696474683D273227206865696768743D2732272F3E0A093C636972636C652069643D27677050743527207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F72272063783D2730272063793D27302720723D2731272F3E0A093C75736520786C696E6B3A687265663D27236770507435272069643D276770507436272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C706174682069643D27677050743727207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D302C2D312E3333204C2D312E33332C302E3637204C312E33332C302E3637207A272F3E0A093C75736520786C696E6B3A687265663D27236770507437272069643D276770507438272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C75736520786C696E6B3A687265663D27236770507437272069643D27677050743927207374726F6B653D2763757272656E74436F6C6F7227207472616E73666F726D3D27726F746174652831383029272F3E0A093C75736520786C696E6B3A687265663D27236770507439272069643D27677050743130272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C75736520786C696E6B3A687265663D27236770507433272069643D2767705074313127207374726F6B653D2763757272656E74436F6C6F7227207472616E73666F726D3D27726F7461746528343529272F3E0A093C75736520786C696E6B3A687265663D2723677050743131272069643D27677050743132272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C706174682069643D2767705074313327207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D302C312E333330204C312E3236352C302E343131204C302E3738322C2D312E303637204C2D302E3738322C2D312E303736204C2D312E3236352C302E343131207A272F3E0A093C75736520786C696E6B3A687265663D2723677050743133272069643D27677050743134272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C66696C7465722069643D2774657874626F78272066696C746572556E6974733D276F626A656374426F756E64696E67426F782720783D27302720793D273027206865696768743D2731272077696474683D2731273E0A0920203C6665466C6F6F6420666C6F6F642D636F6C6F723D2777686974652720666C6F6F642D6F7061636974793D27312720726573756C743D2762676E64272F3E0A0920203C6665436F6D706F7369746520696E3D27536F75726365477261706869632720696E323D2762676E6427206F70657261746F723D2761746F70272F3E0A093C2F66696C7465723E0A093C66696C7465722069643
</unfolded-io>
<\input>
gnuplot]\
<|input>
\;
</input>
</session>
2022-08-29 19:24:27 +08:00
不做任何配置,直接绘制<math|sin<around*|(|x|)>>,默认的图像不够友好。
2022-08-29 19:24:27 +08:00
<section*|美化<math|sin<around*|(|x|)>>>
2022-08-29 19:24:27 +08:00
我们来逐步调整一下。首先将上图的边框换成我们熟悉的坐标轴:
<\session|gnuplot|default>
<\unfolded-io>
gnuplot]\
<|unfolded-io>
% -width 0.618par
<\with|color|red>
unset border
set zeroaxis linetype -1 linewidth 2
set xtics axis
set ytics axis
</with>
plot sin(x)
<|unfolded-io>
<image|<tuple|<#3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D227574662D382220207374616E64616C6F6E653D226E6F223F3E0A3C737667200A2077696474683D2236303022206865696768743D22343830220A2076696577426F783D223020302036303020343830220A20786D6C6E733D22687474703A2F2F7777772E77332E6F72672F323030302F737667220A20786D6C6E733A786C696E6B3D22687474703A2F2F7777772E77332E6F72672F313939392F786C696E6B220A3E0A0A3C7469746C653E476E75706C6F743C2F7469746C653E0A3C646573633E50726F647563656420627920474E55504C4F5420352E342070617463686C6576656C2032203C2F646573633E0A0A3C672069643D22676E75706C6F745F63616E766173223E0A0A3C7265637420783D22302220793D2230222077696474683D2236303022206865696768743D22343830222066696C6C3D226E6F6E65222F3E0A3C646566733E0A0A093C636972636C652069643D276770446F742720723D27302E3527207374726F6B652D77696474683D27302E3527207374726F6B653D2763757272656E74436F6C6F72272F3E0A093C706174682069643D27677050743027207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C30206832204D302C2D31207632272F3E0A093C706174682069643D27677050743127207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C2D31204C312C31204D312C2D31204C2D312C31272F3E0A093C706174682069643D27677050743227207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C30204C312C30204D302C2D31204C302C31204D2D312C2D31204C312C31204D2D312C31204C312C2D31272F3E0A093C726563742069643D27677050743327207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720783D272D312720793D272D31272077696474683D273227206865696768743D2732272F3E0A093C726563742069643D27677050743427207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F72272066696C6C3D2763757272656E74436F6C6F722720783D272D312720793D272D31272077696474683D273227206865696768743D2732272F3E0A093C636972636C652069643D27677050743527207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F72272063783D2730272063793D27302720723D2731272F3E0A093C75736520786C696E6B3A687265663D27236770507435272069643D276770507436272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C706174682069643D27677050743727207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D302C2D312E3333204C2D312E33332C302E3637204C312E33332C302E3637207A272F3E0A093C75736520786C696E6B3A687265663D27236770507437272069643D276770507438272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C75736520786C696E6B3A687265663D27236770507437272069643D27677050743927207374726F6B653D2763757272656E74436F6C6F7227207472616E73666F726D3D27726F746174652831383029272F3E0A093C75736520786C696E6B3A687265663D27236770507439272069643D27677050743130272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C75736520786C696E6B3A687265663D27236770507433272069643D2767705074313127207374726F6B653D2763757272656E74436F6C6F7227207472616E73666F726D3D27726F7461746528343529272F3E0A093C75736520786C696E6B3A687265663D2723677050743131272069643D27677050743132272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C706174682069643D2767705074313327207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D302C312E333330204C312E3236352C302E343131204C302E3738322C2D312E303637204C2D302E3738322C2D312E303736204C2D312E3236352C302E343131207A272F3E0A093C75736520786C696E6B3A687265663D2723677050743133272069643D27677050743134272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C66696C7465722069643D2774657874626F78272066696C746572556E6974733D276F626A656374426F756E64696E67426F782720783D27302720793D273027206865696768743D2731272077696474683D2731273E0A0920203C6665466C6F6F6420666C6F6F642D636F6C6F723D2777686974652720666C6F6F642D6F7061636974793D27312720726573756C743D2762676E64272F3E0A0920203C6665436F6D706F7369746520696E3D27536F75726365477261706869632720696E323D2762676E6427206F70657261746F723D2761746F70272F3E0A093C2F66696C7465723E0A093C66696C7465722069643
</unfolded-io>
<\input>
gnuplot]\
<|input>
\;
</input>
</session>
<verbatim|unset border><\footnote>
http://gnuplot.info/docs_5.5/loc9713.html
2022-08-29 19:24:27 +08:00
</footnote>的作用是把外面的边框去掉,<verbatim|zeroaxis><\footnote>
http://gnuplot.info/docs_5.5/loc16801.html
2022-08-29 19:24:27 +08:00
</footnote>可用于设置两个坐标轴都经过原点。
2022-08-29 19:24:27 +08:00
通过上面四行配置,我们得到一个在中学教育中经常使用到的函数曲线图像。
2022-08-29 19:24:27 +08:00
可以再做一些调整,让这个图像更加美观一些:
<\session|gnuplot|default>
<\folded-io>
gnuplot]\
<|folded-io>
% -width 0.618par
unset border
set zeroaxis linetype -1 linewidth 2
set xtics axis
set ytics axis
\;
<\with|color|red>
set xtics pi
set ytics 1
set arrow from 0,0 to 10,0
set arrow from 0,0 to 0,1.5
</with>
\;
plot <with|color|red|[-10:10][-1.5:1.5]> sin(x)
<with|color|red|linecolor rgb "black">
<|folded-io>
<image|<tuple|<#3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D227574662D382220207374616E64616C6F6E653D226E6F223F3E0A3C737667200A2077696474683D2236303022206865696768743D22343830220A2076696577426F783D223020302036303020343830220A20786D6C6E733D22687474703A2F2F7777772E77332E6F72672F323030302F737667220A20786D6C6E733A786C696E6B3D22687474703A2F2F7777772E77332E6F72672F313939392F786C696E6B220A3E0A0A3C7469746C653E476E75706C6F743C2F7469746C653E0A3C646573633E50726F647563656420627920474E55504C4F5420352E342070617463686C6576656C2032203C2F646573633E0A0A3C672069643D22676E75706C6F745F63616E766173223E0A0A3C7265637420783D22302220793D2230222077696474683D2236303022206865696768743D22343830222066696C6C3D226E6F6E65222F3E0A3C646566733E0A0A093C636972636C652069643D276770446F742720723D27302E3527207374726F6B652D77696474683D27302E3527207374726F6B653D2763757272656E74436F6C6F72272F3E0A093C706174682069643D27677050743027207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C30206832204D302C2D31207632272F3E0A093C706174682069643D27677050743127207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C2D31204C312C31204D312C2D31204C2D312C31272F3E0A093C706174682069643D27677050743227207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C30204C312C30204D302C2D31204C302C31204D2D312C2D31204C312C31204D2D312C31204C312C2D31272F3E0A093C726563742069643D27677050743327207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720783D272D312720793D272D31272077696474683D273227206865696768743D2732272F3E0A093C726563742069643D27677050743427207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F72272066696C6C3D2763757272656E74436F6C6F722720783D272D312720793D272D31272077696474683D273227206865696768743D2732272F3E0A093C636972636C652069643D27677050743527207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F72272063783D2730272063793D27302720723D2731272F3E0A093C75736520786C696E6B3A687265663D27236770507435272069643D276770507436272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C706174682069643D27677050743727207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D302C2D312E3333204C2D312E33332C302E3637204C312E33332C302E3637207A272F3E0A093C75736520786C696E6B3A687265663D27236770507437272069643D276770507438272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C75736520786C696E6B3A687265663D27236770507437272069643D27677050743927207374726F6B653D2763757272656E74436F6C6F7227207472616E73666F726D3D27726F746174652831383029272F3E0A093C75736520786C696E6B3A687265663D27236770507439272069643D27677050743130272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C75736520786C696E6B3A687265663D27236770507433272069643D2767705074313127207374726F6B653D2763757272656E74436F6C6F7227207472616E73666F726D3D27726F7461746528343529272F3E0A093C75736520786C696E6B3A687265663D2723677050743131272069643D27677050743132272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C706174682069643D2767705074313327207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D302C312E333330204C312E3236352C302E343131204C302E3738322C2D312E303637204C2D302E3738322C2D312E303736204C2D312E3236352C302E343131207A272F3E0A093C75736520786C696E6B3A687265663D2723677050743133272069643D27677050743134272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C66696C7465722069643D2774657874626F78272066696C746572556E6974733D276F626A656374426F756E64696E67426F782720783D27302720793D273027206865696768743D2731272077696474683D2731273E0A0920203C6665466C6F6F6420666C6F6F642D636F6C6F723D2777686974652720666C6F6F642D6F7061636974793D27312720726573756C743D2762676E64272F3E0A0920203C6665436F6D706F7369746520696E3D27536F75726365477261706869632720696E323D2762676E6427206F70657261746F723D2761746F70272F3E0A093C2F66696C7465723E0A093C66696C7465722069643
</folded-io>
<\input>
gnuplot]\
<|input>
\;
</input>
</session>
2022-08-29 19:24:27 +08:00
接下来新增的四行,我们配置了<math|x>轴的刻度单位是<math|\<pi\>><math|y>轴的刻度单位是1然后绘制了两个箭头。在最后的plot命令中设置了定义域为<math|<around*|[|-10:10|]>>,值域为<math|<around*|[|-1.5:1.5|]>>,最后把曲线颜色调整成了黑色。
2022-08-29 19:24:27 +08:00
通过以上配置,我们得到一个在中学教育中经常使用的函数曲线图像。
2022-08-29 19:24:27 +08:00
<section*|绘制选项D>
2022-08-29 19:24:27 +08:00
我们选中上一个小节中的代码片段使用右键菜单复制然后使用右键菜单粘贴到下面的会话中。修改plot命令里面的函数就可以绘制选项D的曲线在这个例子中我们稍稍调整一下刻度、定义域、值域以更加清楚地展示曲线的性质
<\session|gnuplot|default>
<\unfolded-io>
gnuplot]\
<|unfolded-io>
% -width 0.8par
unset border
set zeroaxis linetype -1 linewidth 2
set xtics axis
set ytics axis
\;
set xtics pi
set ytics 0.5
set arrow from 0,0 to 15,0
set arrow from 0,0 to 0,1.2
\;
plot [-15:15][-1.2:1.2] <with|color|red|(sin(x)/(x*x+1/4)) \\>
linecolor rgb "red" <with|color|red|linewidth 1.5>
<|unfolded-io>
<image|<tuple|<#3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D227574662D382220207374616E64616C6F6E653D226E6F223F3E0A3C737667200A2077696474683D2236303022206865696768743D22343830220A2076696577426F783D223020302036303020343830220A20786D6C6E733D22687474703A2F2F7777772E77332E6F72672F323030302F737667220A20786D6C6E733A786C696E6B3D22687474703A2F2F7777772E77332E6F72672F313939392F786C696E6B220A3E0A0A3C7469746C653E476E75706C6F743C2F7469746C653E0A3C646573633E50726F647563656420627920474E55504C4F5420352E342070617463686C6576656C2032203C2F646573633E0A0A3C672069643D22676E75706C6F745F63616E766173223E0A0A3C7265637420783D22302220793D2230222077696474683D2236303022206865696768743D22343830222066696C6C3D226E6F6E65222F3E0A3C646566733E0A0A093C636972636C652069643D276770446F742720723D27302E3527207374726F6B652D77696474683D27302E3527207374726F6B653D2763757272656E74436F6C6F72272F3E0A093C706174682069643D27677050743027207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C30206832204D302C2D31207632272F3E0A093C706174682069643D27677050743127207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C2D31204C312C31204D312C2D31204C2D312C31272F3E0A093C706174682069643D27677050743227207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C30204C312C30204D302C2D31204C302C31204D2D312C2D31204C312C31204D2D312C31204C312C2D31272F3E0A093C726563742069643D27677050743327207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720783D272D312720793D272D31272077696474683D273227206865696768743D2732272F3E0A093C726563742069643D27677050743427207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F72272066696C6C3D2763757272656E74436F6C6F722720783D272D312720793D272D31272077696474683D273227206865696768743D2732272F3E0A093C636972636C652069643D27677050743527207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F72272063783D2730272063793D27302720723D2731272F3E0A093C75736520786C696E6B3A687265663D27236770507435272069643D276770507436272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C706174682069643D27677050743727207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D302C2D312E3333204C2D312E33332C302E3637204C312E33332C302E3637207A272F3E0A093C75736520786C696E6B3A687265663D27236770507437272069643D276770507438272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C75736520786C696E6B3A687265663D27236770507437272069643D27677050743927207374726F6B653D2763757272656E74436F6C6F7227207472616E73666F726D3D27726F746174652831383029272F3E0A093C75736520786C696E6B3A687265663D27236770507439272069643D27677050743130272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C75736520786C696E6B3A687265663D27236770507433272069643D2767705074313127207374726F6B653D2763757272656E74436F6C6F7227207472616E73666F726D3D27726F7461746528343529272F3E0A093C75736520786C696E6B3A687265663D2723677050743131272069643D27677050743132272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C706174682069643D2767705074313327207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D302C312E333330204C312E3236352C302E343131204C302E3738322C2D312E303637204C2D302E3738322C2D312E303736204C2D312E3236352C302E343131207A272F3E0A093C75736520786C696E6B3A687265663D2723677050743133272069643D27677050743134272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C66696C7465722069643D2774657874626F78272066696C746572556E6974733D276F626A656374426F756E64696E67426F782720783D27302720793D273027206865696768743D2731272077696474683D2731273E0A0920203C6665466C6F6F6420666C6F6F642D636F6C6F723D2777686974652720666C6F6F642D6F7061636974793D27312720726573756C743D2762676E64272F3E0A0920203C6665436F6D706F7369746520696E3D27536F75726365477261706869632720696E323D2762676E6427206F70657261746F723D2761746F70272F3E0A093C2F66696C7465723E0A093C66696C7465722069643
</unfolded-io>
<\input>
gnuplot]\
<|input>
\;
</input>
</session>
2022-08-29 19:24:27 +08:00
也可以在同一个段落里面绘制两个曲线,如下所示:
<\session|gnuplot|default>
<\unfolded-io>
gnuplot]\
<|unfolded-io>
% -width 0.8par
unset border
set zeroaxis linetype -1 linewidth 2
set xtics axis
set ytics axis
\;
set xtics pi
set ytics 0.5
set arrow from 0,0 to 15,0
set arrow from 0,0 to 0,1.2
\;
plot [-15:15][-1.2:1.2] \\
(sin(x)/(x*x+1/4)) linecolor rgb "red" linewidth 1.5<with|color|red|,>
\\
<with|color|red|sin(x) linecolor rgb "blue">
\;
<|unfolded-io>
<image|<tuple|<#3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D227574662D382220207374616E64616C6F6E653D226E6F223F3E0A3C737667200A2077696474683D2236303022206865696768743D22343830220A2076696577426F783D223020302036303020343830220A20786D6C6E733D22687474703A2F2F7777772E77332E6F72672F323030302F737667220A20786D6C6E733A786C696E6B3D22687474703A2F2F7777772E77332E6F72672F313939392F786C696E6B220A3E0A0A3C7469746C653E476E75706C6F743C2F7469746C653E0A3C646573633E50726F647563656420627920474E55504C4F5420352E342070617463686C6576656C2032203C2F646573633E0A0A3C672069643D22676E75706C6F745F63616E766173223E0A0A3C7265637420783D22302220793D2230222077696474683D2236303022206865696768743D22343830222066696C6C3D226E6F6E65222F3E0A3C646566733E0A0A093C636972636C652069643D276770446F742720723D27302E3527207374726F6B652D77696474683D27302E3527207374726F6B653D2763757272656E74436F6C6F72272F3E0A093C706174682069643D27677050743027207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C30206832204D302C2D31207632272F3E0A093C706174682069643D27677050743127207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C2D31204C312C31204D312C2D31204C2D312C31272F3E0A093C706174682069643D27677050743227207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D2D312C30204C312C30204D302C2D31204C302C31204D2D312C2D31204C312C31204D2D312C31204C312C2D31272F3E0A093C726563742069643D27677050743327207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720783D272D312720793D272D31272077696474683D273227206865696768743D2732272F3E0A093C726563742069643D27677050743427207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F72272066696C6C3D2763757272656E74436F6C6F722720783D272D312720793D272D31272077696474683D273227206865696768743D2732272F3E0A093C636972636C652069643D27677050743527207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F72272063783D2730272063793D27302720723D2731272F3E0A093C75736520786C696E6B3A687265663D27236770507435272069643D276770507436272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C706174682069643D27677050743727207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D302C2D312E3333204C2D312E33332C302E3637204C312E33332C302E3637207A272F3E0A093C75736520786C696E6B3A687265663D27236770507437272069643D276770507438272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C75736520786C696E6B3A687265663D27236770507437272069643D27677050743927207374726F6B653D2763757272656E74436F6C6F7227207472616E73666F726D3D27726F746174652831383029272F3E0A093C75736520786C696E6B3A687265663D27236770507439272069643D27677050743130272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C75736520786C696E6B3A687265663D27236770507433272069643D2767705074313127207374726F6B653D2763757272656E74436F6C6F7227207472616E73666F726D3D27726F7461746528343529272F3E0A093C75736520786C696E6B3A687265663D2723677050743131272069643D27677050743132272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C706174682069643D2767705074313327207374726F6B652D77696474683D27302E32323227207374726F6B653D2763757272656E74436F6C6F722720643D274D302C312E333330204C312E3236352C302E343131204C302E3738322C2D312E303637204C2D302E3738322C2D312E303736204C2D312E3236352C302E343131207A272F3E0A093C75736520786C696E6B3A687265663D2723677050743133272069643D27677050743134272066696C6C3D2763757272656E74436F6C6F7227207374726F6B653D276E6F6E65272F3E0A093C66696C7465722069643D2774657874626F78272066696C746572556E6974733D276F626A656374426F756E64696E67426F782720783D27302720793D273027206865696768743D2731272077696474683D2731273E0A0920203C6665466C6F6F6420666C6F6F642D636F6C6F723D2777686974652720666C6F6F642D6F7061636974793D27312720726573756C743D2762676E64272F3E0A0920203C6665436F6D706F7369746520696E3D27536F75726365477261706869632720696E323D2762676E6427206F70657261746F723D2761746F70272F3E0A093C2F66696C7465723E0A093C66696C7465722069643
</unfolded-io>
<\input>
gnuplot]\
<|input>
\;
</input>
</session>
\;
\;
\;
</body>
<\references>
<\collection>
<associate|auto-1|<tuple|?|?>>
<associate|auto-2|<tuple|?|?>>
<associate|auto-3|<tuple|?|?>>
<associate|auto-4|<tuple|?|?>>
<associate|auto-5|<tuple|2|?>>
<associate|footnote-1|<tuple|1|?>>
<associate|footnote-2|<tuple|2|?>>
<associate|footnr-1|<tuple|1|?>>
<associate|footnr-2|<tuple|2|?>>
</collection>
</references>
<\auxiliary>
<\collection>
<\associate|idx>
2022-08-29 19:24:27 +08:00
<tuple|<tuple|<with|font-family|<quote|ss>|插入>|<with|font-family|<quote|ss>|折叠>|<with|font-family|<quote|ss>|可运行>|<with|font-family|<quote|ss>|Gnuplot>>|<pageref|auto-2>>
</associate>
<\associate|toc>
2022-08-29 19:24:27 +08:00
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|插入<with|font-shape|<quote|small-caps>|Gnuplot>会话>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-1><vspace|0.5fn>
2022-08-29 19:24:27 +08:00
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|绘制<with|mode|<quote|math>|sin<around*|(|x|)>>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-3><vspace|0.5fn>
2022-08-29 19:24:27 +08:00
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|美化<with|mode|<quote|math>|sin<around*|(|x|)>>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-4><vspace|0.5fn>
2022-08-29 19:24:27 +08:00
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|绘制选项D>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-5><vspace|0.5fn>
</associate>
</collection>
</auxiliary>