About "mirroing" a graph

Hanri Yago

i would like to know how i can mirror a graph in order to, for example, transform an X axis (-200 -100 0 100 200) into (200 100 0 100 200).

I tried to do it in this script:

import numpy as np
import matplotlib.pyplot as plt
T=1400
Q=1000
R=1000
h0=50

r=np.linspace(-R, R, 500)
s=Q*np.log(R/abs(r))/(2*np.pi*T)
npiez=h0-s
fig,ax=plt.subplots()
ax.plot(r,npiez)

And all i got was this graph:graph

My objective was something like this one: https://i.stack.imgur.com/iOTHc.png

Caleb Carson

To clarify, do you only want the graph to display the positive values on the right? What does your starting plot look like and what do you want it to end as?

edit: I got it to work by modifying the xtick values with abs function.

import numpy as np
import matplotlib.pyplot as plt
T = 1400
Q = 1000
R = 1000
h0 = 50

r = np.linspace(-R, R, 500)
s = Q * np.log(R / np.abs(r)) / (2 * np.pi * T)
npiez = h0 - s
fig, ax = plt.subplots()
ax.plot(r, npiez)
ax.set_xticklabels([abs(int(x)) for x in ax.get_xticks()])

plt.show()

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

About directionality in a topological graph

Graph Theory about connectivity

Question about Drawing a graph with networkx

Some questions about this bar graph code

R graph more questions about parametrization

Graph DFS - Confused about the return value of recursion

Confusion about plotly offline and updating a graph in jupyter notebook

Question about ggplot2 bar graph transformation method

How to create a graph like this in matplotlib about novel corona virus?

Tensorflow: Does a tflite file contain data about the model architecture? (graph?)

Basic questions about nested blockmodel in graph-tool

About R ggplot2 could not plot correct graph in for loop

Get Info about a secret Facebook Group via Graph Api

How to transform directed graph to undirected graph while recording information about attributes using NetworkX?

Java confusion about Runtime.memory() vs. Windows' Physical Memory Usage History graph

Java confusion about Runtime.memory() vs. Windows' Physical Memory Usage History graph

Why am I able to change the value of a tensor without the computation graph knowing about it in Pytorch with detach?

How to get information about groups liked by a user using Facebook Graph API

SBT warns about potentially incompatible Scala versions which don't show up in dependency-graph

How can I reposition tooltips used to display information about highlighted points after zooming in on a flot graph?

expand=fields($select=***,****) on the SharePoint Graph resource doesn't work and how about filtering?

How can I build a RDF graph about some individuals with a single CONSTRUCT?

Microsoft Graph: Groups request failing with error about expanded list entry types

Get information about invitation of B2B user in Microsoft Graph

What is the metric definition for talking_about_count under the Page Graph API?

volume of solid bounded by the graph of y = cos(x), the x−axis, and the y− axis over the interval [0, π/4] is revolved about the x-axis

How can I silently get an access token to retrieve information about currently logged in user from the windows graph API?

Can't grant permissions for MS Asure graph API client app to fetch data about ManagedDevices. How to overcome?

R - ggplot2 - plot_likert - Plot two different likert scales about related topic on one graph