Creating a plot with primary and secondary axis

deepeshjdeepeshj MemberPosts:7Contributor II
Hello All,

我试图创建a plot that combines the volume in various categories as a bar plot (on the primary axis). I want to superimpose a line chart with the rates, but on the secondary axis. I do not see any option to plot the additional chart on the secondary axis.

Please help if this at all can be done within RM.

Thanks!!
Tghadially

Best Answer

  • varunm1varunm1 Moderator, MemberPosts:1,207Unicorn
    edited September 2019 Solution Accepted
    Hello@deepeshj

    I am sure what you are asking can be done in RM visualizations. I assume you are looking to get two Y-axis opposite to each other rather than, single y-axis with two (If this is the case@gopalasolutions works well) this is what I am thinking based on your question relating to the axis. The left y-axis is primary and the right y-axis is secondary.


    This can be done as well, follow the below steps.
    1. Add a plot similar to gopala suggestion. And select the relevant X-axis and Y-axis



    2. Now you need to add a new y-axis, scroll down and you will find y-axis, expand it. Click on add new y-axis as shown in the left figure and then change the axis style of y2 axis based on right side image, click on axis style and select opposite.



    3. Finally, you need to link this y2 to plot 2 as shown below. If you scroll up, you can see plot 2 and option linked Y-axis where you need to change the default y1 to y2 in plot 2.



    4. The final plot for titanic training data set with Age in the x-axis, No of siblings on y1 axis (Primary) and Passenger fare on y2 axis (Secondary).



    Hope this helps.
    Regards,
    Varun
    https://www.varunmandalapu.com/

    Be Safe. Follow precautions and Maintain Social Distancing

    sgenzer yyhuang lionelderkrikor deepeshj

Answers

  • arjun_gopalarjun_gopal MemberPosts:7Contributor II
    Hi Deepesh,
    You can use "Add new plot" as shown below, hope it helps.



    Tghadially sgenzer varunm1 deepeshj
  • deepeshjdeepeshj MemberPosts:7Contributor II
    Hi@gopala-I was able to create charts of the type you shared but this wasn't what I was looking for. May be my question wasn't clear. Anyways, thanks!!
  • deepeshjdeepeshj MemberPosts:7Contributor II
    Hi@varunm1-This is exactly what I was trying to create. Thanks a lot!!
    varunm1 Tghadially
Sign InorRegisterto comment.