i want to plot a time signal plot and i have problems with the correct tick label style:
here is my code:
\begin{axis}[
yscale=0.5,
ymin=0,
yticklabel style={scaled ticks=false,
/pgf/number format/precision=1},
\addplot[red, solid] table[x=time,y=a]{};
\end{axis}
\end{tikzpicture}
pfgplot
i tried a long time with pgf/number format/... but i didnt get any usefull help.
what i try is to get is:
comma instead points asa decimal
at the x axis there should be like 10, 20.. because i want it label with "mV"
how i can get for an logarythmic frequency plot a axis tick style like: 1k..1M..1G
Thanks for your help!
Related
This question looks similar to mine, but isn't about Latex: Legend outside the plot
I made a line plot in Latex using tikzpicture with the package pgfplots. Unfortunately, as can be seen, the legend is obstructing the view.
Can I move it out of the way? Say to the right, out of the plot area?
Thanks
The line
every axis legend/.append style={ at={(0.05,0.95)}, anchor=north west,legend columns = 1
in the pgfplotset{} should do it!
The anchor tells the legend which corner it wants to give coordinates to, and the coordinates in "append style ={ at = {(x,y)} }" tells that corner where you want it to go.
I usually just fiddle around with numbers until I like what I see, but you can use the general rule that between 0 and 1 is inside the plot and more than 1 is outside. So for example, if you want it just to the right of where it currently is, but outside the plot, you might use:
\begin{tikzpicture}
\pgfplotsset{
every axis legend/.append style={ at={(1.05,0.95)}, anchor=north west,legend columns = 1}}
\begin{axis}
... rest of plotting ...
\end{axis}
\end{tikzpicture}
I have a figure representing y=f(x) and I want to plot it for values of x in the range [10, 300] in log scale using tikz. If I set xmax=1e3 the ticks and minor ticks are as expected. However, when I set xmax=300 the minor ticks dissapear. In the two pictures below I show this behaviour:
\begin{axis}[
legend cell align={left},
legend entries={{Test},{Test Clip},{Train},{Train Clip}},
legend style={at={(0.03,0.97)}, anchor=north west, draw=white!80.0!black},
tick align=outside,
tick pos=left,
x grid style={white!69.01960784313725!black},
xlabel={$\dim(z)$},
xminorticks=true,
xmode=log,
xmin=10, xmax=1e3,
y grid style={white!69.01960784313725!black},
ylabel={PSNR},
ymin=15.8800682154579, ymax=26.0503182019626
]
\begin{axis}[
legend cell align={left},
legend entries={{Test},{Test Clip},{Train},{Train Clip}},
legend style={at={(0.03,0.97)}, anchor=north west, draw=white!80.0!black},
tick align=outside,
tick pos=left,
x grid style={white!69.01960784313725!black},
xlabel={$\dim(z)$},
xminorticks=true,
xmode=log,
xmin=10, xmax=300,
y grid style={white!69.01960784313725!black},
ylabel={PSNR},
ymin=15.8800682154579, ymax=26.0503182019626
]
As you can see the only thing I change is the parameter xmax.
Thank you in advance
I'd like to show something like below, i see that bubble chart supports only number/literals on XAxis but I want to plot x axis as time, Y as Number value and Z (bubble) as number.
Is it possible
Please refer the fiddle codehttp://jsfiddle.net/yuvarajkumarg/az290eyq/1/
In Highchart of type Chart, when we plot for height = 0 and pressure = 2, we get a gap as shown in jsfiddle. I want point to be plotted on the X-axis(2,0). But the graph looks like it is plotted on (2,2) since the y-axis plot starts way above the x-axis. How to remove the gap ?
The issue is the categorized axis.
There are probably a few ways around the issue, but I would do it this way (on your xAxis):
tickmarkPlacement: 'on',
min:0.5,
max:6.5
Example:
http://jsfiddle.net/az290eyq/2/
You could also do it by not using categories, and using the axis label formatter in order to display the numeric sequence that you need.
[[ edit for comments:
For the min and max values - the x axis values for a categorized axis are the category array index values. So the first category is x = 0, the second is x = 1, etc.
Because Highcharts puts the the label in the center of the value's space, setting the min/max to the actual min/max value +/- 0.5 will align the center of the space with the start/end of the axis.
So, you can calculate this dynamically by using 0.5 for the min, and counting the categories array and using (count -1.5) as the max.
Additionally, setting the tickmarkPlacement proerty to 'on' moves the tick mark to the center of the space as well, aligning the ticks with the start/end of the axis as well.
How to auto adjust plot lines in live plot
for example:Plot line i set to value:1.25 and random data are coming between 1-2.plot line will be visible.this works fine.suppose random data coming in the range 100-200,plot line will become hidden. i want to adjust plot lines irrespective of random data we generate.plot lines always visible.
set the max plot line value to any fixed number plots the plot line.
from then onwards the plot line will be visible. if the value of plot lines is very small compared to the scale then it may be tough. in this case go for a logarithmic scale. That will help.
yAxis:{
type: 'logarithmic'
}
updated your fiddle at http://jsfiddle.net/z6QXW/12/
hope this will help you