\documentclass[ 11pt, % Schriftgröße paper=a4, DIV=13, % Seitenlayout (Satzspiegel) parskip=half, % Abstand zwischen Absätzen %twoside, % Doppelseitig %openright, % neues Kapitel rechts % cleardoublepage, bibtotoc, % Literaturverzeichis in Inhaltsverzeichnis headsepline, % Kopfzeilentrennlinie headings, % draft, % Korrekturfassung ]{scrreprt} % scrartcl % Eingabecodierung \usepackage[utf8]{inputenc} % Schriftcodierung \usepackage[T1]{fontenc} % Sprachraum \usepackage[ngerman]{babel} % Blindtext \usepackage{blindtext} % Schrifteinstellungen \usepackage{lmodern} % Vektorschrift \renewcommand{\familydefault}{\sfdefault} % Serifenlose Schrift \usepackage{sansmath} % Mathe-Schrift ohne Serifen \sansmath % aktiviert serifenlose Matheschrift \usepackage{microtype} % harmonische Typenverteilung %\usepackage{hyperref} % Literatur einbinden \usepackage{csquotes} % Steuerung der Anführungszeichen \usepackage[ backend=biber, % Sortier-Compiler style=numeric-comp, % Zitationsstil block=ragged, ]{biblatex} \addbibresource{ref/Bibliothek.bib} \usepackage{booktabs} % Mathemodus \usepackage{amsmath,amssymb} % Trennung \hyphenation{Crash-zo-ne} % Bilder einbinden \usepackage{graphicx} \graphicspath{{bilder/}} \usepackage{svg} \usepackage{pgfkeys} \usepackage{tikz} \usetikzlibrary{shapes.geometric, arrows} \tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=red!30] \tikzstyle{io} = [trapezium, trapezium stretches=true, % A later addition trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30] \tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30] \tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30] \tikzstyle{arrow} = [thick,->,>=stealth] \usepackage{pgfplots}\pgfplotsset{compat=newest} \usetikzlibrary{arrows.meta,positioning,calc} %für lange Tabelle \usepackage{longtable} \usepackage{algorithm} \usepackage{algpseudocode} \usepackage[export]{adjustbox} % für tikz \pgfplotsset{select coords between index/.style 2 args={ x filter/.code={ \ifnum\coordindex<#1\def\pgfmathresult{}\fi \ifnum\coordindex>#2\def\pgfmathresult{}\fi } }} \usepackage{subcaption} \usepackage{pdfpages} \usepackage{acronym}%abkürzung \usetikzlibrary{arrows, decorations.markings} \makeatletter \tikzset{ nomorepostaction/.code=\makeatletter\let\tikz@postactions\pgfutil@empty, my axis/.style={ postaction={ decoration={ markings, mark=at position 1 with { \arrow[ultra thick]{latex} } }, decorate, nomorepostaction }, thin, -, % switch off other arrow tips every path/.append style=my axis % this is necessary %so it works both with "axis lines=left" and "axis lines=center" } } \makeatother \renewcommand*{\chapterheadstartvskip}{\vspace*{-1\baselineskip}}% Abstand einstellen \renewcommand*\chapterheadendvskip{% \vspace*{1\baselineskip plus -1\baselineskip minus .167\baselineskip}} \begin{document} \begin{figure}[htpb] \begin{subfigure}{0.55\textwidth} \begin{tikzpicture} \begin{axis}[ %xtick=\empty, xlabel={$x$}, ylabel={$y$}, ymax=1.1, %title={Plot der Funktion $y = x^2$}, grid=major, domain=0:5, axis line style={my axis}, samples=100, axis lines=left, xticklabel={\ifdim\tick pt=0pt \else\pgfmathprintnumber{\tick}\fi}, legend pos=south east, ] \addplot[red,line width=1.5pt] {1-e^-x}; \addlegendentry{$t$}; % \addplot[blue, dashed]{1}; \addplot[blue,domain=0:1.25,line width=1.5pt]{0.8*x}; \addlegendentry{$y$}; \addplot[gray, dashed,line width=1.5pt]{1}; \end{axis} \end{tikzpicture} \caption{bild a} \label{a} \end{subfigure}% \begin{subfigure}{0.5\textwidth} \begin{tikzpicture} \begin{axis}[ xlabel={$t$}, %ylabel={$xy$}, ymax=1.1, grid=major, domain=0:5, samples=100, axis lines=left, axis line style={my axis}, xticklabel={\ifdim\tick pt=0pt \else\pgfmathprintnumber{\tick}\fi}, legend pos=south east, ] \addplot[red,domain=0:1,line width=1.5pt] {x^2}; \addlegendentry{$x$} \addplot[dashed,domain=0:1,line width=1.5pt] {x}; \draw[green] (0.2,0.2) -- (0.2,0.4) -- (0.4,0.4); \node at (0.2,0.5) [green] {steig}; % Unsichtbarer grüner Plot für die Legende \addlegendimage{green, line width=1.5pt}; \addlegendentry{steig}; \end{axis} \end{tikzpicture} \caption{bild b} \label{b} \end{subfigure} \caption{Veranschaulichung} \end{figure} \end{document}
Gleiche x-Achse Thema ist als GELÖST markiert
-
- Forum-Century
- Beiträge: 214
- Registriert: So 4. Apr 2021, 14:27
Gleiche x-Achse
Hallo ich möchte bei beiden Diagrammen die gleiche Achse (0 bis 1 Sekunde, also wie links). Wie mache ich das ? Ansonsten soll nicht geändert werden
Zuletzt geändert von basti-fantasti-48 am Fr 21. Jun 2024, 15:11, insgesamt 1-mal geändert.
- Stefan Kottwitz
- Admin
- Beiträge: 2759
- Registriert: Di 8. Jul 2008, 00:39
- Kontaktdaten:
Re: Gleiche x-Achse
Ich müsste raten, welche Achse, wenn es wie links ist dann wäre es ja die y-Achse weil die x-Achse links bis 5 geht, und die y-Achsen sehen doch genau gleich aus?basti-fantasti-48 hat geschrieben: ↑Fr 21. Jun 2024, 09:36Hallo ich möchte bei beiden Diagrammen die gleiche Achse (0 bis 1 Sekunde, also wie links).
Stefan
-
- Forum-Century
- Beiträge: 214
- Registriert: So 4. Apr 2021, 14:27
Re: Gleiche x-Achse
Ich meine wie das Diagramm rechts (es geht nur um die x-Achse (hier t - Achse)). Dachte das ist klar weil ich die Sekunden hingeschrieben habe. Aber ich möchte bei beiden Diagramm 0 bis 1s
Re: Gleiche x-Achse
Das ist beileibe kein Minimalbeispiel. Setze einfach domain auf 0:1.
\documentclass[ 11pt, % Schriftgröße paper=a4, DIV=13, % Seitenlayout (Satzspiegel) parskip=half, % Abstand zwischen Absätzen %twoside, % Doppelseitig %openright, % neues Kapitel rechts % cleardoublepage, bibtotoc, % Literaturverzeichis in Inhaltsverzeichnis headsepline, % Kopfzeilentrennlinie headings, % draft, % Korrekturfassung ]{scrreprt} % scrartcl % Eingabecodierung \usepackage[utf8]{inputenc} % Schriftcodierung \usepackage[T1]{fontenc} % Sprachraum \usepackage[ngerman]{babel} % Blindtext \usepackage{blindtext} % Schrifteinstellungen \usepackage{lmodern} % Vektorschrift \renewcommand{\familydefault}{\sfdefault} % Serifenlose Schrift \usepackage{sansmath} % Mathe-Schrift ohne Serifen \sansmath % aktiviert serifenlose Matheschrift \usepackage{microtype} % harmonische Typenverteilung %\usepackage{hyperref} % Literatur einbinden \usepackage{csquotes} % Steuerung der Anführungszeichen \usepackage[ backend=biber, % Sortier-Compiler style=numeric-comp, % Zitationsstil block=ragged, ]{biblatex} \addbibresource{ref/Bibliothek.bib} \usepackage{booktabs} % Mathemodus \usepackage{amsmath,amssymb} % Trennung \hyphenation{Crash-zo-ne} % Bilder einbinden \usepackage{graphicx} \graphicspath{{bilder/}} \usepackage{svg} \usepackage{pgfkeys} \usepackage{tikz} \usetikzlibrary{shapes.geometric, arrows} \tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=red!30] \tikzstyle{io} = [trapezium, trapezium stretches=true, % A later addition trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30] \tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30] \tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30] \tikzstyle{arrow} = [thick,->,>=stealth] \usepackage{pgfplots}\pgfplotsset{compat=newest} \usetikzlibrary{arrows.meta,positioning,calc} %für lange Tabelle \usepackage{longtable} \usepackage{algorithm} \usepackage{algpseudocode} \usepackage[export]{adjustbox} % für tikz \pgfplotsset{select coords between index/.style 2 args={ x filter/.code={ \ifnum\coordindex<#1\def\pgfmathresult{}\fi \ifnum\coordindex>#2\def\pgfmathresult{}\fi } }} \usepackage{subcaption} \usepackage{pdfpages} \usepackage{acronym}%abkürzung \usetikzlibrary{arrows, decorations.markings} \makeatletter \tikzset{ nomorepostaction/.code=\makeatletter\let\tikz@postactions\pgfutil@empty, my axis/.style={ postaction={ decoration={ markings, mark=at position 1 with { \arrow[ultra thick]{latex} } }, decorate, nomorepostaction }, thin, -, % switch off other arrow tips every path/.append style=my axis % this is necessary %so it works both with "axis lines=left" and "axis lines=center" } } \makeatother \renewcommand*{\chapterheadstartvskip}{\vspace*{-1\baselineskip}}% Abstand einstellen \renewcommand*\chapterheadendvskip{% \vspace*{1\baselineskip plus -1\baselineskip minus .167\baselineskip}} \begin{document} \begin{figure}[htpb] \begin{subfigure}{0.55\textwidth} \begin{tikzpicture} \begin{axis}[ %xtick=\empty, xlabel={$x$}, ylabel={$y$}, ymax=1.1, %title={Plot der Funktion $y = x^2$}, grid=major, domain=0:1, axis line style={my axis}, samples=100, axis lines=left, xticklabel={\ifdim\tick pt=0pt \else\pgfmathprintnumber{\tick}\fi}, legend pos=south east, ] \addplot[red,line width=1.5pt] {1-e^-x}; \addlegendentry{$t$}; % \addplot[blue, dashed]{1}; \addplot[blue,domain=0:1,line width=1.5pt]{0.8*x}; \addlegendentry{$y$}; \addplot[gray, dashed,line width=1.5pt]{1}; \end{axis} \end{tikzpicture} \caption{bild a} \label{a} \end{subfigure}% \begin{subfigure}{0.5\textwidth} \begin{tikzpicture} \begin{axis}[ xlabel={$t$}, %ylabel={$xy$}, ymax=1.1, grid=major, domain=0:1, samples=100, axis lines=left, axis line style={my axis}, xticklabel={\ifdim\tick pt=0pt \else\pgfmathprintnumber{\tick}\fi}, legend pos=south east, ] \addplot[red,domain=0:1,line width=1.5pt] {x^2}; \addlegendentry{$x$} \addplot[dashed,domain=0:1,line width=1.5pt] {x}; \draw[green] (0.2,0.2) -- (0.2,0.4) -- (0.4,0.4); \node at (0.2,0.5) [green] {steig}; % Unsichtbarer grüner Plot für die Legende \addlegendimage{green, line width=1.5pt}; \addlegendentry{steig}; \end{axis} \end{tikzpicture} \caption{bild b} \label{b} \end{subfigure} \caption{Veranschaulichung} \end{figure} \end{document}
-
- Forum-Century
- Beiträge: 214
- Registriert: So 4. Apr 2021, 14:27
Re: Gleiche x-Achse
danke aber die funktion ist ja jetzt nicht mehr so abgebildet wie davor
die soll genauso aussehen
die soll genauso aussehen
- Stefan Kottwitz
- Admin
- Beiträge: 2759
- Registriert: Di 8. Jul 2008, 00:39
- Kontaktdaten:
Re: Gleiche x-Achse
Dann setze in der geplotteten Funktions-Formel jeweils 5*x statt x ein,
Stefan
Stefan