Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.1K Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

[Solved] Using list to ListPlot but force the range of x-axis

Posted 6 years ago

Hi guys, I plot some list the graphic is perfect (every dot corresponding to a %). But, on the x-axis is scaled 1 to 3, and I want it to follow some hours (24, 72, 168). I made a dumb solution just to visualize what I want. Does anyone has a tips / solution? I appreciate the help <3

What I want enter image description here

Dumb solution enter image description here

POSTED BY: silvia daou
3 Replies
Posted 6 years ago

it worked!!!! Thanks so much T_T <3 i get confuse with "the way mathematica" thinks.

POSTED BY: silvia daou

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

The rules explain how to format your code properly. If you do not format code, it may become corrupted and useless to other members. Please EDIT your post and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

enter image description here

As an alternative, you can embed your notebook using the button "Add Notebook"

POSTED BY: EDITORIAL BOARD
Posted 6 years ago

Silvia:

ListPlot can handle several different shapes of data.

When you pass in a list of list of numbers, ListPlot assumes that you want to plot 3 variables. Since you passed a list of numbers for each of those variables, ListPlot assumes you provided the y values and it assumes the x values, starting at one and counting up. That is why you have three x values (1, 2 and 3).

If you instead pass in a list of list of points, you will get what you are looking for. That would look something like:

ListPlot[{{{24, 5}, {72, 10}, {168, 8}}, {{24, 15}, {72, 32}, {168, 10}}, {{24, 25}, {72, 64}, {168, 15}}]

The documentation explains this a bit better, but it takes a while to get used to the Wolfram documentation style.

Good luck and have a great and safe rest of your week.

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