How can one creat a simple, 2 dimensional plot of a basic inequality. The result is a numbered line with one or two lines overlaid. The line or lines would begin or end with an arrow, a filled-in circle, or an open circle.
Using matplotlib, is there a way to create simple 2d plots of basic inequalities
294 Views Asked by sophware AtThere are 2 best solutions below
Natsfan
On
Yes, there is. Add matplotlib to your python distribution and then import it in your code. I usually use the following when importing it. import matplotlib.pyplot as plt. Then I can use the following line also in my python code: plt.plot(x, y)` This will give you a simple x,y plot of the values you have defined.
In the line import matplotlib.pyplot as plt, I'm loading maplotlib as plt. This allows you to refer to it as plt. The x-axis can be defined by the user as a set of values or you can generate the x-values by using something like x = np.linspace(0, 20, 200) where linspace is a function to generate equally spaced points. The 0 and 20 refer to the xmin and xmax values while 200 is the number of x-values generated.
you can also simply do
x = (1,3,5,9,11,13)
y = (1,9,25,81,121,169)
and plt.plot(x,y)
Related Questions in MATPLOTLIB
- How to use meshgrid with large arrays in Matplotlib?
- how to change matplotlib default figure location on screen
- Matplotlib does not display interactive graph in Ipython
- term frequency over time: how to plot +200 graphs in one plot with Python/pandas/matplotlib?
- how to use Pyplot module of matplotlib to plot two arrays of data
- Matplotlib 3d: surface does not cover a line
- Trying to get matplotlib/numpy to work. Have tried different solutions and out of ideas
- Using matplotlib.pyplot in iPython Notebook
- Matplotlib Table's Font Size
- Python3 embedding Matplotlib Plot inside GTK3 using Glade
- How can I draw a scatter plot with contour density lines in polar coordinates using Matplotlib?
- Pandas plot dataframe as scatter complains of unknown item
- A right way to represent 4 dimension points using colors in a matplotlib scatter
- Matplotlib disappearing plots multiple axis
- Direct chart plotting Pandas DataFrame columns to Xlsxwriter in a loop
Related Questions in PLOT
- Interactive plotting with R raster: values on mouseover
- Octave Real time plotting
- draw the y-label on the top of y axis
- How to use plotyy for 2 different plots inside a subplot?
- MatLab 3-vector plot/mesh with colour-scale
- Display value of Y axis inside GUI plot
- term frequency over time: how to plot +200 graphs in one plot with Python/pandas/matplotlib?
- R: ggplot2: Unable to plot points from a data.frame
- Combine base and ggplot graphics in R figure window in different pages
- Categorical scatter plot in Matlab
- Python3 embedding Matplotlib Plot inside GTK3 using Glade
- Plot: Add legend that overlay several Frames
- R: melting a data.frame to use in ggplot2 for multiple y-value plot
- Matlab: discontinuous plot
- How to plot colors on CIE 1931 Color Space in Matlab?
Related Questions in JUPYTER
- Executing Javascript cells in Jupyter Notebooks
- Displaying ggplot2 graphs from R in Jupyter
- Jupyter notebook with bibtex citations
- seaborn barplot() output figure is overwritten
- How can I see function arguments in IPython Notebook Server 3?
- Jupyter (ipython notebook), hide menu and some toolbar buttons, or run python code on loading
- Julia parallel computing in IPython Jupyter
- Spark 1.4 increase maxResultSize memory
- Unable to run ipython-notebook 2.7 with jupyterhub
- Simplest Way to Serve Jupyter Incubator Dashboards Locally
- How do I get IntelliJ/PyCharm to recognize an active IPython kernel?
- AttributeError in fit_transform(self, raw_documents, y)
- Jupyter Notebook - .ipynb files - opening as plain text - No longer interactive notebook
- Using pipes to capture things printed to STDERR into Python variable from Jupyter
- ImportError: No module named hmm
Related Questions in INEQUALITY
- Is there a way to evaluate a system of disequations?
- Why won't the 'linordered_field_class.frac_le' rule work? (Isabelle)
- Finding numbers greater than the average - why is my IF statement not working properly?
- Filter data.table using inequalities and variable column names
- MATLAB 'for' loop skipping IF statement
- Mathematica: finding the conditions for the real part of a complex number to be positive, unexpected/redundant output of Reduce
- Java optimization: speed of inner loops inconsistent?
- What is the difference between != and <>?
- R comparing unequal vectors with inequality
- inequality and == in a if
- How to use correctly SLSQP algoritm with non-linear constraints?
- Detecting inconsistency in a set of non-strict inequalities
- Graphing Inequalities in matplotlib python
- How <> works when compared with multiple values?
- Plotting Inequalities in Sympy Python
Related Questions in INEQUALITIES
- Python inequality operators; comparing lists
- Inequality solving using Prolog
- Making sense of inequality comparisons between a number and a boolean
- Solve linear Inequalities
- How do one solve linear programming problems with ojAlgo?
- Detecting inconsistency in a set of non-strict inequalities
- Double variable if statement not working
- Using matplotlib, is there a way to create simple 2d plots of basic inequalities
- How to combine two inequality answers into the same line
- Dynamically generate constrained solutions that meet multiple criteria
- Replace inequalities in a dataframe with different types of elements in R
- How to solve inequalities with Symja?
- Solving simultaneous equations/inequalities
- clicker game images not updating
- Trouble plotting inequalities and controlling linetype and color/pattern of fill
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

Some techniques that you can use:
zorders so that the lines are on top of the xaxisplt.subplots(nrows=...), setting thefigsizeaccordinglyHere is some code to get you started.