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}
Related
I successfully drawn a multiline chart using Charts library in Swift. However there is a minor customisation I need. Looking up the documentation I haven't found anything relative in the properties of datasets and line chart.
Here's slice of screenshot from my multiline chart.
My requirement is all the lines should start from Y-Axis but the first nodal point which is on Left axis shouldn't have a circle on it e.g the (0, 30) point.
Remaining all the nodal points must have a circle on them as shown in the image. Is any property out there in any class which toggles off the first nodal point or any other alternate customization I can do to achieve this?
I have a specific problem: I want to place a chart in my latex document as a pdf figure, and the legend as separate figure outside the chart (in order to do not cover the information in the chart).
In order to do that I've been using the following trick:
\begin{textblock}{2}(12,7.02)
\includegraphics[scale=.3]{graphics/ch5_cl_legend2.pdf}
\end{textblock}
In this way I can decide the exact position of the legend.
The problem is that if I add new text before the chart, or in general the chart changes the position, the legend will stay in the position I specified, therefore I have to change it manually.
I would like to obtain the position of the primary figure, the chart, and store it in a variable; then use this variable plus some constant offsets to specify the position of the second figure, the legend.
I thought that doing something like this would hook the legend to the chart, but it didn't:
\begin{figure}[h!]
\centering
\includegraphics[scale=.5]{graphics/ch5_s0_fh.pdf}
\begin{textblock}{2}(12,7.02)
\includegraphics[scale=.3]{graphics/ch5_cl_legend2.pdf}
\end{textblock}
\vspace{-0.15cm}
\caption{mycaption}
\label{fig:ch5_s0_s_fh}
\vspace{-0.3cm}
\end{figure}
Thanks a lot for any suggestions you may have, they'll be very appreciated!
G.
I have the following chart as an example. I would like to move the points over B such that 1% is over the orange column, and the 2% is over the blue column. Is this possible?
http://jsfiddle.net/0m3208qj/4/
code
The points are positioned according to the y value. So if you need increae position of it, you need to prepare another y values.
I managed to do this, but in a complicated way. I had to split the points into two series, use pointPlacement to move them to the correct place, and then use the renderer to draw custom lines!
Here is an example: http://jsfiddle.net/8datkr4m/
Code
I have two series in my highchart. One bar and one line chart. I want the datapoints of the line chart be represented at rectangle or straight lines instead of dots. Is that possible?
Are you looking for "square"? Explained here.
This Link is a similar example from highcharts.com which i'm working on. I'm trying to place the labels for plot bands on y axis. But as you can see the labels are overlapping on the chart which isn't that good. If i wanna color the labels with the same color of the corresponding plotbands, the label doesn't show up. Is there a way to place it completely outside without overlapping?
Thanks in advance.
A possible solution is to add right margin to the chart, and move the labels over.
Add a marginRight to the chart, and on each label, use x to determine its starting x position.
marginRight:110
and
x: 90 on each label.
http://jsfiddle.net/7xb1Lgx6/ the fiddle.
I think it's not possible to do it yet.
If you add labels to the plotbands it will overlap them.
You can align your labels but if you set x more than your chart width, it will not appear on your chart.
demo