Grafici con Tikz numero 19 (grafico della parte intera)

Immagini matematica

Home » Grafici con Tikz numero 19 (grafico della parte intera)
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
post
page


Prima di ogni figura ricordare di mettere

\documentclass[usenames,dvipsnames]{article}
\usepackage{pgfplots}

Figura

 

 

Rendered by QuickLaTeX.com

 

 

Codice della figura

 

\begin{tikzpicture}
\begin{axis}[
axis equal image,
axis x line=center,
axis y line=center,
xmin = -3.5,
xmax = 3.5,
ymin = -3.5,
ymax = 3.5,
xlabel = {$x$},
ylabel = {$y$},
ylabel style={anchor=north east},
extra x ticks = {0},
extra x tick label = {$\hspace{0.4cm}0$},
xtick={-4,-3,...,4},
ytick={-4,-3,...,4},
yticklabel style={right,xshift={1ex}},
]

\foreach \x in {-4,-3,...,4} {
\addplot[very thick,blue] coordinates {(\x,\x) (1+\x,\x)};
\addplot[only marks,mark=*,blue] coordinates {(\x,\x)};
\addplot[only marks,mark=*,blue,mark options={fill=white},thick] coordinates {(1+\x,\x)};
}
\addplot[blue,no marks] coordinates {(-2,2)} node {$y=\lfloor x \rfloor$};
\end{axis}
\end{tikzpicture}