我如何获得顶部的X轴,但在底部保持一条线

jborch 01/30/2014. 1 answers, 1.728 views
pgfplots

我有以下情节

  \ {的DocumentClass独立}  \ usepackage {pgfplots}  \ pgfplotsset {COMPAT =最新}  \ {开始}文件  \ {开始} tikzpicture  \开始{轴} [  xlabel = $ x $,ylabel = $ \ sin x $, 轴x线* =框]  \ addplot [蓝色,标记=无, 域= -10:0,样品= 40]  {罪(度(X))};  \ {端轴}  \ {端} tikzpicture  \ {端文档} 

在这里输入图像描述

但我想在上面的x轴:

  \ {的DocumentClass独立}  \ usepackage {pgfplots}  \ pgfplotsset {宽度=6厘米,COMPAT =最新}  \ {开始}文件  \ {开始} tikzpicture  \开始{轴} [  xlabel = $ x $,ylabel = $ \ sin x $, 轴x行* =顶部]  \ addplot [蓝色,标记=无, 域= -10:0,样品= 40  ]  {罪(度(X))};  \ {端轴}  \ {端} tikzpicture  \ {端文档} 

在这里输入图像描述

我如何获得底线后面的线?

在这里输入图像描述

1 Answers


Gonzalo Medina 01/30/2014.

该线在那里,但它可能会与独立图像的边界混淆; 如果你想明确区分它,你可以给border一些价值:

\documentclass[border = 1pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=6cm,compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,ylabel=$\sin x$,
axis x line*=top]
\draw (axis description cs:0,0) -- (axis description cs:1,0); 
\addplot[blue,mark=none,
domain=-10:0,samples=40
]
{sin(deg(x))};
\end{axis}
\end{tikzpicture}
\end{document} 

在这里输入图像描述

选项border=1pt添加一个小边框( 1pt宽); 要仅在底部和左侧添加边框,请改为使用border={0pt 1pt 1pt 0pt}


HighResolutionMusic.com - Download Hi-Res Songs

1 (G)I-DLE

POP/STARS flac

(G)I-DLE. 2018. Writer: Riot Music Team;Harloe.
2 Ariana Grande

​Thank U, Next flac

Ariana Grande. 2018. Writer: Crazy Mike;Scootie;Victoria Monét;Tayla Parx;TBHits;Ariana Grande.
3 Clean Bandit

Baby flac

Clean Bandit. 2018. Writer: Jack Patterson;Kamille;Jason Evigan;Matthew Knott;Marina;Luis Fonsi.
4 Imagine Dragons

Bad Liar flac

Imagine Dragons. 2018. Writer: Jorgen Odegard;Daniel Platzman;Ben McKee;Wayne Sermon;Aja Volkman;Dan Reynolds.
5 Halsey

Without Me flac

Halsey. 2018. Writer: Halsey;Delacey;Louis Bell;Amy Allen;Justin Timberlake;Timbaland;Scott Storch.
6 BTS

Waste It On Me flac

BTS. 2018. Writer: Steve Aoki;Jeff Halavacs;Ryan Ogren;Michael Gazzo;Nate Cyphert;Sean Foreman;RM.
7 Nicki Minaj

No Candle No Light flac

Nicki Minaj. 2018. Writer: Denisia “Blu June” Andrews;Kathryn Ostenberg;Brittany "Chi" Coney;Brian Lee;TJ Routon;Tushar Apte;ZAYN;Nicki Minaj.
8 Backstreet Boys

Chances flac

Backstreet Boys. 2018.
9 BlackPink

Kiss And Make Up flac

BlackPink. 2018. Writer: Soke;Kny Factory;Billboard;Chelcee Grimes;Teddy Park;Marc Vincent;Dua Lipa.
10 Little Mix

The Cure flac

Little Mix. 2018. Writer: Pete Kelleher;Camille Purcell;Tom Barnes;Ben Kohn.
11 Fitz And The Tantrums

HandClap flac

Fitz And The Tantrums. 2017. Writer: Fitz And The Tantrums;Eric Frederic;Sam Hollander.
12 Diplo

Close To Me flac

Diplo. 2018. Writer: Ellie Goulding;Savan Kotecha;Peter Svensson;Ilya;Swae Lee;Diplo.
13 The Chainsmokers

Beach House flac

The Chainsmokers. 2018. Writer: Andrew Taggart.
14 Bradley Cooper

Always Remember Us This Way flac

Bradley Cooper. 2018. Writer: Lady Gaga;Dave Cobb.
15 Kelly Clarkson

Never Enough flac

Kelly Clarkson. 2018. Writer: Benj Pasek;Justin Paul.
16 Lady Gaga

I'll Never Love Again flac

Lady Gaga. 2018. Writer: Benjamin Rice;Lady Gaga.
17 Frida Sundemo

Apologize flac

Frida Sundemo. 2018.
18 Little Mix

Woman Like Me flac

Little Mix. 2018. Writer: Nicki Minaj;Steve Mac;Ed Sheeran;Jess Glynne.
19 Imagine Dragons

Machine flac

Imagine Dragons. 2018. Writer: Wayne Sermon;Daniel Platzman;Dan Reynolds;Ben McKee;Alex Da Kid.
20 Billie Eilish

When The Party's Over flac

Billie Eilish. 2018. Writer: Billie Eilish;FINNEAS.

Related questions

Hot questions

Language

Popular Tags