I am not sure what I am doing wrong in my code. I just want illustrate four columns consisted of different numbers as plot markers.
ListPlot[{{1, 2, 3, 4}, {2, 1}, {2, 2}, {3, 1}, {3, 2}, {4, 1}, {4, 2}},
PlotMarkers -> {"\[Pi]", "8", "9", "10", "2", "5", "3", "4", "1",
"\!\(\*SqrtBox[\(2\)]\)"}, Ticks -> None, AxesLabel -> {"Number of
columns", "Size of the columns"}]
But I get this plot output:
Any help or a hint will be greatly appreciated.
Thank you.
UPDATE: I have figured out the wrong format of my code thanks to @Graumagier.
But, I have searched in google how to change the scale of the x-axis because automatically in the plot the coordinates with $x=1$ are very close to the y-axis. Is there any way to adjust that?
{}
for each of the one-element lists ({{2, 1}}, {{2, 2}}, {{3, 1}}, {{3, 2}}, {{4, 1}}, {{4, 2}}
), otherwiseListPlot
won't interpret them as points with two coordinates, but as lists of two points. And I'm not really sure what you're trying to do with{1,2,3,4}
. $\endgroup${1,1},{1,2},{1,3},{1,4}
but followed an example here where uses different code:ListPlot[{{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}, {4, 5, 7, 10, 12}}, PlotMarkers -> {"\[Alpha]", "\[Beta]", "\[Gamma]"}]
$\endgroup${1,2,3}
corresponding implicitly to{{1,1},{2,2},{3,3}}
) or lists of points with explicit x and y coordinates (e.g.{{1,2}}
), in which case you have to make sure to use the right (double) parentheses. You can mix those of course, but if you get duplicate points in the process you end up with overlaying labels like in your case. $\endgroup$ListPlot[ {{{4, 1}}, {{4, 2}}}, PlotMarkers -> {"1", Sqrt[2]} ]
. Here's an example of mixed list formats, maybe that will make it clearer:ListPlot[ {{1, 2, 3, 4}, {{2, 1}}, {{3, 2},{3, 4}}}, PlotMarkers -> {"1", Sqrt[2], "3"} ]
. $\endgroup$PlotRange-> {{0, 5}, Automatic}
to control the scale on thex
axis. $\endgroup$