\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Jaime LL (Reddas)} \pdfinfo{ /Title (edicion-de-graficos-de-matlab.pdf) /Creator (Cheatography) /Author (Jaime LL (Reddas)) /Subject (Edición de gráficos de Matlab Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{BABABA} \definecolor{LightBackground}{HTML}{F6F6F6} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Edición de gráficos de Matlab Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Jaime LL (Reddas)} via \textcolor{DarkBackground}{\uline{cheatography.com/42996/cs/12861/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Jaime LL (Reddas) \\ \uline{cheatography.com/reddas} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 19th September, 2017.\\ Updated 16th September, 2019.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{tabularx}{17.67cm}{x{6.7353 cm} x{10.5347 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Propiedades de figura}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Visible}} & Elige si se muestra o no (on/off) en pantalla la figura. \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} {\bf{Position/OuterPosition}} & Posición y tamaño de la figura en la pantalla. \tn % Row Count 5 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Si no se ha asignado a una variable en la creación, se puede obtener el objeto figura actual con la función {\emph{gcf}}.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{6.7353 cm} x{10.5347 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Propiedades de eje}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Propiedad}} & {\bf{Efecto}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{X/Y/ZLim}} & Par de valores que fija el valor {[}mínimo, máximo{]} de los ejes. \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{X/Y/ZScale}} & Escala de cada eje: lineal ('linear') o logarítmica ('log') \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} {\bf{X/Y/ZDir}} & Dirección de crecimiento de los ejes ('normal' o 'reverse') \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} {\bf{X/Y/ZAxisLocation}} & Posición de los ejes ('origin', 'top', 'bottom') \tn % Row Count 13 (+ 3) % Row 5 \SetRowColor{white} {\bf{X/Y/ZTick}} & Valores de cada tick de los ejes \tn % Row Count 15 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{X/Y/ZTickLabel}} & Texto que se muestra en cada posición de Tick. si se deja en blanco hace que no se muestren los números en los ejes. \tn % Row Count 20 (+ 5) % Row 7 \SetRowColor{white} {\bf{X/Y/ZTickLabelRotation}} & Valor de la inclinación de los {\emph{ticks}}, en grados \tn % Row Count 23 (+ 3) % Row 8 \SetRowColor{LightBackground} {\bf{X/Y/ZGrid}} & Activa/Desactiva ('on'/'off') las líneas de grid en cada posición del eje en la que haya un tick. \tn % Row Count 28 (+ 5) % Row 9 \SetRowColor{white} {\bf{X/Y/ZMinorGrid}} & Activa/Desactiva ('on'/'off') las líneas de grid en cada posición del eje que estén marcadas, pero en las que no haya tick. \tn % Row Count 34 (+ 6) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{6.7353 cm} x{10.5347 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Propiedades de eje (cont)}} \tn % Row 10 \SetRowColor{LightBackground} {\bf{FontSize}} & Tamaño de la fuente de los ticks y los rótulos. (Sobrescribe X/Y/Zlabel) \tn % Row Count 4 (+ 4) % Row 11 \SetRowColor{white} {\bf{FontName}} & Fuente del texto, por defecto es 'Helvetica' \tn % Row Count 6 (+ 2) % Row 12 \SetRowColor{LightBackground} {\bf{TickDir}} & Elige si los ticks van hacia fuera o hacia dentro de la figura ('in', 'out') \tn % Row Count 10 (+ 4) % Row 13 \SetRowColor{white} {\bf{Box}} & Elige si se muestra o no el marco de los ejes ('on', 'off') \tn % Row Count 13 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Para obtener un objeto eje se puede usar gca; se accede a sus propiedades como a un struct (notación punto-propiedad).} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.5264 cm} x{11.7436 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Propiedades de linea}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Propiedad}} & {\bf{Efecto}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{Color}} & Color de la línea, en triada RGB. \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{Marker}} & Forma del cada punto dibujado. \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{MarkerSize}} & Tamaño de los puntos. Valor por defecto: 6. \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{MarkerFaceColor}} & Color de relleno de los puntos. Valor por defecto: 'none'. \tn % Row Count 11 (+ 3) % Row 5 \SetRowColor{white} {\bf{MarkerFaceAlpha}} & Opacidad de los puntos. Desde 1(Opaco) hasta 0 (Transparente). \tn % Row Count 14 (+ 3) % Row 6 \SetRowColor{LightBackground} {\bf{MarkerEdgeColor}} & Color del borde de los puntos. \tn % Row Count 16 (+ 2) % Row 7 \SetRowColor{white} {\bf{LineStyle}} & Estilo de la línea que une los puntos. Valor por defecto '-'. \tn % Row Count 19 (+ 3) % Row 8 \SetRowColor{LightBackground} {\bf{LineWidth}} & Grosor de la línea que une los puntos. Por defecto: 0.5. \tn % Row Count 22 (+ 3) % Row 9 \SetRowColor{white} {\bf{X/Y/ZData}} & Valores del vector X,Y o Z que se está representando. \tn % Row Count 24 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Estas propiedades también se pueden ajustar directamente al crear el plot, con un par nombre-valor dentro del paréntesis. \newline Si no se ha asignado la linea a una variable, se puede hacer a posteriori accediendo a la propiedad Children de los ejes.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{4.5549 cm} x{5.2297 cm} x{7.0854 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Funciones externas}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Notación compacta}} & {\bf{Notación extendida}} & {\bf{Efecto}} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} {\bf{hold on/off}} & hold(Ejes, 'on/off') & Los siguientes ploteos se \seqsplit{superpondrán/eliminarán} a los actuales. \tn % Row Count 8 (+ 5) % Row 2 \SetRowColor{LightBackground} {\bf{grid on/off/minor}} & grid(Ejes, \seqsplit{'on/off/minor')} & Activa o desactiva el grid con on/off, y con minor cambia entre mostrar o no un grid m'as fino \tn % Row Count 14 (+ 6) % Row 3 \SetRowColor{white} {\bf{x/y/zlim auto/manual}} & \seqsplit{x/y/zlim(Ejes}, \seqsplit{'auto/manual')} & En auto hace que los ejes se autoajusten. En manual hace que se queden como están en ese momento. \tn % Row Count 21 (+ 7) % Row 4 \SetRowColor{LightBackground} {\bf{axis tight}} & axis (Ejes, 'tight') & Hace que los valores máximo y mínimo de los ejes se iguales a los de las líneas que contienen \tn % Row Count 27 (+ 6) % Row 5 \SetRowColor{white} {\bf{caxis ({[}min max{]})/auto}} & caxis (Ejes, {[}min max{]}/'auto') & Elige entre qué valores se satura el degradado de color. Auto lo iguala al max y min de las lineas dibujadas \tn % Row Count 34 (+ 7) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{4.5549 cm} x{5.2297 cm} x{7.0854 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Funciones externas (cont)}} \tn % Row 6 \SetRowColor{LightBackground} {\bf{colormap Paleta}} & colormap \seqsplit{(Ejes/figura}, paleta) & Cambia la paleta de colores de la figura o los ejes. En la ayuda se puedenconsultar las posibilidades \tn % Row Count 7 (+ 7) % Row 7 \SetRowColor{white} {\bf{view}} & view (Ejes, {[}a,b{]}) & Posición de la cámara en visualizaciones 3D \tn % Row Count 10 (+ 3) % Row 8 \SetRowColor{LightBackground} {\bf{subplot (m,n,p)}} & subplot (m,n,p,Ejes) & Divide la figura en una matriz de m·n y elige para dibujar la posición p, numerando por filas. \tn % Row Count 16 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{17.67cm}}{Ejes o figura se refiere al handler de un objeto axis o figure respectivamente} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.9292 cm} x{3.6234 cm} x{3.9528 cm} x{2.9646 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{17.67cm}}{\bf\textcolor{white}{Modificadores de línea y punto}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Forma del punto}} & {\bf{Identificado}}r & \{\{bl\}\}{\bf{Línea}} & {\bf{Identificador}} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \{\{fa-circle\}\} Círculo & 'o' & \{\{bl\}\}Línea sólida & - \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \{\{fa-asterisk\}\} Asterisco & '*' & \{\{bl\}\}Línea \seqsplit{discontinua} & — \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} \{\{fa-dot-circle-o\}\} Punto & '.' & \{\{bl\}\}Línea de puntos & : \tn % Row Count 12 (+ 3) % Row 4 \SetRowColor{LightBackground} \{\{fa-plus\}\} Cruz & 'x' & \{\{bl\}\}Conjunto \seqsplit{punto-línea} & -. \tn % Row Count 15 (+ 3) % Row 5 \SetRowColor{white} \{\{fa-square\}\} Cuadrado & 's' o \seqsplit{'square'} & \{\{bl\}\}Sin unión & 'none' \tn % Row Count 18 (+ 3) % Row 6 \SetRowColor{LightBackground} \{\{fa-unsorted\}\} Diamante & 'd' o \seqsplit{'diamond'} & \{\{bt\}\}\{\{bl\}\}{\bf{Color}} & \{\{bt\}\}{\bf{Triada RGB}} \tn % Row Count 21 (+ 3) % Row 7 \SetRowColor{white} \{\{fa-sort-asc\}\} Triángulo hacia arriba & '\textasciicircum{}' & \{\{bl\}\}{\bf{Azul oscuro}} & {[}0.000 0.447 0.741{]} \tn % Row Count 24 (+ 3) % Row 8 \SetRowColor{LightBackground} \{\{fa-caret-down\}\} Triángulo hacia abajo & 'v' & \{\{bl\}\}{\bf{Naranja}} & {[}0.850 0.325 0.098{]} \tn % Row Count 27 (+ 3) % Row 9 \SetRowColor{white} \{\{fa-caret-right\}\} Triángulo hacia la derecha & '\textgreater{}' & \{\{bl\}\}{\bf{Amarillo}} & {[}0.929 0.694 0.125{]} \tn % Row Count 31 (+ 4) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.9292 cm} x{3.6234 cm} x{3.9528 cm} x{2.9646 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{17.67cm}}{\bf\textcolor{white}{Modificadores de línea y punto (cont)}} \tn % Row 10 \SetRowColor{LightBackground} \{\{fa-caret-left\}\} Triángulo hacia la izquierda & '\textless{}' & \{\{bl\}\}{\bf{Morado}} & {[}0.494 0.184 0.556{]} \tn % Row Count 4 (+ 4) % Row 11 \SetRowColor{white} \{\{fa-star\}\} Estrella de 5 puntas (pentagrama) & 'p' o \seqsplit{'pentagram'} & \{\{bl\}\}{\bf{Verde}} & {[}0.466 0.674 0.188{]} \tn % Row Count 8 (+ 4) % Row 12 \SetRowColor{LightBackground} \{\{fa-cog\}\} Estrella de 6 puntas (hexagrama) & 'h' o \seqsplit{'hexagram'} & \{\{bl\}\}{\bf{Azul claro}} & {[}0.301 0.745 0.933{]} \tn % Row Count 12 (+ 4) % Row 13 \SetRowColor{white} ~~~~~Sin marker & 'none' & \{\{bl\}\}{\bf{Granate}} & {[}0.635 0.078 0.184{]} \tn % Row Count 15 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}----} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{4.6116 cm} x{4.2822 cm} x{3.6234 cm} x{3.9528 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{17.67cm}}{\bf\textcolor{white}{Modificadores de color estándar}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Color}} & {\bf{Abreviatura}} & {\bf{Nombre}} & {\bf{Triada RGB}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{Amarillo}} & 'y' & \seqsplit{'yellow'} & {[}1 1 0{]} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{Rojo magenta}} & 'm' & \seqsplit{'magenta'} & {[}1 0 1{]} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{Azul cian}} & 'c' & 'cyan' & {[}0 1 1{]} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{Rojo}} & 'r' & 'red' & {[}1 0 0{]} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} {\bf{Verde}} & 'g' & 'green' & {[}0 1 0{]} \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{Azul}} & 'b' & 'blue' & {[}0 0 1{]} \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} {\bf{Blanco}} & 'w' & 'white' & {[}1 1 1{]} \tn % Row Count 16 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}----} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{17.67cm}}{\bf\textcolor{white}{Plantilla para creación de figuras}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{\{\{literal\}\}LabelFont = 16; \% Fuente para las etiquetas de los ejes \newline LegendFont = 12; \% Fuente para la leyenda \newline TickFont = 16; \% Fuente para los valores de los ejes \newline TitleFont = 16; \% Fuente para el título \newline LineThickness = 1.5; \% Grosor de las lineas \newline Legendario = \{'Identificador 1', 'Identificador 2', 'Identificador 3'\}; \% Nombres que van a aparecer en la leyenda \newline Colores = {[}0 0.447 0.741 \% Colores por defecto pero evitando el amarillo \newline 0.850 0.325 0.098 \newline 0.494 0.184 0.556 \newline 0.466 0.674 0.188 \newline 0.301 0.745 0.933 \newline 0.635 0.078 0.184{]}; \newline \newline Figurica = figure('Name', 'Nombre de la ventana', 'NumberTitle', 'off'); \% Creación de la figura, con nombre y sin número \newline plot(rand(10, 1), 'LineWidth', LineThickness, 'Color', Colores(1,:)); \% Creación de las líneas con el grosor especificado en LineThickness \newline hold on; \% Mantiene en la misma figura todas las líneas a la vez \newline plot(rand(10, 1), 'LineWidth', LineThickness, 'Color', Colores(2,:)); \newline plot(rand(10, 1), 'LineWidth', LineThickness, 'Color', Colores(3,:)); \newline \newline xlim ({[}1, 10{]}); \% Límites para el eje x \newline ylim ({[}0, 1{]}); \% Límites para el eje y \newline grid on; \% Activa las rejillas \newline grid minor; \newline Ejes = gca; \newline Ejes.FontSize = TickFont; \% Fuente de los valores de los ejes con la fuente especificada en TickFont \newline title ('Titulico', 'FontSize', TitleFont); \% Títiulo con la fuente especificada en TitleFont \newline xlabel('Etiqueta eje x', 'FontSize', LabelFont); \% Etiqueta del eje x con la fuente especificada en LabelFont \newline ylabel('Etiqueta eje y', 'FontSize', LabelFont); \% Etiqueta del eje y con la fuente especificada en LabelFont \newline legend(Legendario, 'FontSize', LegendFont); \% Leyenda con los identificadores especificados en Legendario y la fuente especificada en LegendFont} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \end{document}