4
votes
1answer
53 views

Using set list with pgfplotstable

I am trying to create a new column in a table using the set list option, but it will not expand the list when stored in a macro. I've tried \expandafter in various locations with no joy so far. ...
3
votes
1answer
77 views

Set samples in tikzpicture from macro value

I'm trying to use set the amount of samples per tikzpicture globally: \documentclass{standalone} \usepackage{pgfplots} \pgfmathdeclarefunction{gauss}{2}{% ...
2
votes
1answer
91 views

Macro for pgfplot cycle list entry

I'm trying to define multiple cycle lists based on macro variables. The reason for this is that I need more than one list and I want to be able to change the appearance quickly while keeping the ...
4
votes
1answer
89 views

Create macro from fairly complex pgfplots code

I have this pgfplots code that takes data from a file mydata.tsv and creates a bar plot. Now I would like to transform it into a macro in order to use it for several files. \pgfplotstableread[col ...
2
votes
1answer
58 views

Trouble including graphics from csv file into Pgftable, commands are dissapearing (local maybe?)

I've been trying to add eps graphics with the filename in a csv file. Take a look at the CSV to get an idea of what I mean: ...
5
votes
2answers
184 views

Bouncing ball over time

I have this clumsy code to plot the height of a bouncing ball over time. Is there a possibility for optimization? Perhaps writing the functions directly with the tikz math library? Also at the moment ...
2
votes
1answer
82 views

How to save a list as a macro for pgfplots

I want to create and store a list then use that list in a pgfplots scatterplot. My attempt is \documentclass{standalone} \usepackage{pgfplots} \begin{document} \newcommand{\listA}{ (1,2) (2,3) ...
3
votes
1answer
221 views

Settting PGFplots axis environment options by means of \newcommand and {\newlength,\setlength}

Because I often use the same options for multiple axes in my LaTeX documents, I use the following code to simplify my life. \documentclass{article} \usepackage{pgfplots} ...
6
votes
1answer
180 views

evaluate a string like `sin(x)+3` with `x` given

I defined a macro that gets as input a string like sin(x)+3, a starting x and an ending x, which is plotted using \addplot from PGFplots. Now I want to evaluate this function for x equal to the ...
6
votes
1answer
148 views

Problems with passing values through nested levels

Inspired by a comment to another question, I'm trying to generalise some code to draw coloured in rectangles upon the graph of a function. The routine \findmax, given an x-value and a function, ...
3
votes
1answer
157 views

How to use a macro inside tick definition in pgfplots

Consider the following code: \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \newcommand\myxtick[1]{\foreach \x in {2,3,4}{\x,}#1} \newcommand\otherxtick{2,3,4,5} \begin{document} ...
14
votes
3answers
1k views

How to draw a irregular circle(shape)?

I want to draw some irregular circle(shape) in my wireless scenario. with a basestation in the center. around is some irregular circle(shape). I find something(could be used) in this web(but I feel ...
4
votes
1answer
252 views

pgfplots: using macro for tick label

I would like to use a macro to define the label of an extra tick in a pgfplots picture. When the macro uses a greek character it generates an error: ! Missing \endcsname inserted. Here is my MWE: ...
6
votes
1answer
211 views

using more than 2 arguments in a pgfplots style

Based on How to plot data from multiple filters using pgfplots I got a follow up one. I would like to filter not only for one value of P for each plot but for also for X values that are smaller than a ...
5
votes
0answers
430 views

Trying to make an automatic histogram (in pgfplots?)

How can I convert the automatic table generated by the macro, to an automatic histogram? Is the best way do it using pgfplots? \documentclass{article} \RequirePackage{ifthen} ...
5
votes
1answer
239 views

Use macro to draw inside pgfplot/axis

I would like to implement a gantt chart function inside pgfplots. To draw the tasks, I have a macro that calculates the start and finish time of a task. However, when I use multiple tasks, the values ...
4
votes
1answer
340 views

How to define a parameterized command to be consumable in \pgfmathdeclarefunction?

This is the solution to defining a piecewise function for pgfplots. However, I would like to be able to use a macro to define each of the pieces of the function. It is simple to do this if one is ...
4
votes
1answer
825 views

Using Macro Defined Lists in TikZ/PGFplots

I want to be able to use a macro to specify a list (it is a constant list, i.e. will not change throughout the document) and use this macro rather than hard code the list contents in the TikZ/PGFplots ...
5
votes
1answer
308 views

Using \IfNoValueTF within a TikZ style specification.

In an answer to Flushing PGF commands and local variable Matthew had suggested using \IfNoValueTF within a TikZ \node specification to determine the text. This solution works great for me. However, ...
4
votes
1answer
234 views

Determine if within a PGF axis environment

Is there an easy way to test whether a macro is called from within an PGF \begin{axis}...\end{axis} environment? One solution would be to define a new environment myself that sets a flag at ...
3
votes
2answers
307 views

Use \def without including the square bracktes with pgfplot?

I would like to define a line style to use in my pictures. But would still like to retain the flexibility to be able to tweak these if needed in the actual picture, as in the third picture ...