Author |
Topic |
|
WagMore
USA
10 Posts |
Posted - 02/17/2016 : 1:17:58 PM
|
Origin 2016 and Service Release (Select Help-->About Origin): Operating System: Windows 10
so, i am reviewing Origin 2016 - made a simple bar chart, but when i try to add a horizontal line (GRaph/Add Straight Line, fill in appropriate boxes) no line appears, only a label naming the point on the y-axis where the line should be. what am i doing wrong?
and, what i really want is to add a horizontal bar of shading behind the data bars...any hints? |
|
snowli
USA
1390 Posts |
Posted - 02/17/2016 : 2:29:58 PM
|
Just want to clarify, did you create a column plot (vertical bars) or bar plot (horizontal bars).
If you plotted column plot and then want to add some shade from some horizontal line, you can click File: New: Function Plot: 2D Function Plot. Add a line plot such as y=2, if y=2 is the line you want to add. Choose Add to Active Graph at the bottom dropdown list.
You can then double click the line to open Plot Details dialog. On Line tab, check Fill Area under Curve. Go to Pattern tab to change fill in color.
By default the latter added line plot is draw on top of existing column plot. In Origin 2016, you can click Object Manager tab (docked on right side of workspace) to turn it on . Then drag the line plot up or right click to Move up.
Then the newly added horizontal line with shade below it will be behind the original column plot.
Like this:
Thanks, Snow |
|
|
WagMore
USA
10 Posts |
Posted - 02/17/2016 : 2:49:47 PM
|
Thanks Snow! Such a cool work-around! the background shading worked great....prompting me to ask how to refine it. is it possible to restrict the shading to a band, rather than filling all space below the line? (on my y-axis from 0 - 350, i would like to shade the area between 25 and 50)
also, when i used object manager to move the shading behind the vertical bars my y-axis labels were jumbled together. originally i had both point labels and group labels for the y-axis. when i move the shading back to the top, the y-axis labels are restored...
thank you!!! |
|
|
snowli
USA
1390 Posts |
Posted - 02/17/2016 : 3:37:51 PM
|
So with your column graph active, use Function Plot twice to add two horizontal lines. One y=25 and y=50.
Then double click the line plot and make sure the 1st line plot is choosen on the left panel.
On Line tab, check Fill Area Under Curve. In the dropdown list, choose Fill to next data plot - one color.
It will fill the shade between the two lines.
Then drag the column plot down to be the last one in Object manager
Again Origin's plot order is draw the 1st one first, then second on the top of first, and so on.
As to Y axis label, maybe you are talking about Y axis title? By default Origin uses 1st plot's long name or short name as axis title. You can double click the Y axis title. I twill show %(?Y). You can change it into %(3Y) since after adding 2 function plots and moved them up column plot will be the 3rd y plot in graph.
I am not sure what you mean by Group labels for y axis.
Thanks, Snow |
|
|
WagMore
USA
10 Posts |
Posted - 02/17/2016 : 4:16:53 PM
|
Oh Snow, your method makes a beautiful band, and it looks great behind the vertical bars, but i cannot suss out how to keep my y-axis labels (i.e. the label for each vertical bar, not the title) when i move the vertical bars to the bottom of object manager...
|
|
|
snowli
USA
1390 Posts |
Posted - 02/17/2016 : 4:27:51 PM
|
Can you put a screenshot of before and after the label issue?
Where are those labels from. Do you use Label tab in Plot Details to turn them on or did you set a column as L to plot it as label.
I couldn't picture it:(
Thanks, Snow |
|
|
WagMore
USA
10 Posts |
Posted - 02/18/2016 : 09:04:47 AM
|
here are before and after shots - thanks for your persistence! |
|
|
WagMore
USA
10 Posts |
Posted - 02/18/2016 : 09:09:51 AM
|
the site names are set as X, the group names are set as labels; both are unsorted. thanks! |
|
|
snowli
USA
1390 Posts |
Posted - 02/18/2016 : 09:37:25 AM
|
Hello,
Could you send your opj to me, with attention to Snow?
I tried a grouped column plot with tick label table but there is no problem. It will be easier for me to what happened with your opj.
Or another way to try is: Choose Graph: New Layer (Axies): Right Y to add a second layer with right Y range.
Double click anywhere in graph to open Plot Details dialog. With RightY selected on the left. Go to Link Axes Scales tab. Set Y Axis Link to Straight 1:1.
Make sure 2 icon on upper left corner is pressed, use Function Plot to add two function plots at y= With 2 pressed, use Function plot to add y=25 and =50 and fill the color as before.
Origin's layers has order as well. 1st layer is plotted at bottom. Then second layer is plotted on top of it.
So choose Graph: Layer Management... menu. On left panel, there is a table to list all layers. Drag row header 2 of RightY and drag it above.
RightY will be the 1st plotted layer. Layer2 will be plotted on top of it.
Thanks, Snow |
|
|
WagMore
USA
10 Posts |
Posted - 02/18/2016 : 09:43:32 AM
|
send it via this forum, or to an email address? |
|
|
snowli
USA
1390 Posts |
Posted - 02/18/2016 : 09:47:58 AM
|
Sorry, there is a button on the top right of the forum to send Files to tech support.
tech@originlab.com.
I also updated some procedure above so u can try another method but it is more complicated.
Thanks, Snow |
|
|
WagMore
USA
10 Posts |
Posted - 02/18/2016 : 11:20:58 AM
|
your alternate method worked!! it is perfect, and my y-axis labels are intact! the 2nd y-axis did not easily copy the scale of the 1st y-axis, not sure what i did wrong, but i was bale to re-set the scale manually. and, just removed the labels for the right y-axis to clean it up. thanks again! |
|
|
WagMore
USA
10 Posts |
Posted - 02/18/2016 : 11:23:50 AM
|
opps, typo...it was the x-axis labels that have been the issue... |
|
|
snowli
USA
1390 Posts |
Posted - 02/18/2016 : 11:51:40 AM
|
Thank you for sending me the opj.
I can see the issue with your graph but when i plot from scratch, there is no such problem.
So I'd like to see if you saved graph template and used the template to plot the graph and the steps.
BTW, i mentioned in my reply email another way is to just add a rectangle object in the graph. You can push the rectangle object behind the plot so it can get the same effect.
Draw the rectangle in same position isn't straight foward. That's why i didn't mention that method before.
So you can pick which way works better for you.
Thanks, Snow |
|
|
|
Topic |
|