pgfplots-features Mailing List for pgfplots (Page 5)
Brought to you by:
cfeuersaenger,
ludewich
This list is closed, nobody may subscribe to it.
2009 |
Jan
|
Feb
|
Mar
(20) |
Apr
(5) |
May
(7) |
Jun
(15) |
Jul
(15) |
Aug
(17) |
Sep
(22) |
Oct
(3) |
Nov
(8) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(22) |
Feb
(19) |
Mar
(14) |
Apr
(24) |
May
(18) |
Jun
(23) |
Jul
(18) |
Aug
(10) |
Sep
(33) |
Oct
(11) |
Nov
(12) |
Dec
|
2011 |
Jan
(16) |
Feb
(9) |
Mar
(10) |
Apr
(17) |
May
(2) |
Jun
(11) |
Jul
(29) |
Aug
(12) |
Sep
(20) |
Oct
(9) |
Nov
(8) |
Dec
(17) |
2012 |
Jan
(17) |
Feb
(6) |
Mar
(9) |
Apr
(8) |
May
(1) |
Jun
(3) |
Jul
(4) |
Aug
(15) |
Sep
(7) |
Oct
(9) |
Nov
(25) |
Dec
(2) |
2013 |
Jan
(7) |
Feb
|
Mar
(4) |
Apr
(1) |
May
(3) |
Jun
(15) |
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(2) |
2014 |
Jan
(4) |
Feb
(1) |
Mar
(17) |
Apr
(6) |
May
|
Jun
(2) |
Jul
(6) |
Aug
(3) |
Sep
(3) |
Oct
(4) |
Nov
(4) |
Dec
(4) |
2015 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(1) |
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(3) |
Nov
|
Dec
(1) |
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
(1) |
Dec
|
2019 |
Jan
(4) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Kasra F. <kas...@gm...> - 2013-07-03 20:39:01
|
Hi All, I'm using \tikzexternalize option of pgfplots and I have \addplot gnuplot in my code which generates a table and I use the table command for showing the errorbars of the plot, however, I explicitly provide the name of the table file created by gnuplot. But with \tikzexternalize the figure# is also appended to the name of the generated table file so how can I input that into the name of the table file I provide? because if the figure number is changed I have to go and manually change that name but there should be a way that pgfplots take care of it, is there any trick to that? the table file name is : jobname.pgf-plots.figure1.table How can I replace figure1 part which can adapt itself if I add a figure before that and it becomes figure2? right now I have to go into the code and change it to figure2 manually. I appreciate any help. Cheers, Kasra. |
From: Christian F. <cfe...@go...> - 2013-06-28 07:45:40
|
Hi Kasra, I debugged into the problem and found that \tikzexternalcheckshellescape does NOT expand to '-shell-escape'. It smells like a bug in the external library... I will take care of it. The purpose of the \tikzexternalcheckshellescape macro was to expand to the shell-escape argument if and only if it was present on the command line. To this end, it relies on some pdftex macro - which appears to be undefined for lualatex. The immediate solution would be to use '-shell-escape' instead of '\tikzexternalcheckshellescape', i.e. \tikzset{external/system call={lualatex -shell-escape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}} In that case, the argument 'external/shell escape' is ignored (it is only used by \tikzexternalcheckshellescape). Kind regards Christian Am 28.06.2013 07:28, schrieb Kasra Fattah: > Hi All, > > I'm using gnuplot in my pgfplots and I want to use \tikzexternalize. I > have attached a simple code to describe the problem. When I use > pdflatex with -shell-escape everything goes smooth. But when I'm using > lualatex either it complains about not having "1.pgf-plot.table" > available even the "1.pgf-plot.gnuplot" has been generated or it makes > a .table which has a problem and it cannot use it, however if after > the error I manually run "gnuplot 1.pgf-plot.gnuplot" to generate the > "1.pgf-plot.table" and then recompile with lualatex -shell-escape, it > will go through and work fine. Do you know how I can resolve this > issue with lualatex? I appreciate any help. > > Cheers, > Kasra. > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > > > _______________________________________________ > Pgfplots-features mailing list > Pgf...@li... > https://lists.sourceforge.net/lists/listinfo/pgfplots-features |
From: Kasra F. <kas...@gm...> - 2013-06-28 06:21:01
|
Hi All, "The body of my previous email was not showing so I resent it again. Sorry about that." I'm using gnuplot in my pgfplots and I want to use \tikzexternalize. When I use pdflatex with -shell-escape everything goes smooth. But when I'm using lualatex either it complains about not having "1.pgf-plot.table" available even the "1.pgf-plot.gnuplot" has been generated or it makes a .table which has a problem and it cannot use it, however if after the error I manually run "gnuplot 1.pgf-plot.gnuplot" to generate the "1.pgf-plot.table" and then recompile with lualatex -shell-escape, it will go through and work fine. Do you know how I can resolve this issue with lualatex? I appreciate any help. Cheers, Kasra. %%-------------------------tex code------------------------------- \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{external} \tikzexternalize \begin{document} \begin{tikzpicture} \begin{axis} \addplot gnuplot{x}; \end{axis} \end{tikzpicture} \end{document} %%-----------------------error from log----------------------------- ....... ....... (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv e )) ===== 'mode=convert with system call': Invoking 'pdflatex -halt-on-error -inter action=batchmode -jobname "5-figure0" "\def\tikzexternalrealjob{5}\input{5}"' = ======= runsystem(pdflatex -halt-on-error -interaction=batchmode -jobname "5-figure0" " \def\tikzexternalrealjob{5}\input{5}")...executed. ! Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error -interact ion=batchmode -jobname "5-figure0" "\def\tikzexternalrealjob{5}\input{5}"' did NOT result in a usable output file '5-figure0' (expected one of .pdf:.jpg:.jpeg :.png:). Please verify that you have enabled system calls. For pdflatex, this i s 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in ' 5-figure0.log'. If you continue now, I'll try to typeset the picture. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.17 \end{tikzpicture} ? ! Interruption. \GenericError ... \endgroup l.17 \end{tikzpicture} ? runsystem(gnuplot 5.pgf-plot.gnuplot)...executed. PGFPlots: reading {5.pgf-plot.table} LaTeX Font Info: External font `cmex10' loaded for size (Font) <7> on input line 1. LaTeX Font Info: External font `cmex10' loaded for size (Font) <5> on input line 1. [1 {/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./5.aux) |
From: Christian F. <cfe...@go...> - 2013-06-26 16:48:45
|
Hi Elke, you should probably post this request on the PGF mailing list. Kind regards Christian Am 24.06.2013 19:41, schrieb Elke Faßhauer: > Dear all, > > I am struggeling to place an object (a red circle) using polar > coordinates with respect to a chosen center called ground. > > Any ideas? > > Here is the snipped: > > \documentclass[]{beamer} > \usepackage[T1]{fontenc} > \usepackage[english,german]{babel} > \usepackage{xcolor} > \usepackage{graphicx} > > \usepackage{tikz,pgfplots} > \usetikzlibrary{positioning,fadings,patterns} > > \usepackage{tikz,pgfplots} > \usetikzlibrary{positioning,fadings,patterns} > > \tikzfading[name=fade inside, > inner color=transparent!80, > outer color=transparent!30] > > > \begin{document} > \begin{tikzpicture}[scale=0.5] > \draw [help lines] (0,0) grid (23,5); > \coordinate(ground) at (2,2) {}; > \draw [very thick] (ground) circle (1.2); > \shade [ball color=white,path fading=fade inside] (ground) > circle (1.5); > \coordinate (ov1) at (0:1.5) {}; > \shade [ball color=red] (ov1) circle (0.2); > \end{tikzpicture} > \end{document} > > I have tried to place several +s in front of the polar coordinates, but > this does not show any effect. > > Thank you in advance. > > Elke > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Pgfplots-features mailing list > Pgf...@li... > https://lists.sourceforge.net/lists/listinfo/pgfplots-features |
From: Elke F. <elk...@pc...> - 2013-06-24 18:22:38
|
Dear all, I am struggeling to place an object (a red circle) using polar coordinates with respect to a chosen center called ground. Any ideas? Here is the snipped: \documentclass[]{beamer} \usepackage[T1]{fontenc} \usepackage[english,german]{babel} \usepackage{xcolor} \usepackage{graphicx} \usepackage{tikz,pgfplots} \usetikzlibrary{positioning,fadings,patterns} \usepackage{tikz,pgfplots} \usetikzlibrary{positioning,fadings,patterns} \tikzfading[name=fade inside, inner color=transparent!80, outer color=transparent!30] \begin{document} \begin{tikzpicture}[scale=0.5] \draw [help lines] (0,0) grid (23,5); \coordinate(ground) at (2,2) {}; \draw [very thick] (ground) circle (1.2); \shade [ball color=white,path fading=fade inside] (ground) circle (1.5); \coordinate (ov1) at (0:1.5) {}; \shade [ball color=red] (ov1) circle (0.2); \end{tikzpicture} \end{document} I have tried to place several +s in front of the polar coordinates, but this does not show any effect. Thank you in advance. Elke |
From: Olivier V. <oli...@gm...> - 2013-06-14 17:42:58
|
Hi! I just released an improved interface of pgfplots for Python (loosely based on the one in the pgfplots project). The code is on github: https://github.com/olivierverdier/pygfplots Best == Olivier Verdier |
From: Christian F. <cfe...@go...> - 2013-06-13 21:01:15
|
Hi Oliver, given just that fragment, I can only assume that something concerning the etex package is different in your installation. More precisely, there is a switch in pgfkeys.code.tex which defines \pgfkeysifdefined in a different way depending on whether etex is available or not. From what I know, it typically *is* available. Perhaps it is not for your version. I am referring to the instruction \def\pgfkeys@ifcsname#1\endcsname#2\else#3\fi{\expandafter\ifx\csname#1\endcsname\relax#3\else#2\fi}% \ifx\eTeXrevision\undefined% \else% \expandafter\let\expandafter\pgfkeys@ifcsname\csname ifcsname\endcsname% \fi In other words: you could write \makeatletter \show\pgfkeys@ifcsname and/or \ifx\eTeXrevision\undefined \message{ETEX UNDEFINED} \else \message{ETEX DEFINED} \fi to see if something is different (this is purely diagnostic). Perhaps you can make a difference by adding \usepackage{etex} ? Kind regards Christian Am 12.06.2013 10:21, schrieb Oliver Urbann: > Hi all, > > I'm trying to port texlive to a rare OS called MorphOS. At the moment > most important things are working. I can compile all for me important > documents. But I have a problem with pgfplots. When I try to compile the > example using "pdftex --progname=pdflatex pgfplotsexample.tex" I get the > following error: > > ! Extra \else. > \pgfkeysifdefined ...me pgfk@#1\endcsname #2\else > #3\fi > l.13 ^^I^^I\addplot > coordinates { > ? > ! Emergency stop. > > I would not say it is a bug in pgfplots. But maybe some one knows what > is wrong with my tex setup? > > Best regards, > Oliver > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Pgfplots-features mailing list > Pgf...@li... > https://lists.sourceforge.net/lists/listinfo/pgfplots-features |
From: Oliver U. <oli...@tu...> - 2013-06-12 08:21:11
|
Hi all, I'm trying to port texlive to a rare OS called MorphOS. At the moment most important things are working. I can compile all for me important documents. But I have a problem with pgfplots. When I try to compile the example using "pdftex --progname=pdflatex pgfplotsexample.tex" I get the following error: ! Extra \else. \pgfkeysifdefined ...me pgfk@#1\endcsname #2\else #3\fi l.13 ^^I^^I\addplot coordinates { ? ! Emergency stop. I would not say it is a bug in pgfplots. But maybe some one knows what is wrong with my tex setup? Best regards, Oliver |
From: Denis B. <dbi...@wa...> - 2013-06-10 18:59:54
|
Le lundi 10/06/13 à 20h44, Christian Feuersaenger <cfe...@go...> a écrit : > Hi Denis, Hi Christian, > there is a different solution which might work. I prepared it as > low-level backend in order to implement a "nice, understandable > interface in pgfplots"... however, it never made it that far and it > is far from "nice, understandable". Too bad... I will wait as long as it takes! ;) > It is a set of two hooks which is installed at the beginning and end > of every bar. Combined with a bit of fine tuning, you get what you > wanted... Indeed, it works like a charm. > Here is the code: > > [...] > > You see that I did something slightly more complicated: I shaded the > bars depending on the 'mapped color'. The 'shaded bars' style relies > on the two (currently undocumented) keys 'at begin bar' and 'at end > bar'. The two macros inside of it are mandatory; they take the "raw" > point meta; map them into the min/max range and define the 'mapped > color'. The rest is basically your example. Okay. > I always wanted to improve the bar plot handler systematically - once > I find time to do it; this kind of functionality will also receive > attention. That's a very good news: thanks a lot! Kind regards. -- Denis |
From: Christian F. <cfe...@go...> - 2013-06-10 18:58:12
|
Hi Mike, thanks for your interest in pgfplots! I am glad it proves to be useful. Concerning your request to typeset ticks without math mode: you almost had it except that \pgfmathprintnumber beats you a bit. You are right; it really starts math mode implicitly. There are two potential cures: the first is to write \pgfmathprintnumber[assume math mode,verbatim]{\tick}% and the second is to use \pgfmathprintnumberto instead of \pgfmathprintnumber, i.e. something like yticklabel={ \pgfmathprintnumberto[verbatim]{\tick}\TEMP % \TEMP = % \romannumeral \TEMP% }, In the first solution, the 'assume math mode' key tells pgfmath that it should not ensure math mode on its own; it silently assumes that you know what you are doing. The second solution does not typeout the numbers: it stores the result into the argument which comes after the number (in our case, it is \TEMP). We can use this value in many ways; the simplest is to typeset it (by writing \TEMP). A more complicated way is to prefix it by \romannumeral (which is a bit strange, I admit it ;-) ). This should allow your use-case. Kind regards Christian PS I took the freedom to post a copy of this reply on the pgfplots mailing list in order to help others with similar problems. I hope you do not mind. Am 10.06.2013 17:37, schrieb Michael Grant: > Dear Sir, > > I have been a long time user of your excellent packages pgfplots and > pgfplotstable. I am deeply grateful for the seamless integration of > numerical data to visual graphs your packages provide. > > I have recently had to use XeLaTeX to produce a document in a style > conformant to a "corporate standard". And notice that the ticks of a > pgfplot are formatted in math mode. > > I have solved the problem by > using: yticklabel={\pgfmathprintnumber[verbatim]{\tick}} and was > wondering if, on detection of an XeTex compiler the > \axisdefaultticklabel macro could be changed to > > \def\axisdefaultticklabel{\pgfmathprintnumber[verbatim]{\tick}}. > > Apropos, I see that even removing the math mode $'s still has > \pgfmathprintnumber producing text in math mode. > > Respectfully, > > Mike. > This communication is intended for the addressee only. It is > confidential. If you have received this communication in error, please > notify us immediately and destroy the original message. You may not > copy or disseminate this communication without the permission of the > University. Only authorised signatories are competent to enter into > agreements on behalf of the University and recipients are thus advised > that the content of this message may not be legally binding on the > University and may contain the personal views and opinions of the > author, which are not necessarily the views and opinions of The > University of the Witwatersrand, Johannesburg. All agreements between > the University and outsiders are subject to South African Law unless > the University agrees in writing to the contrary. > > > > > |
From: Christian F. <cfe...@go...> - 2013-06-10 18:46:09
|
Hi Jake, this is a really cool approach! Kind regards Christian Am 06.06.2013 14:10, schrieb Juernjakob Dugge: > You could adapt the approach from > http://tex.stackexchange.com/questions/116765/particular-bar-plot-with-pgfplots-bar-color-category/116773#116773 > for this, which uses the `scatter/@pre marker code` to draw "fake" bars: > > \documentclass{article} > \usepackage{pgfplots} > \pgfplotsset{compat=1.8} > \begin{document} > \begin{tikzpicture} > \begin{axis}[ymin=0] > \addplot+[ > scatter, > only marks, > colormap={test}{ > color=(blue!10); color=(blue!20); color=(blue!30); > color=(blue!40); color=(blue!50); color=(blue!60); color=(blue!70) }, > scatter/use mapped color={draw=blue,fill=mapped color}, > scatter/@pre marker code/.append code={ > \pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed} > \pgfmathsetmacro\negheight{-\pgfplotspointmeta} > \fill [draw=black] (-1ex,0) rectangle ([xshift=1ex]axis > direction cs:0,\negheight); > \pgfplotsset{mark=none} > }, > ] > plot coordinates { > (1,1565) > (2,1164) > (3,740) > (4,2273) > (5,1688) > (6,2942) > }; > \end{axis} > \end{tikzpicture} > \end{document} > > On 06/06/2013 04:23 AM, Denis Bitouzé wrote: >> Hello, >> >> is there a way to get scatter (y)bar plots, I mean the bars filled >> with a colour depending on the y values? >> >> The following MCE doesn't give the expected result: >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> \documentclass{article} >> \usepackage{pgfplots} >> \pgfplotsset{compat=1.8} >> \begin{document} >> \begin{tikzpicture} >> \begin{axis}[ybar] >> \addplot+[ >> colormap={test}{ >> color=(blue!10); color=(blue!20); color=(blue!30); >> color=(blue!40); color=(blue!50); color=(blue!60); color=(blue!70) }, >> scatter/use mapped color={draw=blue,fill=mapped color} >> ] >> plot coordinates { >> (1,1565) >> (2,1164) >> (3,740) >> (4,2273) >> (5,1688) >> (6,2942) >> }; >> \end{axis} >> \end{tikzpicture} >> \end{document} >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> Thanks. > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Pgfplots-features mailing list > Pgf...@li... > https://lists.sourceforge.net/lists/listinfo/pgfplots-features |
From: Christian F. <cfe...@go...> - 2013-06-10 18:44:32
|
Hi Denis, there is a different solution which might work. I prepared it as low-level backend in order to implement a "nice, understandable interface in pgfplots"... however, it never made it that far and it is far from "nice, understandable". It is a set of two hooks which is installed at the beginning and end of every bar. Combined with a bit of fine tuning, you get what you wanted... Here is the code: \documentclass{report} \usepackage{pgfplots} \pgfplotsset{compat=1.6} \pgfplotsset{ shaded bars/.style={ point meta=y, at begin bar={% \pgfplotsaxisvisphasetransformpointmeta \pgfplotscolormapdefinemappedcolor{\pgfplotspointmetatransformed}% \begin{scope}[left color=black,right color=mapped color]% \shade\pgfextra }, at end bar={% \endpgfextra; \end{scope}% }, }, } \begin{document} \thispagestyle{empty} \begin{tikzpicture} \begin{axis}[ybar] \addplot+[ shaded bars, colormap={test}{ color=(blue!10); color=(blue!20); color=(blue!30); color=(blue!40); color=(blue!50); color=(blue!60); color=(blue!70) }, ] plot coordinates { (1,1565) (2,1164) (3,740) (4,2273) (5,1688) (6,2942) }; \end{axis} \end{tikzpicture} \end{document} Attached is the result. You see that I did something slightly more complicated: I shaded the bars depending on the 'mapped color'. The 'shaded bars' style relies on the two (currently undocumented) keys 'at begin bar' and 'at end bar'. The two macros inside of it are mandatory; they take the "raw" point meta; map them into the min/max range and define the 'mapped color'. The rest is basically your example. I always wanted to improve the bar plot handler systematically - once I find time to do it; this kind of functionality will also receive attention. Kind regards Christian Am 06.06.2013 10:23, schrieb Denis Bitouzé: > Hello, > > is there a way to get scatter (y)bar plots, I mean the bars filled > with a colour depending on the y values? > > The following MCE doesn't give the expected result: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > \documentclass{article} > \usepackage{pgfplots} > \pgfplotsset{compat=1.8} > \begin{document} > \begin{tikzpicture} > \begin{axis}[ybar] > \addplot+[ > colormap={test}{ > color=(blue!10); color=(blue!20); color=(blue!30); > color=(blue!40); color=(blue!50); color=(blue!60); color=(blue!70) }, > scatter/use mapped color={draw=blue,fill=mapped color} > ] > plot coordinates { > (1,1565) > (2,1164) > (3,740) > (4,2273) > (5,1688) > (6,2942) > }; > \end{axis} > \end{tikzpicture} > \end{document} > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > Thanks. |
From: Denis B. <dbi...@wa...> - 2013-06-06 12:31:10
|
Le jeudi 06/06/13 à 08h10, Juernjakob Dugge <jue...@gm...> a écrit : > You could adapt the approach from > http://tex.stackexchange.com/questions/116765/particular-bar-plot-with-pgfplots-bar-color-category/116773#116773 > for this, which uses the `scatter/@pre marker code` to draw "fake" > bars: Wow! It is works like a charm and I would have been unable to find this solution by myself! Many thanks... Maybe such a feature could be implemented with a nice and understandable interface in pgfplots? :) Thanks again! -- Denis |
From: Juernjakob D. <jue...@gm...> - 2013-06-06 12:11:11
|
You could adapt the approach from http://tex.stackexchange.com/questions/116765/particular-bar-plot-with-pgfplots-bar-color-category/116773#116773 for this, which uses the `scatter/@pre marker code` to draw "fake" bars: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} \begin{tikzpicture} \begin{axis}[ymin=0] \addplot+[ scatter, only marks, colormap={test}{ color=(blue!10); color=(blue!20); color=(blue!30); color=(blue!40); color=(blue!50); color=(blue!60); color=(blue!70) }, scatter/use mapped color={draw=blue,fill=mapped color}, scatter/@pre marker code/.append code={ \pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed} \pgfmathsetmacro\negheight{-\pgfplotspointmeta} \fill [draw=black] (-1ex,0) rectangle ([xshift=1ex]axis direction cs:0,\negheight); \pgfplotsset{mark=none} }, ] plot coordinates { (1,1565) (2,1164) (3,740) (4,2273) (5,1688) (6,2942) }; \end{axis} \end{tikzpicture} \end{document} On 06/06/2013 04:23 AM, Denis Bitouzé wrote: > Hello, > > is there a way to get scatter (y)bar plots, I mean the bars filled > with a colour depending on the y values? > > The following MCE doesn't give the expected result: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > \documentclass{article} > \usepackage{pgfplots} > \pgfplotsset{compat=1.8} > \begin{document} > \begin{tikzpicture} > \begin{axis}[ybar] > \addplot+[ > colormap={test}{ > color=(blue!10); color=(blue!20); color=(blue!30); > color=(blue!40); color=(blue!50); color=(blue!60); color=(blue!70) }, > scatter/use mapped color={draw=blue,fill=mapped color} > ] > plot coordinates { > (1,1565) > (2,1164) > (3,740) > (4,2273) > (5,1688) > (6,2942) > }; > \end{axis} > \end{tikzpicture} > \end{document} > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > Thanks. |
From: Denis B. <dbi...@wa...> - 2013-06-06 08:23:58
|
Hello, is there a way to get scatter (y)bar plots, I mean the bars filled with a colour depending on the y values? The following MCE doesn't give the expected result: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} \begin{tikzpicture} \begin{axis}[ybar] \addplot+[ colormap={test}{ color=(blue!10); color=(blue!20); color=(blue!30); color=(blue!40); color=(blue!50); color=(blue!60); color=(blue!70) }, scatter/use mapped color={draw=blue,fill=mapped color} ] plot coordinates { (1,1565) (2,1164) (3,740) (4,2273) (5,1688) (6,2942) }; \end{axis} \end{tikzpicture} \end{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Thanks. -- Denis |
From: Neal H. W. <ne...@wa...> - 2013-05-30 12:25:38
|
Hi, Christian, At Thu, 30 May 2013 12:40:35 +0200, Christian Feuersaenger wrote: > How important is that fix for you? Do you report it for reasons of > anoyance and of completeness (probably both true) or do you really need > a log plot with such a small data range? It's not a problem for me. I stumbled upon the bug due to a bug of my own and reported the issue that I observed. Thanks, Neal |
From: Christian F. <cfe...@go...> - 2013-05-30 10:40:44
|
Hi Neal, this is a bug, indeed... it happens because the displayed data range becomes too small. After application of logs, you find the data range log( [1000,1001]) = [ 6.90775527898214 , 6.90875477931522] for linear axes, pgfplots applies some rescaling and shifting to reduce the problem. For log axes, it keeps the logs as-is which beats you here. A work-around would be to type "xmax=1090" (i.e. to enlarge the displayed limit manually). How important is that fix for you? Do you report it for reasons of anoyance and of completeness (probably both true) or do you really need a log plot with such a small data range? Kind regards Christian Am 27.05.2013 14:31, schrieb Neal H. Walfield: > Consider the following plot: > > \documentclass{article} > > \usepackage{pgfplots} > \pgfplotsset{compat=1.8} > > \begin{document} > \def\x{1001} > \begin{tikzpicture} > \begin{semilogxaxis} > \addplot coordinates { > (1000, 0) > (\x, 1) > }; > \end{semilogxaxis} > \end{tikzpicture} > \end{document} > > Compiling this, I get: > > ! Dimension too large. > <recently read> \pgf@xx > > l.14 \end{semilogxaxis} > > This happens for values of \x up to 1075. > > I think this is a bug. I tested against 1.8. > > Thanks, > > Neal > > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may > _______________________________________________ > Pgfplots-features mailing list > Pgf...@li... > https://lists.sourceforge.net/lists/listinfo/pgfplots-features |
From: Neal H. W. <ne...@wa...> - 2013-05-27 13:09:28
|
Consider the following plot: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} \def\x{1001} \begin{tikzpicture} \begin{semilogxaxis} \addplot coordinates { (1000, 0) (\x, 1) }; \end{semilogxaxis} \end{tikzpicture} \end{document} Compiling this, I get: ! Dimension too large. <recently read> \pgf@xx l.14 \end{semilogxaxis} This happens for values of \x up to 1075. I think this is a bug. I tested against 1.8. Thanks, Neal |
From: Christian F. <cfe...@go...> - 2013-04-04 17:39:37
|
Hello users of pgfplots, I am glad to announce the release of version 1.8! Note that the version on CTAN is version 1.8, even if it still displays version number 1.7 (probably some missing database update on CTAN). Attaches you find the release notes for version 1.8. Kind regards Christian 1.8: - new feature: tight bounding box even if the axis is no box and bb excludes clip path - new feature: mesh/color input=explicit - new feature: shader=interp now has drivers for both dvipdfmx and xetex - new feature: support for more color spaces in colormap definitions - new feature: shader=interp and device-level gray colorspaces - new feature: 'contour/contour dir=[xyz]' to draw contours in different directions - new feature: statistics library with boxplot handler (both boxplot prepared and automatic computation) - fixed bug: 3d centered axis lines and label placement (requires compat=1.8 or higher) - fixed bug: axis lines and placement of labels, tick scale labels, and reversed axes (requires compat=1.8 or higher) - fixed bug: filtering out coords from a mesh plot failed - fixed bug: every legend image post was not respected inside of \ref{plotlabel} - fixed bug: high-order patches computed the shader=flat mean in a wrong way. - fixed bug: remember picture inside of pgfplots axes failed (due to cell picture) - fixed bug: now, the tick scale label will be omitted if there are no ticks - fixed bug: axis box path was not closed - fixed bug: the bounding box was non-empty even if the axis was hidden. - fixed bug: auto-alignment of nodes near coords failed for xbar plots - fixed bug: providing bar width / bar shift in terms of axis units did not work with [xy]bar and nodes near coords - fixed bug: transformation 'data cs=cart' -> polar is more robust now - fixed bug: code did not compile against pgf 2.00 - fixed bug: patch plot lib and shader=interp,patch type=biquadratic - fixed bug: context path searching issue (pgfplots.lua) - fixed bug: shader=interp and dvips driver - fixed bug: error bars with explicit relative input failed 1.7 - added feature: 'bar shift' and 'bar width' can now be expressed in terms of axis units (compat=1.7 or higher) - fixed incompatibility regression pgfplots 1.6.1 pgf 2.10: layers - fixed incompatibility pgfplots and imakeidx - added feature: 'enlargelimits={abs=1cm}', i.e. enlarge by dimension rather than unit - patchplots lib: added patch type=bicubic - patchplots lib: added support for global paths (fillable) - patchplots lib: added patch type sampling feature - patchplots lib: improved usability (documentation and improvements) - fixed path issues in context: moved lua input file to tex/generic - fixed bug: \ref{legendimage} inside of legend text was wrong. 1.6.1: - fixed incompatibility lualatex,shader=interp, and german package (introduced in 1.6) 1.6: - added support for layered graphics (main use case: multiple axes and layers) - added support for second colormap in mesh plots (mesh/interior colormap name) - added support for scopes inside of axes - contour plots: added ability to provide list of discrete labels (mesh/levels) - empty lines are interpreted as interruptions in data plots (was undocumented since 1.4) - added more scaling options to 'scale mode=scale uniformly' (affects axis equal in 3d and \addplot3 graphics) - fixed wrong implementation of 'axis equal' and 'unit vector ratio' in 3d (backwards compatible for 2d, but not for 3d - the 3d implementation was plain wrong) - fixed incompatibility of lualatex and shader=interp - fixed bugs/added features around \addplot3 graphics - fixed bug: colorbar did not support ymode=log - fixed a couple of minor bugs - fixed bounding box computation for clip=false,axis lines=none |
From: Christian F. <cfe...@go...> - 2013-03-29 16:17:58
|
Hi Mike, Your observation is correct: colorbar sampled simply changes the way the colorbar is displayed; it does not control the way colors are mapped into the colormap. This is actually unsupported and would need to become a feature request. What you can use is to employ the low-level interface for scatter plots to write such stuff on your own. A related application can be found in the pgfplots manual (search for "Low-Level scatter plot interface Example"). Please refer to that section to see if that is something for you. For your convencience, here is a copy of the mentioned example (the manual contains explanations): \begin{tikzpicture} % Low-Level scatter plot interface Example: % use three different marker classes % 0% - 30% : first class % 30% - 60% : second class % 60% - 100% : third class \begin{axis}[ scatter/@pre marker code/.code={% \ifdim\pgfplotspointmetatransformed pt<300pt \def\markopts{mark=square*,fill=blue}% \else \ifdim\pgfplotspointmetatransformed pt<600pt \def\markopts{mark=triangle*,fill=orange}% \else \def\markopts{mark=pentagon*,fill=red}% \fi \fi \expandafter\scope\expandafter[\markopts] },% scatter/@post marker code/.code={% \endscope }] \addplot+[scatter,scatter src=y, samples=40] {sin(deg(x))}; \end{axis} \end{tikzpicture} Kind regards Christian Am 29.03.2013 12:58, schrieb Mike Hettich: > Dear all, > > I hevaily use pgfplots for preparing graphs. I encountered a problem I > was not able to solve yet. While it is possible to use the key "sampled" > for the colorbar the respective data points in the plot are still > linearly mapped onto the provided colormap. I have not found an option > yet to force a discrete colormapping for the scatter plot, i.e. one > color for a range of values instead of color interpolation. I hope you > can provide some advice on how to solve this issue. > > > Best regards > Mike > > ------------------------------------------------------------------------------ > Own the Future-Intel(R) Level Up Game Demo Contest 2013 > Rise to greatness in Intel's independent game demo contest. Compete > for recognition, cash, and the chance to get your game on Steam. > $5K grand prize plus 10 genre and skill prizes. Submit your demo > by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2 > _______________________________________________ > Pgfplots-features mailing list > Pgf...@li... > https://lists.sourceforge.net/lists/listinfo/pgfplots-features |
From: Mike H. <mik...@gm...> - 2013-03-29 11:58:27
|
Dear all, I hevaily use pgfplots for preparing graphs. I encountered a problem I was not able to solve yet. While it is possible to use the key "sampled" for the colorbar the respective data points in the plot are still linearly mapped onto the provided colormap. I have not found an option yet to force a discrete colormapping for the scatter plot, i.e. one color for a range of values instead of color interpolation. I hope you can provide some advice on how to solve this issue. Best regards Mike |
From: Neal H. W. <ne...@wa...> - 2013-03-21 13:48:14
|
FWIW, I've attached the R code that I'm using to choose ticks and tick labels. The algorithms are sound, but the lack of context means that I have to make assumptions about the text size and available space. Examples: > source('axis.R') > axis.ticks.generate(1:100) [1] 0 10 20 30 40 50 60 70 80 90 100 > axis.ticks.generate(1:100, log=TRUE) [1] 1.0 1.8 3.0 6.0 10.0 18.0 32.0 56.0 100.0 > axis.labels.select(axis.ticks.generate(1:100)) [1] "0" "10" "20" "30" "40" "50" "60" "70" "80" "90" "100" > axis.labels.select(axis.ticks.generate(1:100), available.space=20) [1] "0" "" "20" "" "40" "" "60" "" "80" "" "100" Perhaps this code will be useful to someone. Neal make.multiple.of <- function(x, multiple, towards.zero=FALSE, away.from.zero=FALSE, towards.positive.infinity=FALSE, towards.negative.infinity=FALSE) { if (sum(sapply(list(towards.zero, away.from.zero, towards.positive.infinity, towards.negative.infinity), function (x) identical(x, FALSE))) != 3) { browser() stop("You must set exactly one of towards.zero, away.from.zero, towards.positive.infinity or towards.negative.infinity to TRUE") } if (towards.zero) return (sign(x) * (abs(x) - abs(x) %% multiple)) if (away.from.zero) return (sign(x) * (abs(x) + (-abs(x) %% multiple))) if (towards.positive.infinity) { mask = x < 0 } else { stopifnot(towards.negative.infinity) mask = x > 0 } x[mask] = make.multiple.of(x[mask], multiple=multiple, towards.zero=TRUE) x[!mask] = make.multiple.of(x[!mask], multiple=multiple, away.from.zero=TRUE) return (x) } axis.ticks.generate <- function(values, log=FALSE, ticks=10, verbose=FALSE) { if (log) values = base::log(values, 10) # Compute the difference between the extremes. min.value = min(values) max.value = max(values) value.range = max.value - min.value if (value.range > 10 && log) { min.value = floor(min.value) max.value = ceiling(max.value) value.range = max.value - min.value } orders.of.magnitude = max(floor(log(abs(value.range), base=10))) if (verbose) cat(sprintf("%g - %g => width of %g (spans %d orders of magnitude)\n", min.value, max.value, value.range, orders.of.magnitude)) generate.ticks <- function(step.size.multiple) { step.size = step.size.multiple * 10^(orders.of.magnitude - 1) min.axis = make.multiple.of(min.value, step.size, towards.negative.infinity=TRUE) max.axis = make.multiple.of(max.value, step.size, towards.positive.infinity=TRUE) ticks = seq(min.axis, max.axis, step.size) if (verbose) cat(sprintf("Step size of %g (multiple: %g) results in %d ticks:\n %s\n", step.size, step.size.multiple, length(ticks), paste(sprintf("%g", ticks), collapse=", "))) # Trim the ticks, if appropriate. # In steps. max.margin = 0.5 separation = (min.value - ticks[1]) / step.size if (separation > max.margin) { if (verbose) cat(sprintf("trimming left: (%g of a step >= %g of a step)\n", separation, max.margin)) ticks[1] = min.value } separation = (ticks[length(ticks)] - max.value) / step.size if (separation > max.margin) { if (verbose) cat(sprintf("trimming right: (%g of a step >= %g of a step)\n", separation, max.margin)) ticks[length(ticks)] = max.value } return (ticks) } # Choose the step size that is as close to 10 ticks as possible. step.size.multiples = c(1, 1.25, 2.5, 5, 10) # We prefer multiples of 10. step.size.penalties = c(0, 2, 1.5, 1, 0) step.size.multiple = step.size.multiples[ which.min(abs(ticks - (sapply(step.size.multiples, function (m) { length(generate.ticks(m)) }) + step.size.penalties)))] if (verbose) cat(sprintf("Optimal step size multiple for %d ticks is %g\n", ticks, step.size.multiple)) ticks = generate.ticks(step.size.multiple) if (log) { ticks = 10^ticks if (10^value.range < 2) ticks = signif(ticks, 2) else { small = abs(ticks) < 2 large = abs(ticks) >= 100 medium = !(small | large) ticks[small] = round(ticks[small], 1) ticks[medium] = round(ticks[medium]) ticks[large] = signif(ticks[large], 2) ticks = unique(ticks) } } return (ticks) } axis.labels.select <- function(ticks, labels=NULL, axis='x', available.space=NULL, log=FALSE, log.base=NULL, verbose=FALSE) { stopifnot(is.numeric(ticks)) if (length(ticks) <= 1) return (as.character(ticks)) if (is.null(labels)) labels = ticks if (is.numeric(labels)) { if (max(abs(ticks)) >= 10) # We have single and double digit numbers. Make the single # digit numbers single digit and the wider numbers significant # to 2 places. labels = ifelse(abs(ticks) >= 10, signif(ticks, 2), round(ticks)) else # Use 2 significant digits, except for the last tick. labels = signif(ticks, 2) labels[length(labels)] = ticks[length(ticks)] labels = sprintf("%g", labels) } stopifnot(length(ticks) == length(labels)) stopifnot(is.character(labels)) if (log) { if (is.null(log.base)) log = base::log else { log = function(x) { base::log(x, base=log.base) } exp = function(x) { log.base^x } } } else { log = identity exp = identity } stopifnot(axis %in% c('x', 'y')) # Assuming labels are evenly spaced: # # If all labels are 2 characters wide, we can have 11 labels without # overlap. That's 22 characters plus 10 inter-label spaces. # # If all labels are 3 characters, then we can have 8 labels # without overlap. That's 24 characters plus 7 interlabel spaces. # # If all labels are 4 characters, then we can have 6 labels # without overlap. That's 24 characters plus 5 interlabel spaces. # # Thus, we have space for about 37 characters (digits or spaces). # # This means that we can have a density of one character every # 1/37th of the x-axis. if (is.null(available.space)) available.space = if (axis == 'x') 37 else 20 # Here's our approach: for each pair of adjacent, non-empty # labels, we compute the number of characters from the middle of # the left label to the middle of the right label and the amount # of available space. If the character density exceeds the # threshold, then we kill one of the labels. # Compute the position of each tick on a linear scale from 0 to 1. pos = (log(ticks) - log(ticks[1])) / (log(ticks[length(ticks)]) - log(ticks[1])) label.space <- function(label) { if (axis == 'y') # XXX: It's hard to compute the height. Most likely, it is just # one, however. return (1) label = gsub("[\\][a-zA-Z]*", "x", label) label = gsub("$", "", label, fixed=TRUE) return (nchar(label) # Count punctuation as less than a character. # - .25 * sapply(strsplit(label, '[.,]'), length) ) } stopifnot(length(ticks) >= 2) for (i in 2:(length(ticks))) { # Find the first label (largest x, such that x <= i - 1) that # is not the empty string. not.empty = which(labels[(i - 1):1] != "") if (length(not.empty) == 0) next left = ((i - 1):1)[not.empty[1]] right = i if (labels[right] == "") next used.chars = (sum(label.space(labels[c(left, right)])) / 2 # The interlabel space. + 1) space = pos[right] - pos[left] available.chars = available.space * space if (verbose) cat(sprintf("Considering %s: space: %.2g => %.1f characters; have %g characters.\n", paste(sprintf("'%s'", labels[c(left, right)]), collapse=", "), space, available.chars, used.chars)) if (used.chars > available.chars) { # Kill the current label, unless this is the last label # (which we always want to keep). kill = if (right == length(ticks)) left else right if (verbose) cat(sprintf("Killing '%s' (index: %d)\n", labels[kill], kill)) labels[kill] = "" } } labels } |
From: Neal H. W. <ne...@wa...> - 2013-03-11 14:38:16
|
Hi, I wrote a program to generate plots. It specifies the tick labels that pgfplots should use. This works great except when I have too many ticks. In this case, the labels overlap. Is it possible to have pgfplots select, say, the maximum number of nicely spaced tick labels between which there is at least 1em of space? Right now, I have a hacky solution that selects at most 8 tick labels, but sometimes even this is too many. Thanks, Neal |
From: Neal H. W. <ne...@wa...> - 2013-01-19 13:03:46
|
Hi Christian, Thank you for your help. At Sat, 19 Jan 2013 12:05:50 +0100, Christian Feuersaenger wrote: > PGFplots assumes that user-provided transformations fit into the axis, > i.e. that the transformation "knows" that it is to be applied in a log > context. Consequently, you'd need two transformations, one tailored for > linear axes and one tailored for log axes. This could be done by means > of styles. So there is no way for the 'x coord inv trafo/.code' code to determine that the argument is the log of the value and not the value? That's too bad. Perhaps this is something that could be added to a future version of pgfplots. > I hope this helps so far. It does! Thanks! :) Neal |
From: Denis B. <dbi...@wa...> - 2013-01-19 11:22:57
|
Le samedi 19/01/13 à 12h10, Christian Feuersaenger <cfe...@go...> a écrit : > Thanks! You're welcome! That's little work compared to pgfplots ;) -- Denis |