### Basic TikZ Scope for Drawing and Styling Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt A simple TikZ example illustrating the use of a `scope` environment to apply styles like fill color and draw color to enclosed path objects. This is relevant for understanding issues related to style inheritance and scope limitations within graphical environments. ```tikz \begin{tikzpicture} \scope[fill=blue,draw=red] \path (0,0) circle (10pt); \endscope \end{tikzpicture} ``` -------------------------------- ### PGFPlots Plot Command Syntax Example Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet illustrates a failing plot command in PGFPlots due to incorrect syntax when applying options directly before the 'plot coordinates' command. The `\addplot+` syntax with options preceding the coordinate list can cause issues. ```latex \addplot+[black] plot coordinates { (0,0) (1,1) }; % This command fails ``` -------------------------------- ### Create Quiver Plots for Vector Fields in PGFPlots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Visualizes vector fields using quiver plots, where arrows indicate the direction and magnitude of vectors at various points. This example uses tabular data for vector components (u, v). ```latex \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ title={Vector Field}, xlabel={$x$}, ylabel={$y$}, domain=-2:2 ] \addplot[ quiver={u=\thisrow{u}, v=\thisrow{v}}, -stealth, samples=10 ] table { x y u v 0 0 1 0 1 0 0 1 0 1 -1 0 1 1 0 -1 }; \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### Arrange Subplots with PGFPlots Groupplots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Utilizes the 'groupplots' library to create structured layouts of multiple subplots. This example arranges four plots in a 2x2 grid with specified spacing and individual plot titles. Requires 'groupplots' library. ```latex \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{groupplot}[ group style={group size=2 by 2, horizontal sep=2cm, vertical sep=2cm}, height=4cm, width=5cm ] \nextgroupplot[title=Plot 1] \addplot {x^2}; \nextgroupplot[title=Plot 2] \addplot {sin(deg(x))}; \nextgroupplot[title=Plot 3] \addplot {exp(x)}; \nextgroupplot[title=Plot 4] \addplot {ln(x)}; \end{groupplot} \end{tikzpicture} \end{document} ``` -------------------------------- ### GPL Interactive Program Notice (Terminal) Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/gpl-3.0.txt This snippet shows how a program, when run in interactive mode, should display a short notice to the user. This notice includes copyright information and details about its free software status and redistribution conditions, directing users to 'show w' and 'show c' for more details. ```plaintext Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. ``` -------------------------------- ### GPL v3 License Notice for New Programs (Source File) Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/gpl-3.0.txt This code snippet demonstrates how to include the GNU General Public License (GPL) version 3 notice in the source files of a new program. It specifies copyright information, redistribution terms, and warranty disclaimers, linking to the full GPL license. ```plaintext Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ``` -------------------------------- ### Generating Color and B/W Plots using PDF Viewer Features Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This task investigates utilizing PDF viewer capabilities to generate different document versions for printing (e.g., B/W) versus screen viewing (e.g., color). The 'draftcopy' package is mentioned as a potential tool. ```latex % Kann man das nutzen, um sowohl farbige als auch S/W-plots zu generieren? % -> pruefe draftcopy paket % Example using draftcopy (conceptual): % \documentclass[print]{article} % \usepackage{pgfplots} % \usepackage{draftcopy} % \draftcopy{color} % \begin{document} % \begin{tikzpicture} % \begin{axis}[ % color=blue % ] % \addplot {x^2}; % \end{axis} % \end{tikzpicture} % \end{document} % % \documentclass[screen]{article} % \usepackage{pgfplots} % \begin{document} % \begin{tikzpicture} % \begin{axis}[ % color=red % ] % \addplot {x^2}; % \end{axis} % \end{tikzpicture} % \end{document} ``` -------------------------------- ### Create 3D Mesh Plots with Custom Colormaps in pgfplots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Demonstrates creating 3D mesh visualizations with various colormap schemes and shading options using pgfplots. It utilizes the `mesh` plot type and the `colorbrewer` library for colormaps. ```latex \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{colorbrewer} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ colormap/cool, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, colorbar ] \addplot3[mesh, samples=20, domain=0:1] {x*(1-x)*y*(1-y)}; \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### Create 3D Surface Plots in pgfplots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Illustrates the creation of three-dimensional surface plots with automatic shading and colormaps using pgfplots. The `surf` option and `colormap/viridis` are utilized for visualization. ```latex \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ colormap/viridis, xlabel={$x$}, ylabel={$y$}, zlabel={$f(x,y)$}, title={3D Surface Plot} ] \addplot3[surf, shader=interp, samples=25, domain=-2:2] {exp(-x^2-y^2)}; \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### Creating Public Key Alias for '/pgfplots/domain' Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet suggests creating a public key alias for '/pgfplots/domain' that maps to '/tikz/domain'. This would streamline the usage of the domain setting, making it consistent with TikZ's own domain key. ```tex create public key alias for '/pgfplots/domain' -> '/tikz/domain' ``` -------------------------------- ### Introducing 'label' and ' ef' for Legend Entries Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet proposes the introduction of '\label' and '\ref' commands for legend entries. This would allow users to reference legend items programmatically, similar to how labels and references are used for figures or sections. ```tex introduce \label and \ref for legend entries? ``` -------------------------------- ### Implementing '-plot' Commands with Move-To Operation in PGFPlots Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This feature implementation would allow '-plot' commands to include a move-to operation at the beginning of each plot. This could enable new possibilities for fill styles and other graphical effects. ```pgfplots % Allow the '-plot' commands. % It would be a cool feature if '(FIRST_X,0)' could be inserted as move-to operation before every plot. % Example: % \addplot[fill=blue!20] coordinates {(1,1) (2,3) (3,2)}; % % Would conceptually become: % \path[draw=none] (1,0) -- cycle; % \addplot[fill=blue!20] coordinates {(1,1) (2,3) (3,2)}; ``` -------------------------------- ### Create Stacked Area Plots in pgfplots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Illustrates layering multiple datasets with cumulative values using the `stack plots` and `area style` options in pgfplots. This is effective for showing the contribution of different components over time. ```latex \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ stack plots=y, area style, xlabel={Year}, ylabel={Sales}, legend pos=north west ] \addplot coordinates {(2018,100) (2019,120) (2020,150) (2021,180)}; \addplot coordinates {(2018,50) (2019,60) (2020,80) (2021,90)}; \addplot coordinates {(2018,30) (2019,40) (2020,45) (2021,55)}; \legend{Product A, Product B, Product C} \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### Checking New Floating Point Routines for Linear Map Data Range Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet suggests checking whether the newly implemented floating-point routines can be effectively used to set up a linear map from data range to display range. This implies validating the accuracy and capabilities of the new routines for coordinate transformations. ```tex check whether the new floating point routines can be used to REALLY setup a linear map DATA RANGE -> DISPLAY RANGE ``` -------------------------------- ### Using PDF Line Annotations for Clickable Library (Limitations) Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet explores the possibility of using PDF line annotations to improve the clickable library. However, it concludes that this approach is not feasible due to restrictions when using LaTeX. ```tex perhaps I can use pdf line annotations to improve clickable lib? -> no: there are right restrictions when using latex. ``` -------------------------------- ### Coordinate Preparation Routines Assigning Global Registers Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet suggests that coordinate preparation routines should assign global registers. This is intended to properly handle grouped '\addplot' commands and enable optimizations in coordinate processing, such as eliminating list allocations. ```tex the coordinate preparation routines should assign global registers. This would deal properly with grouped '\addplot' commands and it allows several optimizations in the coordinate processing (elimination of list allocations). ``` -------------------------------- ### Documenting the TikZ 'external' Library (CVS) Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This task is to document the 'external' library of TikZ, which is currently only available via CVS. The documentation should cover its features and usage. ```tikz % Document the 'external' library of tikz (CVS only). % This library might provide features for external data handling or integration. % Further details would be in the actual documentation content. ``` -------------------------------- ### Create Histogram Plots in pgfplots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Shows how to create histograms with automatic binning using the `statistics` library in pgfplots. The `ybar interval` and `hist` options are employed for histogram generation. ```latex \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{statistics} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ ybar interval, xlabel={Value Range}, ylabel={Frequency} ] \addplot+ [hist={bins=10}] table[row sep=\\,y index=0] { data\\ 1\ 2\ 3\ 3\ 4\ 5\ 5\ 5\ 6\ 7\ 8\ 8\ 9\ 10\ 11\ 12\ 15\ 18\ 20\ }; \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### PGFPlots: Basic Line Plot with Inline Coordinates (LaTeX) Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Generates a simple 2D line plot using inline coordinate pairs within a tikzpicture environment. Requires the pgfplots package and specifies axis labels and a title. Suitable for basic data visualization. ```latex \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel={Time (s)}, ylabel={Temperature (°C)}, title={Temperature vs Time} ] \addplot coordinates { (0,20) (1,25) (2,35) (3,50) (4,65) (5,75) }; \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### Implementing a Real Linked List Data Structure Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet outlines the desired features for a real linked list implementation within pgfplots. The focus is on achieving efficient O(1) push/pop operations while allowing for O(N) copy, conversion to macro list, and traversal/loop operations. ```tex is it possible to create a *real* linked list? It should have the following features: 1. O(1) push/pop operations 2. O(N) copy() 3. O(N) convert to macro list 4. O(N) traversal/loop ``` -------------------------------- ### Create 3D Parametric Plots in pgfplots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Shows how to generate three-dimensional parametric curve plots with customizable viewing angles in pgfplots. The `view` option and parametric coordinates are used. ```latex \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ view={60}{30}, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, title={3D Spiral} ] \addplot3[ blue, thick, domain=0:5*pi, samples=100, samples y=0 ] ({sin(deg(x))}, {cos(deg(x))}, {2*x/(5*pi)}); \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### PGFPlots: Scatter Plot with Custom Markers (LaTeX) Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Creates scatter plots for visualizing data points with various marker styles, sizes, and colors. Allows plotting multiple datasets on the same axes with distinct markers and a legend. ```latex \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel={Variable X}, ylabel={Variable Y}, title={Scatter Plot Example} ] \addplot[only marks, mark=*, mark size=2pt, color=blue] coordinates { (1,2) (2,4.2) (3,5.8) (4,8.1) (5,9.7) (1.5,2.8) (2.5,5.1) (3.5,6.9) (4.5,8.8) }; \addplot[only marks, mark=square*, mark size=2pt, color=red] coordinates { (1,3) (2,3.5) (3,7) (4,7.5) (5,10) (1.5,3.2) (2.5,4.8) (3.5,7.2) (4.5,9.1) }; \legend{Dataset 1, Dataset 2} \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### Documenting Internal TikZ Registers for Libraries Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This documentation task involves explaining how to utilize TikZ's internal registers within libraries. It is intended for developers using or extending TikZ with custom libraries. ```tikz % Document how internal registers can be used in libraries. % Example: % \pgfutil@addtoks{\pgfkeyssetvalue{/mykey}{#1}} % \pgfutil@tempdima=10pt ``` -------------------------------- ### Using \pgfmathln with Float Support Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet suggests testing \pgfmathln within the log code, combined with float support. This implies exploring the performance and accuracy implications of using the natural logarithm function with floating-point numbers in pgfplots. ```tex Speaking about optimiziation: I always wanted to test \pgfmathln inside of the log code (combined with float support). ``` -------------------------------- ### Create Box Plots with PGFPlots Statistics Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Generates box-and-whisker plots to visualize the distribution of statistical data, including quartiles and outliers. Requires the 'statistics' library. Input is tabular data. ```latex \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{statistics} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ boxplot/draw direction=y, ylabel={Values}, xtick={1,2,3}, xticklabels={Group A, Group B, Group C} ] \addplot+ [boxplot] table[row sep=\\\,y index=0] { data\\ 5\ 6\ 7\ 8\ 9\ 10\ 11\ }; \addplot+ [boxplot] table[row sep=\\\,y index=0] { data\\ 3\ 4\ 5\ 6\ 7\ 14\ 15\ }; \addplot+ [boxplot] table[row sep=\\\,y index=0] { data\\ 7\ 8\ 9\ 10\ 11\ 12\ 13\ }; \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### PGFPlots: Mathematical Expression Plotting (LaTeX) Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Plots mathematical functions defined by expressions using TeX syntax. It allows specifying the domain, number of samples, axis labels, and plotting multiple functions with different styles and legends. ```latex \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ domain=-3:3, samples=100, xlabel={$x$}, ylabel={$f(x)$}, legend pos=outer north east ] \addplot[blue, thick] {x^2}; \addplot[red, thick] {exp(x)}; \addplot[green!50!black, thick] {sin(deg(x))}; \legend{$x^2$, $e^x$, $\sin(x)$} \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### PGFPlots: Logarithmic Axis Plots (LaTeX) Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Creates plots with logarithmic scaling on one or both axes using loglogaxis, semilogxaxis, or semilogyaxis. This is useful for data spanning multiple orders of magnitude and includes options for legends and grids. ```latex \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{loglogaxis}[ xlabel={Cost}, ylabel={Error}, legend pos=south west, grid=major ] \addplot coordinates { (5,8.31160034e-02) (17,2.54685628e-02) (49,7.40715288e-03) (129,2.10192154e-03) (321,5.87352989e-04) (769,1.62269942e-04) }; \addplot coordinates { (7,8.47178381e-02) (31,3.04409349e-02) (111,1.02214539e-02) (351,3.30346265e-03) (1023,1.03886535e-03) (2815,3.19646457e-04) }; \legend{Method A, Method B} \end{loglogaxis} \end{tikzpicture} \end{document} ``` -------------------------------- ### Typeset Numerical Tables with PGFPlotsTable Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Formats and displays numerical data in tables, offering control over column names, number formatting (scientific notation, fixed-point), and precision. Uses the 'pgfplotstable' package. ```latex \documentclass{article} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \pgfplotstabletypeset[ columns/x/.style={column name=$x$, int detect}, columns/y/.style={column name=$y$, sci, sci zerofill, precision=2}, columns/z/.style={column name=$z$, fixed, fixed zerofill, precision=3}, every head row/.style={before row=\\hline, after row=\\hline}, every last row/.style={after row=\\hline} ]{ x y z 1 1.234e5 0.5 10 2.567e3 1.234 100 5.432e2 2.567 1000 1.234e1 3.890 } \end{document} ``` -------------------------------- ### Combine Multiple Plots with Shared Axes in PGFPlots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Illustrates how to overlay multiple plots (lines with markers, dashed lines, dotted lines) on the same PGFPlots axis system. This is useful for comparing different datasets. Includes axis labels, legend, and grid. ```latex \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel={Time}, ylabel={Measurements}, legend pos=north west, grid=major ] \addplot[blue, thick, mark=*] coordinates { (1,10) (2,15) (3,13) (4,18) (5,20) }; \addplot[red, dashed, thick] coordinates { (1,8) (2,12) (3,16) (4,14) (5,19) }; \addplot[green!50!black, dotted, ultra thick] coordinates { (1,12) (2,14) (3,15) (4,16) (5,18) }; \legend{Series 1, Series 2, Series 3} \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### Load Data from External Files in pgfplots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Demonstrates how to load plot data from external files in various formats (space-separated, tab-separated, CSV) using the `table` command in pgfplots. This is useful for plotting large datasets or pre-processed data. ```latex \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} % File: data.txt % x y % 0 0 % 1 1.5 % 2 3.2 % 3 5.1 \begin{tikzpicture} \begin{axis}[ xlabel={X Values}, ylabel={Y Values}, title={Data from External File} ] \addplot[color=red, mark=square] table {data.txt}; \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### Implementing Scatter Classes with Sanity Checking Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet proposes the implementation of a 'scatter classes' feature. A key aspect of this feature is sanity checking, where the system attempts to verify if 'pgfmathfloattofixed' results in a known class, while also catching exceptions for non-numeric values. ```tex implement simply style 'scatter classes'. + sanity checking feature: try if 'pgfmathfloattofixed' results in a known class! -> but catch exceptions if the value is no number! ``` -------------------------------- ### Documenting Line Styles with Arrows Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet indicates a need to document the line styles that support arrows. This documentation should clarify how to use and configure arrows on lines within pgfplots. ```tex document line styles with arrows ``` -------------------------------- ### PGFPlots Floating Point Math Library Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt A suggestion to refactor the floating-point math routines in PGFPlots into a separate library, while maintaining compatibility with the existing PGFPlots implementation. ```latex % Concept for refactoring: % Create a separate library for floating-point math routines. % Ensure PGFPlots provides compatibility support for this new library. ``` -------------------------------- ### Intuitive Naming Scheme for Styles Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet addresses the unintuitive naming of styles in pgfplots. The proposal is to adopt a more convenient naming scheme, similar to 'legend style={}', where the style name directly reflects the option it affects (e.g., 'xlabel style', 'title style'). This aims to resolve issues with backwards compatibility with xkeyval. ```tex styles are named very unintuitively. I should add something more convenient (for example like the 'legend style={}' command). Idea: use the *same* name as the options which are affected, 'xlabel style' 'title style' etc. My current naming scheme used the name of the 'every style' which suffer from backwards compatibility with xkeyval... :-( ``` -------------------------------- ### Optimizing Number Parsing with Macro Constructions Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet suggests an optimization for the number parser in pgfplots. By using \csname ...#1\endcsname constructions, where #1 is the current character, it aims to reduce macro assignments and \ifx character comparisons, leading to faster parsing. ```tex I could optimize the number parser with '\csname ...#1\endcsname' constructions where '#1' is the currently identified character. If #1 in {0-9,e,E,+-} etc., I could save a lot of macro assignments and \ifx character comparisons. ``` -------------------------------- ### Define and Apply Custom Colormaps in PGFPlots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Demonstrates how to define a custom colormap using RGB values and apply it to a 3D surface plot. This allows for tailored color gradients in visualizations. The 'colorbar' option is also included. ```latex \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \pgfplotsset{ colormap={custom}{ rgb255=(0,0,255) rgb255=(255,255,255) rgb255=(255,0,0) } } \begin{tikzpicture} \begin{axis}[colormap name=custom, colorbar] \addplot3[surf, shader=interp, samples=20, domain=-1:1] {x*y}; \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### PGFPlots Search Path for Table Package Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt The search path for the PGFPlots table package is considered inadequate and should be updated to include `/pgfplots` for better integration and functionality. ```latex % Current potential issue: % \pgfplotstableread[col sep=comma]{data.csv}\mydata % Recommended improvement: % Ensure '/pgfplots' is in the search path for table reading. ``` -------------------------------- ### Moving Math Mode Shifts in PGFPlots Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This task concerns moving math mode shifts into the \prettyprintnumber implementation within PGFPlots. This aims to centralize and improve the handling of number formatting, especially in math contexts. ```pgfplots % Move math mode shifts into \prettyprintnumber implementation. % This would involve modifying the \prettyprintnumber macro to handle math mode. % Example (conceptual): % \def\prettyprintnumber#1{\mathchoice{\text{\pgfmathprintnumber{#1}}}{\text{\pgfmathprintnumber{#1}}}{\text{\pgfmathprintnumber{#1}}}{\text{\pgfmathprintnumber{#1}}}} ``` -------------------------------- ### Creating a Floating Point to Scientific Notation Method Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet proposes the creation of a \pgfmathfloattosci method. This method would be used for converting floating-point numbers to scientific notation, specifically for use within the table package's numerics handling. ```tex create a \pgfmathfloattosci method and use that for the numerics in table package ``` -------------------------------- ### Improving Tick Placement Systematically in PGFPlots Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This task focuses on improving the tick placement algorithm in PGFPlots in a more systematic way. This aims to achieve better visual distribution and adherence to Ticks placement rules. ```pgfplots % Improve tick placement (more) systematically. % This could involve refining the tick generation logic to better handle various axis scales and data ranges. ``` -------------------------------- ### Implementing Proper Anchors in TikZ Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This task focuses on implementing proper anchor points in TikZ. Anchors are crucial for positioning nodes and elements accurately relative to other objects. ```tikz % Implement proper anchors. % This could involve defining new anchor points or refining existing ones. % Example for a potential new anchor: % \node at (0,0) [anchor=axis start] {Text}; ``` -------------------------------- ### Providing Tick Labels as a List in PGFPlots Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This feature request is to allow users to provide tick labels as a list, which can then be converted to \listnew and accessed using \listpopfront. This offers a more structured way to define custom tick labels. ```pgfplots % Provide tick labels as a list like: axis[tick labels={A,B,1,4,5,$\frac 12$}] % This would convert to \listnew, use listpopfront to access elements. % Example usage: % \begin{axis}[ % yticklabel style={/pgf/number format/fixed}, % yticklabel format=, % Placeholder for list access logic % yticklabel list={A, B, C, D, E} % ] % \addplot {x^2}; % \end{axis} ``` -------------------------------- ### Create Polar Axis Plots in pgfplots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Demonstrates creating plots in polar coordinates using the `polaraxis` environment in pgfplots. This is suitable for visualizing data with angle and radius specifications. ```latex \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{polar} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{polaraxis}[ title={Polar Rose Curve} ] \addplot[blue, thick, mark=none, domain=0:720, samples=600] {sin(2*x)*cos(2*x)}; \end{polaraxis} \end{tikzpicture} \end{document} ``` -------------------------------- ### Error Recovery in Key-Value Settings (PGFPlots) Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt Finding errors in key-value settings within PGFPlots can be difficult because commands like `\end{axis}` or `\pgfplotstabletypesetfile` may not provide the correct context for error reporting. Increasing `\errorcontextlines` is suggested as a potential improvement for error recovery. ```tex X error recovery: it is sometimes almost impossible to find errors in key-value-settings because \end{axis} or \pgfplotstabletypesetfile does not is NOT the correct context. -> possibly with \errorcontextlines=10? ``` -------------------------------- ### Implementing 'axis equal' Option Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet suggests the consideration and potential implementation of an 'axis equal' option. This option would ensure that the scaling of the x and y axes are the same, resulting in correctly proportioned shapes. ```tex axis equal option ``` -------------------------------- ### Implementing Horizontal Alignment at (0,0) in TikZ Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This question asks about achieving horizontal alignment at the (0,0) coordinate in TikZ, similar to how vertical alignment can be done with 'baseline'. ```tikz % Alignment: vertikal kann ich jetzt mit baseline. Kann ich horizontales % alignment an (0,0) hinbekommen? % Example query: % \node at (0,0) [anchor=origin] {Text}; % % Or potentially using relative positioning: % \node (A) at (0,0) {}; % \node at (A.center) {Text}; ``` -------------------------------- ### Extending Clickable Library for Table-Plot Interaction Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet proposes extending the clickable library in pgfplots. The extension would allow clicks within a TABLE to open markers in designated plots, enabling interactive data exploration. ```tex I could extend the clickable library such that a click into a TABLE opens a marker into one (or more) designated plots. ``` -------------------------------- ### Optimizing Macro Append Issue from O(N^2) to O(N) Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet highlights a performance bottleneck related to macro appending, which currently has a time complexity of O(N^2). The goal is to optimize this process to achieve O(N) time complexity, likely by rethinking the underlying macro expansion or data storage mechanism. ```tex optimize macro-append issue from O(N^2) time to O(N) ``` -------------------------------- ### Scaling Dimens for Binary Input Subroutines Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet discusses a scaling mechanism for dimension registers within binary input subroutines. The scaling should map the range [-16384, 16384] to a range suitable for N bytes, using integer division. The resulting integer can then be encoded using linear map functionality. ```tex use a simply scaling for dimen registers. The scaling should be such it maps [-16384,16384] -> properly, i.e. it is just an integer division. The resulting integer can be encoded using the available linear map functionality. ``` -------------------------------- ### Optimizing Scaled Standard Unit Vectors Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet discusses optimizing new code by re-defining \pgfqpointxy for the specific case of scaled standard unit vectors. This optimization likely aims to improve the precision or efficiency of coordinate transformations involving scaled units. ```tex optimize the new code by re-defining \pgfqpointxy for the case of scaled standard unit vectors. ``` -------------------------------- ### Using PGF Plot-Stream Framework in PGFPlots Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This task explores using the plot-stream framework of PGF directly instead of the TikZ 'plot coordinates' command. The advantage is potential speed improvements, as custom number parsing routines are already in place. ```pgfplots % Try to use the plot-stream framework of PGF directly instead of using the 'plot coordinates' command of tikz. % Advantage: would be faster. % Example (conceptual): % \addplot [raw gnuplot] {plot "data.txt" using 1:2 with lines}; % % If PGF plot-stream is used internally, it might look like: % \addplot \pgfplotstreamplot{data.txt}{1:2}{lines}; ``` -------------------------------- ### Implementing Axis as a Path-Command in TikZ Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This implementation task aims to create an axis functionality that can be used as a path-command within TikZ. This could allow for more flexible axis drawing and integration with path operations. ```tikz % Implement an axis as path-command. % This could involve defining a new TikZ path operation for axes. % Example sketch: % \path [axis] (0,0) -- (5,5); ``` -------------------------------- ### Re-implementing 'dec sep align' Natively Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet suggests re-implementing the 'dec sep align' feature of the table package natively, rather than relying on a high-level style. This implies a more integrated and potentially efficient approach to aligning decimal separators within tables. ```tex re-implement 'dec sep align' of table package natively, not as high-level style. ``` -------------------------------- ### Evaluating 'every axis plot' in \addplot (PGFPlots) Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt The 'every axis plot' options should be evaluated inside the `\addplot` command in PGFPlots, even if it leads to a small inefficiency due to re-evaluation in the `\draw` command. This allows options like 'id', 'prefix', and 'samples' to be correctly applied. Care must be taken with key paths as 'every axis plot' would then contain both display and behavioral options. ```tex + evaluate 'every axis plot' inside of \addplot command, even if that means a small inefficiency because it is evaluated in the \draw command as well. -> allows to get id, prefix, samples and other behaviorual options. -> attention: then, every axis plot would contain BOTH display and behavioral options; take care with key paths ``` -------------------------------- ### Providing Useful Bounding Box Truncations in TikZ Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This task involves providing simple options for useful bounding box truncations in TikZ. This feature would allow users to clip or limit the bounding box of certain elements or the entire picture. ```tikz % Provide simple options for useful bounding box truncations. % Example: % \begin{scope}[bbox trunc={north west to (1cm,1cm)}] % % Content to be truncated % \end{scope} ``` -------------------------------- ### Implementing Legend as TikZ-Matrix in PGFPlots Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This implementation task involves creating the legend using TikZ-matrix. This approach aims to correctly handle width computations, addressing potential bugs with font scaling. ```pgfplots % Implement the legend as tikz-matrix. % This aims to fix bugs with width computation related to font scaling. % Example (conceptual): % \begin{tikzpicture} % \matrix[legend matrix layout] { % \node {Plot 1}; & \node {\plotmark{1}}; % \node {Plot 2}; & \node {\plotmark{2}}; % }; % \end{tikzpicture} ``` -------------------------------- ### Generate Contour Plots in pgfplots Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Shows how to generate contour lines for 3D data projected onto 2D planes using pgfplots. The `contour lua` option is used to create the contour plot, useful for visualizing level sets. ```latex \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{patchplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ view={0}{90}, domain=-2:2, xlabel={$x$}, ylabel={$y$}, title={Contour Plot: $e^{-x^2-y^2}$} ] \addplot3[contour lua={number=10}, thick] {exp(-x^2-y^2)}; \end{axis} \end{tikzpicture} \end{document} ``` -------------------------------- ### Options for Log Plot Tick Formatting in PGFPlots Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This task involves providing options for formatting tick labels on logarithmic plots. Users should be able to choose between formats like '10^0.703' versus a fixed-point format. ```pgfplots % Provide options for log plot tick formatting: % 10^0.703 vs fixed point format. % Example: % \pgfplotsset{log tick label style={sci, exponent format=true}} % or % \pgfplotsset{log tick label style={fixed, precision=3}} ``` -------------------------------- ### Public API for pgfplotstable Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet outlines the requirements for a public basic level API for pgfplotstable. The API should provide functionality to access, iterate, and read table elements, as well as manipulate them. ```tex provide a public basic level API to pgfplotstable: + access, iterate and read table elements + manipulate elements ``` -------------------------------- ### Perform Column Operations with PGFPlotsTable Source: https://context7.com/pgf-tikz/pgfplots/llms.txt Enables mathematical operations on table columns to create new derived data columns. This snippet demonstrates calculating the average of two columns. It uses the 'pgfplotstable' package and its 'create col' functionality. ```latex \documentclass{article} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \pgfplotstableread{ x y 1 2 2 4 3 6 4 8 }\datatable \pgfplotstablecreatecol[ create col/expr={\thisrow{x} + \thisrow{y})/2} ]{average}{\datatable} \pgfplotstabletypeset[ columns={x,y,average}, columns/average/.style={column name=Average, fixed, precision=2} ]{\datatable} \end{document} ``` -------------------------------- ### User-Defined Strings to Numeric Range Mapping Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet mentions the possibility of mapping user-defined strings to a numeric range using a simple dictionary. This could be useful for categorizing or assigning numerical values to qualitative string inputs. ```tex user defined strings somehow into a numeric range (using a simple dictionary) ``` -------------------------------- ### Renaming Manual to pgfplots.pdf Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This task is a simple file management change: renaming the manual PDF file from 'manual.pdf' to 'pgfplots.pdf'. This improves discoverability via the 'texdoc pgfplots' command. ```shell mv manual.pdf pgfplots.pdf ``` -------------------------------- ### Externalize Command Halt-on-Error (PGFPlots) Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt The '-halt-on-error' option should be added to the 'externalize' command in PGFPlots. This will help in stopping the compilation process immediately when an error occurs during externalization, facilitating quicker debugging. ```tex + add '-halt-on-error' to externalize command ``` -------------------------------- ### Plotting Exponentially Sampled Points for Log Plots Source: https://github.com/pgf-tikz/pgfplots/blob/master/doc/latex/pgfplots/todo.archive.txt This snippet demonstrates how to sample points exponentially for log plots, which is more valuable for logarithmic scales. The formula calculates points between log(xmin) and log(xmax) linearly in the log domain, effectively sampling exponentially in the original domain. ```tex x_i = exp( log(xmin) + i * ( log(xmax)-log(xmin) )/(N-1) ) ```