Group Abstract Group Abstract

Message Boards Message Boards

0
|
11.3K Views
|
6 Replies
|
1 Total Like
View groups...
Share
Share this post:

How to shift functions in a multiple-function plot?

Attachments:
POSTED BY: Ricardo Garcia
6 Replies

Here is a way:

values = {0, 1.0812, 2.1096, 2.8883, 3.2302, 4.8815, 5.3394, 5.4031, 
   5.2447};
Show[Table[
  Plot[values[[n]], {x, n - 1, n}, 
   PlotStyle -> Directive[Black, Thickness[.01]]], {n, 
   Length[values]}], PlotRange -> All]

You can adjust the thickness to your needs.

POSTED BY: Gianluca Gorni
POSTED BY: Ricardo Garcia

Thank you! No, the colors don't need to be any color in particular.

POSTED BY: Ricardo Garcia

One way is like this:

startingPlot = 
  Plot[{0, 1.0812, 2.1096, 2.8883, 3.2302, 4.8815, 5.3394, 5.4031, 
    5.2447}, {x, 1, 2}];
Graphics[GeometricTransformation[First@startingPlot, 
  ShearingTransform[.1Pi, {1, 0}, {0, 1}]], Frame -> True]

A different approach, with different domains for the plots:

values = {0, 1.0812, 2.1096, 2.8883, 3.2302, 4.8815, 5.3394, 5.4031, 
   5.2447};
Show[Table[Plot[values[[n]], {x, n - 1, n}], {n, Length[values]}], 
 PlotRange -> All]

Yet another, using ListPlot:

values = {0, 1.0812, 2.1096, 2.8883, 3.2302, 4.8815, 5.3394, 5.4031, 
   5.2447};
ListPlot[values, PlotMarkers -> "\[LongDash]"]

Do you need the lines to be of some particular colors?

POSTED BY: Gianluca Gorni

Thank you very much. Is there a way to do it so that the y-axis values are also shown?

POSTED BY: Ricardo Garcia

One way is to apply a ShearingTransform to your plot

Graphics[GeometricTransformation[
  First@Plot[{0, 1.0812, 2.1096, 2.8883, 3.2302, 4.8815, 5.3394, 
     5.4031, 5.2447}, {x, 1, 1.1}], 
  ShearingTransform[Pi/3, {1, 0}, {0, 1}]]]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard