Here is the code below. plt.figure(figsize=[15,7]) sm.tsa.seasonal_decompose(bitcoin_month.Weighted_Price).plot() print(&quot;Dickey–Fuller test: p=%f&quot; % sm.tsa.stattools.adfuller(bitcoin_month.Weighted_Price)[1]) plt.show()  When I release it I get the following output.  Every time I change the figsize the size does not change. Please assist.
4733
How do you change the size of figure drawn with Matplotlib?
42519
Is it possible to use the TikZ/external library and have pgfplots recreate a figure when a data file that is plotted changes? Say I have something like the following:  file.tex:  \documentclass{article}  \usepackage{tikz,pgfplots} \usetikzlibrary{external} \pgfplotsset{compat=newest} \tikzexternalize \newcommand{\figFilename}{}  \begin{document}   \begin{figure}[t]     \centering     \renewcommand{\figFilename}{thePlot}     \tikzpicturedependsonfile{\figFilename.tikz}     \tikzsetnextfilename{\figFilename}     \input{\figFilename.tikz}     \caption{The caption.}   \end{figure} \end{document}   thePlot.tikz:  \begin{tikzpicture}   \begin{axis}[     xlabel={$x$},     ylabel={$y$},]     \addplot+[only marks,mark=x]       table[x=x,y=y] {data.dat};   \end{axis} \end{tikzpicture}%   data.dat:  x y 0 20.44 1 20.06 2 19.76 3 19.54 4 19.40 5 19.34   If I change thePlot.tikz, the external library will detect that the figure is no longer up-to-date and recreate it. Is it possible to have the same effect when any of the plotted data files changes as well? I tried something along the lines of \tikzpicturedependsonfile{data.dat}, and it doesn't work. That wouldn't be an ideal solution anyway, as most times I use many data files in each plot and listing all dependent files manually would be more pain than gain.  So is there an easy, automated way for the external library to check all data files included in a tikzpicture and recreate the plot if at least one of them has changed?
11159
This is the code that's giving me trouble.   f = Frame(root, width=1000, bg="blue") f.pack(fill=X, expand=True)  l = Label(f, text="hi", width=10, bg="red", fg="white") l.pack()   If I comment out the lines with the Label, the Frame displays with the right width.  However, adding the Label seems to shrink the Frame down to the Label's size.  Is there a way to prevent that from happening?
95748
Consider the following macro:  \newcommand{\sxfigure}[4]{ \includegraphics[width=#1*#3 cm, height=#2*#3 cm]{#4} }   #1 and #2 is some value to determine the width and height of the figure, #3 is to control the zoom ratio. However, the above code doesn't work. Could someone provide a solution? I have tried the following, still not work. Could some point out the mistake?  \usepackage{pgf} \newcommand{\sxmultiply}[2]{\pgfmathparse{#1*#2}\pgfmathresult} \newcommand{\sxfigure}[5]{ \begin{figure} \begin{center} \includegraphics[width=$\sxmultiply{#3}{#5}$ cm, height=$\sxmultiply{#4}{#5}$ cm]{#1} \end{center} \caption{#2} \end{figure} }
101478
For context, when a retailer buys in a clothing item they have to stock it in various sizes. The ratio of stock for each size is referred to as the "size ratio" of the product. E.g. S=0.2, M=0.5, L=0.3 I am looking to build a model that predicts the size curve ratio of sales at the end of the season based on data available at the start of the season e.g. historic sales data, product attributes. The data is structured so that on each line I have a product, product size, and the actual size ratio that sales accounted for in that size. The issue is that the data uses different size methodology depending on the product e.g. jeans might be in numerical sizes, but tops might be in S,M,L etc.  So essentially the model is predicting the size ratio for each line. I was thinking that I could take each product, look at the range of sizes, count them, then align them in the centre?  For example, product 1 has sizes S,M, L and product 2 has sizes 1,2,3,4,5.  I could align the M and 3.  However, I am unsure of how to get this to work.   Questions: How can I standardise the sizes?
103827
I want to illustrate my examples, which are set in a theorem-like environment. Is it possible to wrap the text and equations around the figures? I have read about several packages but I can't get them to work in a theorem. Am I doing something wrong?
123851
I am trying to create a command to modify fontsize with one parameter, it seems that the paramater is not expanding properly:  \newcommand{\mycfs}[1]{\fontsize{#1pt}{1.2*#1pt}}
57111
\begin{figure}     %\centering         \begin{minipage}[h]{0.58\textwidth}         \centering         \includegraphics[scale=0.4,trim=12mm 15mm 12mm 15mm]{fig1}         \end{minipage}         \begin{minipage}[h]{0.38\textwidth}         \centering         \include{fig2}         \end{minipage} \end{figure}   I get the fig1 nicely placed in the center of the left side BUT fig2 'sank' at the bottom of the right side. I dont really know what's wrong with the code. Actually fig2 is a table which i store as a tex file with codes only, something like:  \begin{tabular}{|c|c|}     \hline     aa  &amp; bb  \\ \hline     0 &amp; 10 \\ \hline     1 &amp; 2 \\ \hline \end{tabular}   Hope someone will help me fix this. Thanks in advance.
25985
Good morning,  I have some .txt files that contain 3 columns of data: the first one corresponds to the x-axis value of each point, the second one corresponds to the y-axis value of each point, and the third one corresponds to the value that i want in the color bar (meta index).  When I plot the whole thing, the colorbar does not scale with the data in the third column of my txt files.  Here is my code:  \documentclass[varwidth]{standalone} % *** PACKAGES *** \usepackage{standalone} % Pour les stand-alone \usepackage[usenames,dvipsnames]{xcolor} % 68 dvips colors à déclarer avant tikz \usepackage{tikz} % Pour les figure Tikz \usepackage{pgfplots} % Pour tracer les courbes à partir de fichiers de données \usepackage{pgfplotstable} % Pour pouvoir lire les tableaux des fichiers .txt % *** PACKAGES END *** \pgfplotsset{compat=1.12} % pour définir la version de pgfplots \pgfplotsset{ /pgfplots/colormap={hsv2}{rgb255(0cm)=(0,0,0) rgb255(0.10cm)=(128,0,128) rgb255(0.5cm)=(0,0,230) rgb255(1.cm)=(0,255,255) rgb255(2.5cm)=(0,255,0) rgb255(3.5cm)=(255,255,0) rgb255(6cm)=(255,0,0)} } % Pour définir les couleurs de la colomap \begin{document} \tikzset{mark options={mark size=1.5, line width=0.01pt}} \begin{tikzpicture} \begin{axis}[             clip mode=individual, % Pour plot dans l'ordre             enlargelimits=false,     colorbar,     colorbar style={ylabel=$C_{ligne,si}$},%,ytick={0,0.2,...,1}},     width=0.7\textwidth,             height=0.6\textwidth,     grid=major,     minor x tick num=1,             xlabel={Real($\lambda (A)$)},     minor y tick num=1,             ylabel={Imag($\lambda (A)$)},     tick label style={font=\footnotesize}, ] \foreach \m in {1,2,...,100} {\edef\temp{\noexpand\addplot+[mark=*,only marks,scatter,scatter src=explicit] table[x index=0,y index=1,meta index=2] {./DATA_01/Valeurs_Propres_\m.txt};}\temp} \end{axis} \end{tikzpicture} \end{document}   and here is the end result that I get:   The color bar starts at 10^-6 and goes up to 10^-3; Now I would like the colorbar to scale logarithmically (instead of linearly) so that the "space" between 10^-6 and 10^-5 is the same than between 10^-5 and 10^-4 and between 10^-4 and 10^-3.  I am joining a .zip with my folder containing my .tex files and the .txt files if someone is willing to go this far to help me.   Thank you very much for your help!  VS
50092
How can I get something like in the figure, where G in the middle is larger than normal letters in math mode?
56867
I have a simular issue to the question asked in :  I have tried the solution provided by Jake. This makes that my picture fails to resize (scale) as i intend.  Whether i give Set scale=0.4 or Set scale=0.8 The size of the  picture remains the same  This is the code i use:  \begin{figure}[ht!] \centering \begin{tikzpicture}[Set scale=0.4, every node/.append style={transform shape},] % STYLES \tikzstyle{every node}=[rectangle,rounded corners, minimum width=100pt,     align=center,node distance=3cm,fill=black!10,inner sep=5pt,text width=3cm,minimum height=1.75cm,&gt;=stealth,text badly centered] % Draw forces \node [force, above of=rivalry] (top) {Firm strategy, structure and rivalry}; \node [force, left=1cm of rivalry] (left) {Factor conditions}; \node [force, right=1cm of rivalry] (right) {Demand Conditions}; \node [force, below of=rivalry] (bottom) {Related and Supporting industries}; %%%%%%%%%%%%%%%% % Draw the links between forces \path[&lt;-&gt;,thick]  (left) edge (right) (left) edge (top) (left) edge (bottom) (top) edge (right) (bottom) edge (right); \path[&lt;-&gt;,thick]  (bottom) edge (top); \end{tikzpicture} \caption{Porter's Diamond source:~\cite{Porter:1980}}% \label{fig:diamond}  \end{figure}
22759
I once already asked a very similar question; . But this is some what different.  I have the following code;  \documentclass{standalone} \usepackage{graphics} \usepackage{tikz,pgfplots} \pgfplotsset{compat=1.6} \begin{document} \begin{tikzpicture}  \begin{axis}[% width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.0004, ymax=0.0012, ylabel={$\phi_{\mathrm{i}}(t)$}, ymajorgrids, yminorgrids, name=plot1]  \end{axis}  \begin{axis}[% width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.2, ymax=1.2, ylabel={$h(t)$}, ymajorgrids, yminorgrids, name=plot2, at=(plot1.right of north east), anchor=left of north west]  \end{axis}  \begin{axis}[% width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.0004, ymax=0.0012, ylabel={$\phi_{\mathrm{o}}(t)$}, ymajorgrids, yminorgrids, name=plot4, at=(plot1.below south west), anchor=above north west]  \end{axis}  \begin{axis}[% width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=2000, ymax=12000, ylabel={$p_{\mathrm{i}}(t)$}, ymajorgrids, yminorgrids, name=plot5, at=(plot4.right of north east), anchor=left of north west]  \end{axis}  \end{tikzpicture} \end{document}   This creates the following plot:    I think there is to few vertical/horizontal spacing between the plots. I want to increase this. Currently I use x- yshift, this gives the following result:  \documentclass{standalone} \usepackage{graphics} \usepackage{tikz,pgfplots} \pgfplotsset{compat=1.6} \begin{document} \begin{tikzpicture}  \begin{axis}[% width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.0004, ymax=0.0012, ylabel={$\phi_{\mathrm{i}}(t)$}, ymajorgrids, yminorgrids, name=plot1]  \end{axis}  \begin{axis}[% xshift=1cm, width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.2, ymax=1.2, ylabel={$h(t)$}, ymajorgrids, yminorgrids, name=plot2, at=(plot1.right of north east), anchor=left of north west]  \end{axis}  \begin{axis}[% yshift=-1cm, width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.0004, ymax=0.0012, ylabel={$\phi_{\mathrm{o}}(t)$}, ymajorgrids, yminorgrids, name=plot4, at=(plot1.below south west), anchor=above north west]  \end{axis}  \begin{axis}[% xshift=1cm, width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=2000, ymax=12000, ylabel={$p_{\mathrm{i}}(t)$}, ymajorgrids, yminorgrids, name=plot5, at=(plot4.right of north east), anchor=left of north west]  \end{axis}  \end{tikzpicture} \end{document}     I want to know if there is a more consistent manner to do this.
41478
For example, when I use the command (in Overleaf/ShareLaTex):  \begin{figure}[H]     \centering     \includegraphics{some_graphic}     \caption{some_caption}     \label{fig:some_label} \end{figure}   the \includegraphics{} comes without the [] parameter to change the size of the image, and \begin{figure} without the [H] option by default.   Is it possible to renew the command to make it default? By that I mean that when I type the \begin{figure} command it adds the [H] and [h] as well as [width=\textwidth] in the \includegraphics command, rather than making a global change in the preamble e.g.
61145
I am trying to customize the legend for this graph. First of all, I would like the legend width to be equal to the x-axis width. At the moment, I am setting the width of the legend via      /tikz/every even column/.append style={column sep=1.0cm}   and I could manually adjust this value so that length equals the x-axis width, but I guess that there is a more elegant way to set the width of the legend.  Second, I don't really like the little color rectangles in the legend. I only want one rectangle in front of every entry and not two. This rectangle does not need to have a border and should be vertically centred with the text. The alignment seems to be okay for the rectangle closer to the text, but not for one the far left.   Update: Thanks to Christian Feuersänger's comment, there is possibility to change the rectangles via   legend image code/.code={%     \draw[#1, draw=none] (0cm,-0.1cm) rectangle (0.6cm,0.1cm);   or what Gonzalo Medina proposed  legend image code/.code={%     \draw[#1, draw=none, /tikz/.cd, bar width=3pt, yshift=-0.2em, bar shift=0pt] %     plot coordinates {(2*\pgfplotbarwidth,0.6em)};   Third, I would like to the legend entries to start next to the text "Legend:".  I don't really know if with these requirements it still makes sense to use legend or if it would be better to add everything manually via after end axis/.code and \ref{label}.  Graph    MWE  \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest}  \begin{document} \begin{tikzpicture}     \begin{axis}[                 ybar,                 height=6cm,                 title={Some plot},                 width=12cm,                 axis on top,                 y axis line style={opacity=0},                 axis x line*=bottom,                 tick align=inside,                 tick style={draw=none},                 xtick=data,                 ymajorgrids,                 major grid style={draw=white},                 xtick={1,2,3,4},                 legend style={                     at={(0.0,-0.15)},                     anchor=north west,                     legend columns=-1,                     /tikz/every even column/.append style={column sep=1.0cm}                         },             ]                    \addlegendimage{empty legend}             \addlegendentry{\textbf{Legend:}}                                \addplot coordinates {                 (1, 0.2064)                 (2, 0.3961)                 (3, 0.5961)                 (4, 0.7961)}; \addlegendentry[text width=45pt, text depth=]{legend a}             \addplot coordinates {                 (1, 0.3064)                 (2, 0.4961)                 (3, 0.6961)                 (4, 0.8961)}; \addlegendentry[text width=65pt, text depth=]{lengend b}     \end{axis}  \end{tikzpicture} \end{document}
66669
You can have data in wide format or in long format. This is quite an important thing, as the useable methods are different, depending on the format. I know you have to work with melt() and cast() from the reshape package, but there seems some things that I don't get.  Can someone give me a short overview how you do this?
122806
I am trying to plot the function 1/x^2 but the result is obviously wrong, here is how it looks like    here is the code  \begin{center}      \begin{tikzpicture}      \begin{axis}[      %xlabel=$x$,     %ylabel={$f(x) = x^2 - x +4$}   ]      \addplot[blue] {1/(x^2)};     \end{axis}     \end{tikzpicture} \end{center}   Any suggestions on how to fix this?
65867
I am new to data science. I use Anaconda on windows 7. I plotted a sine curve by doing the following on iPython:  import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 10, 1000) y = np.sin(x) plt.plot(x, y)   And I got this:  But when I got ready to name the axes, the curve disappeared. I wrote this code:  plt.xlabel("Time")   And I got this:  I also wrote this:  plt.ylabel("Speed")   And got this:   So my question is, how can I plot a curve with labelled axes? (In other words, I will like the x-axis to be Time, the y-axis to be Speed and the curve intact)