Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.2K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

MultipleAxesListPlot: second Axis-Label and problem with Labeled

Hi guys, i am new to Mathematica and want to plot some data with two Axes. I found the function MultipleAxesListPlot. But there are some problems when trying to Label the data.

The following Example of using the MultipleAxesListPlot is not working:

data1 = {{16, 6}, {20, 10}, {32, 61}, {44, 461}}; 
data2 = {{16, 0.514}, {20, 0.538}, {32, 0.613}, {44, 0.686}};

data1Labeled = Labeled[#, ToString[#[[2]]]] & /@ data1;
data2Labeled = Labeled[#, ToString[#[[2]]]] & /@ data2;

ResourceFunction["MultipleAxesListPlot"][{data1Labeled, data2Labeled}, 
 FrameLabel -> {"Punktabstand [\[Micro]m]", `enter code here` "Lebensdauer [\[Micro]s]"} ]

... while this one is working:

ResourceFunction["MultipleAxesListPlot"][{data1Labeled, data2}, 
 FrameLabel -> {"Punktabstand [\[Micro]m]", 
   "Lebensdauer [\[Micro]s]"} ]

I am wondering why the second dataset cant be Labeled...

And the second question is: Is there a possibility to add a Label to the second Axis?

Thank you for your help! Greetings, Tom

Attachments:
POSTED BY: Tom Burgard
Posted 4 years ago

Hi Tom,

Looks like a bug in MultipleAxesListPlot. Use CombinePlots instead, it is much more versatile.

p1 = ListPlot[data1Labeled, Frame -> True];
p2 = ListPlot[data2Labeled, Frame -> True, PlotStyle -> Red, FrameStyle -> Red];

ResourceFunction["CombinePlots"][p1, p2,
  "AxesSides" -> "TwoY", 
  FrameLabel -> {"Punktabstand [\[Micro]m]", "Lebensdauer [\[Micro]s]", None, "ABC"}]

enter image description here

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard