Group Abstract Group Abstract

Message Boards Message Boards

0
|
4K Views
|
10 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to align Y-axes when using GraphicsColumn?

Posted 3 years ago

Hello, When I tried to align several graphics yaxes aligned using GraphicsColumn, they can't. Is there a way to solve this problem?

a = Plot[Sin[x], {x, 15, 25}]; b = BarChart[{100, 20000, 3}]; c = 
 ListPlot[{{1, 2}, {3, 4}, {5, 6}}]; e = 
 Table[d + f, {d, {1, 2, 3}}, {f, {0, 1, 2}}]; g = {"C1", "C2", 
  "C3"}; h = {"L1", "L2", "L3"}; i = 
 Dataset[AssociationThread[h, AssociationThread[g, #] & /@ e]]; j = 
 BarChart[i[All, "C1"]]; GraphicsColumn[{a, b, c, j}]
POSTED BY: Zhenyu Zeng
10 Replies
Posted 3 years ago

Hello, Thanks for your reply. I never saw ResourceFunction before, so you open a door to another part of Mathematica for me. Every foreigner I met told me that they can't learn Chinese, as it is too difficult. You have a natural gift for language.

POSTED BY: Zhenyu Zeng
Posted 3 years ago

You don't have to download anything, just evaluate the expression, the resource function will be automatically downloaded and cached.

ResourceFunction["SomeFunctionName"][arguments]

e.g.

ResourceFunction["PlotGrid"][
 {
  {Plot[x, {x, 0, 1}, Frame -> True]},
  {Plot[x^2, {x, 0, 1}, Frame -> True]}
  },
 FrameLabel -> {"x axis", "y axis"}
 ]

You Chinese is pretty good

我住了在中国一年了。四个月在杭州,八个月在上海

POSTED BY: Rohit Namjoshi
Posted 3 years ago

Hello, Thanks for your reply. You Chinese is pretty good. How should I use it? After downloading that notebook, what should I do then?

POSTED BY: Zhenyu Zeng
Posted 3 years ago

My Mathematica does not either. Did you click on the link? It is a function from the Wolfram Function Repository which has over two thousand user contributed functions that you can use.

ResourceFunction["BirdSay"]["曾先生怎么样"]
POSTED BY: Rohit Namjoshi
Posted 3 years ago

Yes. Your idea is so good!

POSTED BY: Zhenyu Zeng
Posted 3 years ago

Hello, My Mathematica doesn't have PlotGrid function.

POSTED BY: Zhenyu Zeng

Windows 10 Mathematica 12.0

Perfectly aligned.

You might try:

Ticks -> {True, False}
POSTED BY: Robert Nowak
Posted 3 years ago

Looks like the Plot and the BarChart are aligned and the ListPlot is not. Report the issue to Wolfram Support. You may be able to work around it by adjusting ImagePadding. Try PlotGrid, it may handle axis alignment better.

POSTED BY: Rohit Namjoshi
Posted 3 years ago

In Windows 11 with Mathematica 13.0.1, they are not aligned: enter image description here

POSTED BY: Zhenyu Zeng
Posted 3 years ago

Looks aligned on "13.0.1 for Mac OS X ARM (64-bit) (January 28, 2022)". What are you seeing? You mention GraphicsGrid but it is not present in the code example.

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